Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
e8f1b03
soundwire: sdw_slave: add probe_complete structure and new fields
plbossart Oct 9, 2019
91ee597
soundwire: sdw_slave: add enumeration_complete structure
plbossart Sep 26, 2019
409e3cc
soundwire: sdw_slave: add initialization_complete definition
plbossart Nov 4, 2019
b8441b6
soundwire: sdw_slave: track unattach_request to handle all init seque…
plbossart Nov 11, 2019
a3e3e57
soundwire: intel: update interfaces between ASoC and SoundWire
plbossart Oct 23, 2019
c7b0f96
soundwire: intel: update stream callbacks for hwparams/free stream op…
RanderWang Aug 19, 2019
77099d2
soundwire: renames to prepare support for master drivers/devices
plbossart Sep 10, 2019
a10f8d2
soundwire: rename dev_to_sdw_dev macro
plbossart Sep 11, 2019
c57f5ec
soundwire: rename drv_to_sdw_slave_driver macro
plbossart Sep 11, 2019
d7e35bd
soundwire: bus_type: rename sdw_drv_ to sdw_slave_drv
plbossart Sep 11, 2019
0d9bbdd
soundwire: intel: rename res field as link_res
plbossart Sep 11, 2019
2f1d819
soundwire: add support for sdw_slave_type
plbossart Sep 11, 2019
24bb987
soundwire: slave: move uevent handling to slave
plbossart Nov 14, 2019
f8ba66a
soundwire: add initial definitions for sdw_master_device
plbossart Sep 11, 2019
e72aeea
soundwire: intel: remove platform devices and provide new interface
plbossart Oct 23, 2019
5de3bff
soundwire: add device driver to sdw_md_driver
bardliao Sep 12, 2019
fa6e999
soundwire: intel: add prepare support in sdw dai driver
RanderWang Aug 19, 2019
78bbe93
soundwire: intel: add trigger support in sdw dai driver
RanderWang Aug 19, 2019
19ae232
soundwire: intel: add sdw_stream_setup helper for .startup callback
RanderWang Aug 19, 2019
d060b91
soundwire: intel: free all resources on hw_free()
plbossart Oct 23, 2019
1bf477d
soundwire: intel_init: add implementation of sdw_intel_enable_irq()
plbossart Oct 23, 2019
6e8ff74
soundwire: intel/cadence: fix timeouts in MSI mode
bardliao Sep 24, 2019
33ec844
soundwire: bus: fix race condition with probe_complete signaling
plbossart Aug 2, 2019
150f711
soundwire: bus: add PM/no-PM versions of read/write functions
plbossart Jun 11, 2019
a3b360e
soundwire: bus: write Slave Device Number without runtime_pm
plbossart Sep 26, 2019
cd930c4
soundwire: intel: add helpers for link power down and shim wake
plbossart Sep 20, 2019
0645449
soundwire: intel: Add basic power management support
plbossart Sep 20, 2019
79057ea
soundwire: intel: add pm_runtime support
plbossart Sep 20, 2019
3bbbbe4
soundwire: intel: reset pm_runtime status during system resume
plbossart Oct 11, 2019
28115c8
soundwire: bus: add helper to reset Slave status to UNATTACHED
plbossart Sep 26, 2019
7d133dd
soundwire: intel: call helper to reset Slave states on resume
plbossart Sep 26, 2019
6397b09
soundwire: bus: check first if Slaves become UNATTACHED
plbossart Sep 26, 2019
a27514d
soundwire: bus: fix race condition with enumeration_complete signaling
plbossart Sep 26, 2019
0808d6f
soundwire: bus: fix race condition with initialization_complete signa…
plbossart Nov 4, 2019
0283e27
soundwire: bus: fix race condition by tracking UNATTACHED transition
plbossart Nov 8, 2019
de1fe3d
soundwire: intel: disable pm_runtime when removing a master
plbossart Oct 9, 2019
837bd6a
soundwire: bus: disable pm_runtime in sdw_slave_delete
plbossart Oct 9, 2019
9e2418c
soundwire: stream: remove redundant pr_err traces
plbossart Nov 14, 2019
7a5f80a
soundwire: stream: update state machine and add state checks
plbossart Oct 12, 2019
8281dcc
soundwire: stream: only prepare stream when it is configured.
bardliao Sep 20, 2019
cc31e29
soundwire: stream: do not update parameters during DISABLED-PREPARED …
plbossart Oct 15, 2019
95d8d92
soundwire: intel: reinitialize IP+DSP in .prepare(), but only when re…
bardliao Oct 14, 2019
642b49e
soundwire: intel: pm_runtime idle scheduling
plbossart Oct 24, 2019
a3789cc
[HACK] add traces to debug aplay suspend/resume issue
plbossart Oct 12, 2019
7536e80
soundwire: Add clock stop support
RanderWang Nov 8, 2019
b0c1449
soundwire: cadence_master: add power management support
RanderWang Oct 31, 2019
ecd8a8b
soundwire: intel: add support for clock stop mode1 in sdw_clear_slave…
RanderWang Nov 21, 2019
da276f1
soundwire: intel: add clock stop mode0 support
RanderWang Nov 13, 2019
50f6d62
soundwire: intel: add two helper function for pm
RanderWang Nov 18, 2019
721780c
soundwire: intel: use helper functions to share code
RanderWang Nov 18, 2019
ce37f71
soundwire: intel: add support for jack detection in clock stop mode
RanderWang Nov 8, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 45 additions & 18 deletions Documentation/driver-api/soundwire/stream.rst
Original file line number Diff line number Diff line change
Expand Up @@ -156,22 +156,27 @@ Below shows the SoundWire stream states and state transition diagram. ::
+-----------+ +------------+ +----------+ +----------+
| ALLOCATED +---->| CONFIGURED +---->| PREPARED +---->| ENABLED |
| STATE | | STATE | | STATE | | STATE |
+-----------+ +------------+ +----------+ +----+-----+
^
|
|
v
+----------+ +------------+ +----+-----+
+-----------+ +------------+ +---+--+---+ +----+-----+
^ ^ ^
| | |
__| |___________ |
| | |
v | v
+----------+ +-----+------+ +-+--+-----+
| RELEASED |<----------+ DEPREPARED |<-------+ DISABLED |
| STATE | | STATE | | STATE |
+----------+ +------------+ +----------+

NOTE: State transition between prepare and deprepare is supported in Spec
but not in the software (subsystem)
NOTE: State transitions between ``SDW_STREAM_ENABLED`` and
``SDW_STREAM_DISABLED`` are only relevant when then INFO_PAUSE flag is
supported at the ALSA/ASoC level. Likewise the transition between
``SDW_DISABLED_STATE`` and ``SDW_PREPARED_STATE`` depends on the
INFO_RESUME flag.

NOTE2: Stream state transition checks need to be handled by caller
framework, for example ALSA/ASoC. No checks for stream transition exist in
SoundWire subsystem.
NOTE2: The framework implements basic state transition checks, but
does not e.g. check if a transition from DISABLED to ENABLED is valid
on a specific platform. Such tests need to be added at the ALSA/ASoC
level.

Stream State Operations
-----------------------
Expand Down Expand Up @@ -246,6 +251,9 @@ SDW_STREAM_PREPARED

Prepare state of stream. Operations performed before entering in this state:

(0) Steps 1 and 2 are omitted in the case of a resume operation,
where the bus bandwidth is known.

(1) Bus parameters such as bandwidth, frame shape, clock frequency,
are computed based on current stream as well as already active
stream(s) on Bus. Re-computation is required to accommodate current
Expand All @@ -270,13 +278,15 @@ Prepare state of stream. Operations performed before entering in this state:
After all above operations are successful, stream state is set to
``SDW_STREAM_PREPARED``.

Bus implements below API for PREPARE state which needs to be called once per
stream. From ASoC DPCM framework, this stream state is linked to
.prepare() operation.
Bus implements below API for PREPARE state which needs to be called
once per stream. From ASoC DPCM framework, this stream state is linked
to .prepare() operation. Since the .trigger() operations may not
follow the .prepare(), a direct transitions from
``SDW_STREAM_PREPARED`` to ``SDW_STREAM_DEPREPARED`` is allowed.

.. code-block:: c

int sdw_prepare_stream(struct sdw_stream_runtime * stream);
int sdw_prepare_stream(struct sdw_stream_runtime * stream, bool resume);


SDW_STREAM_ENABLED
Expand Down Expand Up @@ -332,6 +342,14 @@ Bus implements below API for DISABLED state which needs to be called once
per stream. From ASoC DPCM framework, this stream state is linked to
.trigger() stop operation.

When the INFO_PAUSE flag is supported, a direct transition to
``SDW_STREAM_ENABLED`` is allowed.

For resume operations where ASoC will use the .prepare() callback, the
stream can transition from ``SDW_STREAM_DISABLED`` to
``SDW_STREAM_PREPARED``, with all required settings restored but
without updating the bandwidth and bit allocation.

.. code-block:: c

int sdw_disable_stream(struct sdw_stream_runtime * stream);
Expand All @@ -353,9 +371,18 @@ state:
After all above operations are successful, stream state is set to
``SDW_STREAM_DEPREPARED``.

Bus implements below API for DEPREPARED state which needs to be called once
per stream. From ASoC DPCM framework, this stream state is linked to
.trigger() stop operation.
Bus implements below API for DEPREPARED state which needs to be called
once per stream. ALSA/ASoC do not have a concept of 'deprepare', and
the mapping from this stream state to ALSA/ASoC operation may be
implementation specific.

When the INFO_PAUSE flag is supported, the stream state is linked to
the .hw_free() operation - the stream is not deprepared on a
TRIGGER_STOP.

Other implementations may transition to the ``SDW_STREAM_DEPREPARED``
state on TRIGGER_STOP, should they require a transition through the
``SDW_STREAM_PREPARED`` state.

.. code-block:: c

Expand Down
4 changes: 2 additions & 2 deletions drivers/base/regmap/regmap-sdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
static int regmap_sdw_write(void *context, unsigned int reg, unsigned int val)
{
struct device *dev = context;
struct sdw_slave *slave = dev_to_sdw_dev(dev);
struct sdw_slave *slave = to_sdw_slave_device(dev);

return sdw_write(slave, reg, val);
}

static int regmap_sdw_read(void *context, unsigned int reg, unsigned int *val)
{
struct device *dev = context;
struct sdw_slave *slave = dev_to_sdw_dev(dev);
struct sdw_slave *slave = to_sdw_slave_device(dev);
int read;

read = sdw_read(slave, reg);
Expand Down
2 changes: 1 addition & 1 deletion drivers/soundwire/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#

#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
obj-$(CONFIG_SOUNDWIRE) += soundwire-bus.o

ifdef CONFIG_DEBUG_FS
Expand Down
Loading