Commit c20c76ac authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Merge tag 'soundwire-5.6-rc1' of...

Merge tag 'soundwire-5.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire into char-misc-next

Vinod writes:

soundwire updates for v5.6-rc1

This round we have bunch of updates to interfaces for ASoC (audio)
subsystem by Intel and a new Qualcomm controller driver

Details
 - Updates for sdw_slave interfaces for ASoC
 - Updates to cadence library and intel driver
 - New Soundwire controller for Qualcomm masters
 - Rework of device number assignment

* tag 'soundwire-5.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire: (27 commits)
  dt-bindings: soundwire: fix example
  soundwire: cadence: fix kernel-doc parameter descriptions
  soundwire: intel: report slave_ids for each link to SOF driver
  soundwire: intel: fix factor of two in MCLK handling
  soundwire: bus: fix device number leak on errors
  soundwire: cadence: remove useless variable incrementation
  soundwire: cadence: update kernel-doc parameter descriptions
  soundwire: qcom: add support for SoundWire controller
  dt-bindings: soundwire: add bindings for Qcom controller
  soundwire: bus: check first if Slaves become UNATTACHED
  soundwire: cadence_master: handle multiple status reports per Slave
  soundwire: cadence_master: remove config update for interrupt setting
  soundwire: cadence_master: log more useful information during timeouts
  soundwire: cadence_master: clear interrupt status before enabling interrupt
  soundwire: cadence_master: filter out bad interrupts
  soundwire: stream: remove redundant pr_err traces
  soundwire: intel: add clock stop quirks
  soundwire: intel: add mutex for shared SHIM register access
  soundwire: intel: add prototype for WAKEEN interrupt processing
  soundwire: intel: add link_list to handle interrupts with a single thread
  ...
parents 1660557b 5098cae1
Loading
Loading
Loading
Loading
+167 −0
Original line number Original line Diff line number Diff line
Qualcomm SoundWire Controller Bindings


This binding describes the Qualcomm SoundWire Controller along with its
board specific bus parameters.

- compatible:
	Usage: required
	Value type: <stringlist>
	Definition: must be "qcom,soundwire-v<MAJOR>.<MINOR>.<STEP>",
		    Example:
			"qcom,soundwire-v1.3.0"
			"qcom,soundwire-v1.5.0"
			"qcom,soundwire-v1.6.0"
- reg:
	Usage: required
	Value type: <prop-encoded-array>
	Definition: the base address and size of SoundWire controller
		    address space.

- interrupts:
	Usage: required
	Value type: <prop-encoded-array>
	Definition: should specify the SoundWire Controller IRQ

- clock-names:
	Usage: required
	Value type: <stringlist>
	Definition: should be "iface" for SoundWire Controller interface clock

- clocks:
	Usage: required
	Value type: <prop-encoded-array>
	Definition: should specify the SoundWire Controller interface clock

- #sound-dai-cells:
	Usage: required
	Value type: <u32>
	Definition: must be 1 for digital audio interfaces on the controller.

- qcom,dout-ports:
	Usage: required
	Value type: <u32>
	Definition: must be count of data out ports

- qcom,din-ports:
	Usage: required
	Value type: <u32>
	Definition: must be count of data in ports

- qcom,ports-offset1:
	Usage: required
	Value type: <prop-encoded-array>
	Definition: should specify payload transport window offset1 of each
		    data port. Out ports followed by In ports.
		    More info in MIPI Alliance SoundWire 1.0 Specifications.

- qcom,ports-offset2:
	Usage: required
	Value type: <prop-encoded-array>
	Definition: should specify payload transport window offset2 of each
		    data port. Out ports followed by In ports.
		    More info in MIPI Alliance SoundWire 1.0 Specifications.

- qcom,ports-sinterval-low:
	Usage: required
	Value type: <prop-encoded-array>
	Definition: should be sample interval low of each data port.
		    Out ports followed by In ports. Used for Sample Interval
		    calculation.
		    More info in MIPI Alliance SoundWire 1.0 Specifications.

- qcom,ports-word-length:
	Usage: optional
	Value type: <prop-encoded-array>
	Definition: should be size of payload channel sample.
		    More info in MIPI Alliance SoundWire 1.0 Specifications.

- qcom,ports-block-pack-mode:
	Usage: optional
	Value type: <prop-encoded-array>
	Definition: should be 0 or 1 to indicate the block packing mode.
		    0 to indicate Blocks are per Channel
		    1 to indicate Blocks are per Port.
		    Out ports followed by In ports.
		    More info in MIPI Alliance SoundWire 1.0 Specifications.

- qcom,ports-block-group-count:
	Usage: optional
	Value type: <prop-encoded-array>
	Definition: should be in range 1 to 4 to indicate how many sample
		    intervals are combined into a payload.
		    Out ports followed by In ports.
		    More info in MIPI Alliance SoundWire 1.0 Specifications.

- qcom,ports-lane-control:
	Usage: optional
	Value type: <prop-encoded-array>
	Definition: should be in range 0 to 7 to identify which	data lane
		    the data port uses.
		    Out ports followed by In ports.
		    More info in MIPI Alliance SoundWire 1.0 Specifications.

- qcom,ports-hstart:
	Usage: optional
	Value type: <prop-encoded-array>
	Definition: should be number identifying lowerst numbered coloum in
		    SoundWire Frame, i.e. left edge of the Transport sub-frame
		    for each port. Values between 0 and 15 are valid.
		    Out ports followed by In ports.
		    More info in MIPI Alliance SoundWire 1.0 Specifications.

- qcom,ports-hstop:
	Usage: optional
	Value type: <prop-encoded-array>
	Definition: should be number identifying highest numbered coloum in
		    SoundWire Frame, i.e. the right edge of the Transport
		    sub-frame for each port. Values between 0 and 15 are valid.
		    Out ports followed by In ports.
		    More info in MIPI Alliance SoundWire 1.0 Specifications.

- qcom,dports-type:
	Usage: optional
	Value type: <prop-encoded-array>
	Definition: should be one of the following types
		    0 for reduced port
		    1 for simple ports
		    2 for full port
		    Out ports followed by In ports.
		    More info in MIPI Alliance SoundWire 1.0 Specifications.

Note:
	More Information on detail of encoding of these fields can be
found in MIPI Alliance SoundWire 1.0 Specifications.

= SoundWire devices
Each subnode of the bus represents SoundWire device attached to it.
The properties of these nodes are defined by the individual bindings.

= EXAMPLE
The following example represents a SoundWire controller on DB845c board
which has controller integrated inside WCD934x codec on SDM845 SoC.

soundwire: soundwire@c85 {
	compatible = "qcom,soundwire-v1.3.0";
	reg = <0xc85 0x20>;
	interrupts = <20 IRQ_TYPE_EDGE_RISING>;
	clocks = <&wcc>;
	clock-names = "iface";
	#sound-dai-cells = <1>;
	qcom,dports-type = <0>;
	qcom,dout-ports	= <6>;
	qcom,din-ports	= <2>;
	qcom,ports-sinterval-low = /bits/ 8  <0x07 0x1F 0x3F 0x7 0x1F 0x3F 0x0F 0x0F>;
	qcom,ports-offset1 = /bits/ 8 <0x01 0x02 0x0C 0x6 0x12 0x0D 0x07 0x0A >;
	qcom,ports-offset2 = /bits/ 8 <0x00 0x00 0x1F 0x00 0x00 0x1F 0x00 0x00>;

	/* Left Speaker */
	left{
		....
	};

	/* Right Speaker */
	right{
		....
	};
};
+2 −0
Original line number Original line Diff line number Diff line
@@ -69,6 +69,7 @@ examples:
            reg = <0 1>;
            reg = <0 1>;
            powerdown-gpios = <&wcdpinctrl 2 0>;
            powerdown-gpios = <&wcdpinctrl 2 0>;
            #thermal-sensor-cells = <0>;
            #thermal-sensor-cells = <0>;
            #sound-dai-cells = <0>;
        };
        };


        speaker@0,2 {
        speaker@0,2 {
@@ -76,6 +77,7 @@ examples:
            reg = <0 2>;
            reg = <0 2>;
            powerdown-gpios = <&wcdpinctrl 2 0>;
            powerdown-gpios = <&wcdpinctrl 2 0>;
            #thermal-sensor-cells = <0>;
            #thermal-sensor-cells = <0>;
            #sound-dai-cells = <0>;
        };
        };
    };
    };


+9 −0
Original line number Original line Diff line number Diff line
@@ -31,4 +31,13 @@ config SOUNDWIRE_INTEL
	  enable this config option to get the SoundWire support for that
	  enable this config option to get the SoundWire support for that
	  device.
	  device.


config SOUNDWIRE_QCOM
	tristate "Qualcomm SoundWire Master driver"
	depends on SLIMBUS
	depends on SND_SOC
	help
	  SoundWire Qualcomm Master driver.
	  If you have an Qualcomm platform which has a SoundWire Master then
	  enable this config option to get the SoundWire support for that
	  device
endif
endif
+4 −0
Original line number Original line Diff line number Diff line
@@ -21,3 +21,7 @@ obj-$(CONFIG_SOUNDWIRE_INTEL) += soundwire-intel.o


soundwire-intel-init-objs := intel_init.o
soundwire-intel-init-objs := intel_init.o
obj-$(CONFIG_SOUNDWIRE_INTEL) += soundwire-intel-init.o
obj-$(CONFIG_SOUNDWIRE_INTEL) += soundwire-intel-init.o

#Qualcomm driver
soundwire-qcom-objs :=	qcom.o
obj-$(CONFIG_SOUNDWIRE_QCOM) += soundwire-qcom.o
+41 −14
Original line number Original line Diff line number Diff line
@@ -456,9 +456,11 @@ err:
static int sdw_assign_device_num(struct sdw_slave *slave)
static int sdw_assign_device_num(struct sdw_slave *slave)
{
{
	int ret, dev_num;
	int ret, dev_num;
	bool new_device = false;


	/* check first if device number is assigned, if so reuse that */
	/* check first if device number is assigned, if so reuse that */
	if (!slave->dev_num) {
	if (!slave->dev_num) {
		if (!slave->dev_num_sticky) {
			mutex_lock(&slave->bus->bus_lock);
			mutex_lock(&slave->bus->bus_lock);
			dev_num = sdw_get_device_num(slave);
			dev_num = sdw_get_device_num(slave);
			mutex_unlock(&slave->bus->bus_lock);
			mutex_unlock(&slave->bus->bus_lock);
@@ -467,15 +469,22 @@ static int sdw_assign_device_num(struct sdw_slave *slave)
					dev_num);
					dev_num);
				return dev_num;
				return dev_num;
			}
			}
			slave->dev_num = dev_num;
			slave->dev_num_sticky = dev_num;
			new_device = true;
		} else {
		} else {
			slave->dev_num = slave->dev_num_sticky;
		}
	}

	if (!new_device)
		dev_info(slave->bus->dev,
		dev_info(slave->bus->dev,
			 "Slave already registered dev_num:%d\n",
			 "Slave already registered, reusing dev_num:%d\n",
			 slave->dev_num);
			 slave->dev_num);


	/* Clear the slave->dev_num to transfer message on device 0 */
	/* Clear the slave->dev_num to transfer message on device 0 */
	dev_num = slave->dev_num;
	dev_num = slave->dev_num;
	slave->dev_num = 0;
	slave->dev_num = 0;
	}


	ret = sdw_write(slave, SDW_SCP_DEVNUMBER, dev_num);
	ret = sdw_write(slave, SDW_SCP_DEVNUMBER, dev_num);
	if (ret < 0) {
	if (ret < 0) {
@@ -485,7 +494,7 @@ static int sdw_assign_device_num(struct sdw_slave *slave)
	}
	}


	/* After xfer of msg, restore dev_num */
	/* After xfer of msg, restore dev_num */
	slave->dev_num = dev_num;
	slave->dev_num = slave->dev_num_sticky;


	return 0;
	return 0;
}
}
@@ -979,6 +988,24 @@ int sdw_handle_slave_status(struct sdw_bus *bus,
	struct sdw_slave *slave;
	struct sdw_slave *slave;
	int i, ret = 0;
	int i, ret = 0;


	/* first check if any Slaves fell off the bus */
	for (i = 1; i <= SDW_MAX_DEVICES; i++) {
		mutex_lock(&bus->bus_lock);
		if (test_bit(i, bus->assigned) == false) {
			mutex_unlock(&bus->bus_lock);
			continue;
		}
		mutex_unlock(&bus->bus_lock);

		slave = sdw_get_slave(bus, i);
		if (!slave)
			continue;

		if (status[i] == SDW_SLAVE_UNATTACHED &&
		    slave->status != SDW_SLAVE_UNATTACHED)
			sdw_modify_slave_status(slave, SDW_SLAVE_UNATTACHED);
	}

	if (status[0] == SDW_SLAVE_ATTACHED) {
	if (status[0] == SDW_SLAVE_ATTACHED) {
		dev_dbg(bus->dev, "Slave attached, programming device number\n");
		dev_dbg(bus->dev, "Slave attached, programming device number\n");
		ret = sdw_program_device_num(bus);
		ret = sdw_program_device_num(bus);
Loading