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

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

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

Vinod writes:

soundwire updates for v5.8-rc1

This contains sdw_master_device patches and other updates done by Intel
folks.

Details:
  - sdw_master_device to represent the master instances.
  - sysfs properties for sdw_master_device and sdw_slave.
  - Documentation update for TDM modes.
  - some code cleanup patches and odd updates.

* tag 'soundwire-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire:
  soundwire: intel: use a single module
  soundwire: fix spelling mistake
  soundwire: fix trailing line in sysfs_slave.c
  soundwire: add Slave sysfs support
  soundwire: master: add sysfs support
  soundwire: disco: s/ch/channels/
  soundwire: master: add runtime pm support
  soundwire: bus_type: add sdw_master_device support
  soundwire: bus: add unique bus id
  soundwire: bus_type: introduce sdw_slave_type and sdw_master_type
  soundwire: bus: rename sdw_bus_master_add/delete, add arguments
  soundwire: intel: (cosmetic) remove multiple superfluous "else" statements
  soundwire: (cosmetic) remove multiple superfluous "else" statements
  soundwire: qcom: Use IRQF_ONESHOT
  soundwire: bus: reduce verbosity on enumeration
  soundwire: debugfs: clarify SDPX license with GPL-2.0-only
  soundwire: slave: don't init debugfs on device registration error
  Documentation: SoundWire: clarify TDM mode support
  soundwire: qcom: fix error handling in probe
  soundwire: intel: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer
parents c9cf27d9 fcbcf1f7
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
What:		/sys/bus/soundwire/devices/sdw-master-N/revision
		/sys/bus/soundwire/devices/sdw-master-N/clk_stop_modes
		/sys/bus/soundwire/devices/sdw-master-N/clk_freq
		/sys/bus/soundwire/devices/sdw-master-N/clk_gears
		/sys/bus/soundwire/devices/sdw-master-N/default_col
		/sys/bus/soundwire/devices/sdw-master-N/default_frame_rate
		/sys/bus/soundwire/devices/sdw-master-N/default_row
		/sys/bus/soundwire/devices/sdw-master-N/dynamic_shape
		/sys/bus/soundwire/devices/sdw-master-N/err_threshold
		/sys/bus/soundwire/devices/sdw-master-N/max_clk_freq

Date:		April 2020

Contact:	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
		Bard Liao <yung-chuan.liao@linux.intel.com>
		Vinod Koul <vkoul@kernel.org>

Description:	SoundWire Master-N DisCo properties.
		These properties are defined by MIPI DisCo Specification
		for SoundWire. They define various properties of the Master
		and are used by the bus to configure the Master. clk_stop_modes
		is a bitmask for simplifications and combines the
		clock-stop-mode0 and clock-stop-mode1 properties.
+91 −0
Original line number Diff line number Diff line
What:		/sys/bus/soundwire/devices/sdw:.../dev-properties/mipi_revision
		/sys/bus/soundwire/devices/sdw:.../dev-properties/wake_capable
		/sys/bus/soundwire/devices/sdw:.../dev-properties/test_mode_capable
		/sys/bus/soundwire/devices/sdw:.../dev-properties/clk_stop_mode1
		/sys/bus/soundwire/devices/sdw:.../dev-properties/simple_clk_stop_capable
		/sys/bus/soundwire/devices/sdw:.../dev-properties/clk_stop_timeout
		/sys/bus/soundwire/devices/sdw:.../dev-properties/ch_prep_timeout
		/sys/bus/soundwire/devices/sdw:.../dev-properties/reset_behave
		/sys/bus/soundwire/devices/sdw:.../dev-properties/high_PHY_capable
		/sys/bus/soundwire/devices/sdw:.../dev-properties/paging_support
		/sys/bus/soundwire/devices/sdw:.../dev-properties/bank_delay_support
		/sys/bus/soundwire/devices/sdw:.../dev-properties/p15_behave
		/sys/bus/soundwire/devices/sdw:.../dev-properties/master_count
		/sys/bus/soundwire/devices/sdw:.../dev-properties/source_ports
		/sys/bus/soundwire/devices/sdw:.../dev-properties/sink_ports

Date:		May 2020

Contact:	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
		Bard Liao <yung-chuan.liao@linux.intel.com>
		Vinod Koul <vkoul@kernel.org>

Description:	SoundWire Slave DisCo properties.
		These properties are defined by MIPI DisCo Specification
		for SoundWire. They define various properties of the
		SoundWire Slave and are used by the bus to configure
		the Slave


What:		/sys/bus/soundwire/devices/sdw:.../dp0/max_word
		/sys/bus/soundwire/devices/sdw:.../dp0/min_word
		/sys/bus/soundwire/devices/sdw:.../dp0/words
		/sys/bus/soundwire/devices/sdw:.../dp0/BRA_flow_controlled
		/sys/bus/soundwire/devices/sdw:.../dp0/simple_ch_prep_sm
		/sys/bus/soundwire/devices/sdw:.../dp0/imp_def_interrupts

Date:		May 2020

Contact:	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
		Bard Liao <yung-chuan.liao@linux.intel.com>
		Vinod Koul <vkoul@kernel.org>

Description:	SoundWire Slave Data Port-0 DisCo properties.
		These properties are defined by MIPI DisCo Specification
		for the SoundWire. They define various properties of the
		Data port 0 are used by the bus to configure the Data Port 0.


What:		/sys/bus/soundwire/devices/sdw:.../dpN_src/max_word
		/sys/bus/soundwire/devices/sdw:.../dpN_src/min_word
		/sys/bus/soundwire/devices/sdw:.../dpN_src/words
		/sys/bus/soundwire/devices/sdw:.../dpN_src/type
		/sys/bus/soundwire/devices/sdw:.../dpN_src/max_grouping
		/sys/bus/soundwire/devices/sdw:.../dpN_src/simple_ch_prep_sm
		/sys/bus/soundwire/devices/sdw:.../dpN_src/ch_prep_timeout
		/sys/bus/soundwire/devices/sdw:.../dpN_src/imp_def_interrupts
		/sys/bus/soundwire/devices/sdw:.../dpN_src/min_ch
		/sys/bus/soundwire/devices/sdw:.../dpN_src/max_ch
		/sys/bus/soundwire/devices/sdw:.../dpN_src/channels
		/sys/bus/soundwire/devices/sdw:.../dpN_src/ch_combinations
		/sys/bus/soundwire/devices/sdw:.../dpN_src/max_async_buffer
		/sys/bus/soundwire/devices/sdw:.../dpN_src/block_pack_mode
		/sys/bus/soundwire/devices/sdw:.../dpN_src/port_encoding

		/sys/bus/soundwire/devices/sdw:.../dpN_sink/max_word
		/sys/bus/soundwire/devices/sdw:.../dpN_sink/min_word
		/sys/bus/soundwire/devices/sdw:.../dpN_sink/words
		/sys/bus/soundwire/devices/sdw:.../dpN_sink/type
		/sys/bus/soundwire/devices/sdw:.../dpN_sink/max_grouping
		/sys/bus/soundwire/devices/sdw:.../dpN_sink/simple_ch_prep_sm
		/sys/bus/soundwire/devices/sdw:.../dpN_sink/ch_prep_timeout
		/sys/bus/soundwire/devices/sdw:.../dpN_sink/imp_def_interrupts
		/sys/bus/soundwire/devices/sdw:.../dpN_sink/min_ch
		/sys/bus/soundwire/devices/sdw:.../dpN_sink/max_ch
		/sys/bus/soundwire/devices/sdw:.../dpN_sink/channels
		/sys/bus/soundwire/devices/sdw:.../dpN_sink/ch_combinations
		/sys/bus/soundwire/devices/sdw:.../dpN_sink/max_async_buffer
		/sys/bus/soundwire/devices/sdw:.../dpN_sink/block_pack_mode
		/sys/bus/soundwire/devices/sdw:.../dpN_sink/port_encoding

Date:		May 2020

Contact:	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
		Bard Liao <yung-chuan.liao@linux.intel.com>
		Vinod Koul <vkoul@kernel.org>

Description:	SoundWire Slave Data Source/Sink Port-N DisCo properties.
		These properties are defined by MIPI DisCo Specification
		for SoundWire. They define various properties of the
		Source/Sink Data port N and are used by the bus to configure
		the Data Port N.
+86 −3
Original line number Diff line number Diff line
@@ -75,8 +75,33 @@ Slaves are using single port. ::
	                                                   |     (Data)    |
	                                                   +---------------+

Example 4: Stereo Stream with L and R channels is rendered by
Master. Both of the L and R channels are received by two different
Slaves. Master and both Slaves are using single port handling
L+R. Each Slave device processes the L + R data locally, typically
based on static configuration or dynamic orientation, and may drive
one or more speakers. ::

Example 4: Stereo Stream with L and R channel is rendered by two different
	+---------------+                    Clock Signal  +---------------+
	|    Master     +---------+------------------------+     Slave     |
	|   Interface   |         |                        |   Interface   |
	|               |         |                        |       1       |
	|               |         |           Data Signal  |               |
	|    L  +  R    +---+------------------------------+     L + R     |
	|     (Data)    |   |     |    Data Direction      |     (Data)    |
	+---------------+   |     |   +------------->      +---------------+
	                    |     |
	                    |     |
	                    |     |                        +---------------+
	                    |     +----------------------> |     Slave     |
	                    |                              |   Interface   |
	                    |                              |       2       |
	                    |                              |               |
	                    +----------------------------> |     L + R     |
	                                                   |     (Data)    |
	                                                   +---------------+

Example 5: Stereo Stream with L and R channel is rendered by two different
Ports of the Master and is received by only single Port of the Slave
interface. ::

@@ -101,7 +126,7 @@ interface. ::
	+--------------------+                             |                |
							   +----------------+

Example 5: Stereo Stream with L and R channel is rendered by 2 Masters, each
Example 6: Stereo Stream with L and R channel is rendered by 2 Masters, each
rendering one channel, and is received by two different Slaves, each
receiving one channel. Both Masters and both Slaves are using single port. ::

@@ -123,12 +148,70 @@ receiving one channel. Both Masters and both Slaves are using single port. ::
	|     (Data)    |     Data Direction               |     (Data)    |
	+---------------+  +----------------------->       +---------------+

Note: In multi-link cases like above, to lock, one would acquire a global
Example 7: Stereo Stream with L and R channel is rendered by 2
Masters, each rendering both channels. Each Slave receives L + R. This
is the same application as Example 4 but with Slaves placed on
separate links. ::

	+---------------+                    Clock Signal  +---------------+
	|    Master     +----------------------------------+     Slave     |
	|   Interface   |                                  |   Interface   |
	|       1       |                                  |       1       |
	|               |                     Data Signal  |               |
	|     L + R     +----------------------------------+     L + R     |
	|     (Data)    |     Data Direction               |     (Data)    |
	+---------------+  +----------------------->       +---------------+

	+---------------+                    Clock Signal  +---------------+
	|    Master     +----------------------------------+     Slave     |
	|   Interface   |                                  |   Interface   |
	|       2       |                                  |       2       |
	|               |                     Data Signal  |               |
	|     L + R     +----------------------------------+     L + R     |
	|     (Data)    |     Data Direction               |     (Data)    |
	+---------------+  +----------------------->       +---------------+

Example 8: 4-channel Stream is rendered by 2 Masters, each rendering a
2 channels. Each Slave receives 2 channels. ::

	+---------------+                    Clock Signal  +---------------+
	|    Master     +----------------------------------+     Slave     |
	|   Interface   |                                  |   Interface   |
	|       1       |                                  |       1       |
	|               |                     Data Signal  |               |
	|    L1 + R1    +----------------------------------+    L1 + R1    |
	|     (Data)    |     Data Direction               |     (Data)    |
	+---------------+  +----------------------->       +---------------+

	+---------------+                    Clock Signal  +---------------+
	|    Master     +----------------------------------+     Slave     |
	|   Interface   |                                  |   Interface   |
	|       2       |                                  |       2       |
	|               |                     Data Signal  |               |
	|     L2 + R2   +----------------------------------+    L2 + R2    |
	|     (Data)    |     Data Direction               |     (Data)    |
	+---------------+  +----------------------->       +---------------+

Note1: In multi-link cases like above, to lock, one would acquire a global
lock and then go on locking bus instances. But, in this case the caller
framework(ASoC DPCM) guarantees that stream operations on a card are
always serialized. So, there is no race condition and hence no need for
global lock.

Note2: A Slave device may be configured to receive all channels
transmitted on a link for a given Stream (Example 4) or just a subset
of the data (Example 3). The configuration of the Slave device is not
handled by a SoundWire subsystem API, but instead by the
snd_soc_dai_set_tdm_slot() API. The platform or machine driver will
typically configure which of the slots are used. For Example 4, the
same slots would be used by all Devices, while for Example 3 the Slave
Device1 would use e.g. Slot 0 and Slave device2 slot 1.

Note3: Multiple Sink ports can extract the same information for the
same bitSlots in the SoundWire frame, however multiple Source ports
shall be configured with different bitSlot configurations. This is the
same limitation as with I2S/PCM TDM usages.

SoundWire Stream Management flow
================================

+4 −3
Original line number Diff line number Diff line
@@ -101,10 +101,11 @@ Following is the Bus API to register the SoundWire Bus:

.. code-block:: c

	int sdw_add_bus_master(struct sdw_bus *bus)
	int sdw_bus_master_add(struct sdw_bus *bus,
				struct device *parent,
				struct fwnode_handle)
	{
		if (!bus->dev)
			return -ENODEV;
		sdw_master_device_add(bus, parent, fwnode);

		mutex_init(&bus->lock);
		INIT_LIST_HEAD(&bus->slaves);
+3 −5
Original line number Diff line number Diff line
@@ -4,7 +4,8 @@
#

#Bus Objs
soundwire-bus-objs := bus_type.o bus.o slave.o mipi_disco.o stream.o
soundwire-bus-objs := bus_type.o bus.o master.o slave.o mipi_disco.o stream.o  \
			sysfs_slave.o sysfs_slave_dpn.o
obj-$(CONFIG_SOUNDWIRE) += soundwire-bus.o

ifdef CONFIG_DEBUG_FS
@@ -16,12 +17,9 @@ soundwire-cadence-objs := cadence_master.o
obj-$(CONFIG_SOUNDWIRE_CADENCE) += soundwire-cadence.o

#Intel driver
soundwire-intel-objs :=	intel.o
soundwire-intel-objs :=	intel.o intel_init.o
obj-$(CONFIG_SOUNDWIRE_INTEL) += soundwire-intel.o

soundwire-intel-init-objs := 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
Loading