Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

soundwire: bus: fix io error when processing alert event #1589

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
990f385
soundwire: sdw_slave: add probe_complete structure and new fields
plbossart Oct 9, 2019
e8fbd1c
soundwire: sdw_slave: add enumeration_complete structure
plbossart Sep 26, 2019
60d0186
soundwire: sdw_slave: add initialization_complete definition
plbossart Nov 4, 2019
ac2bdb9
soundwire: sdw_slave: track unattach_request to handle all init seque…
plbossart Nov 11, 2019
0449125
soundwire: intel: update interfaces between ASoC and SoundWire
plbossart Oct 23, 2019
4a5582e
soundwire: intel: update stream callbacks for hwparams/free stream op…
RanderWang Aug 19, 2019
fd8a78d
soundwire: intel: update headers for interrupts
bardliao Nov 22, 2019
c3d728d
soundwire: intel: add link_list to handle interrupts with a single th…
bardliao Dec 4, 2019
916f9b3
soundwire: intel: add prototype for WAKEEN interrupt processing
RanderWang Dec 6, 2019
9302fcd
soundwire: intel: add mutex for shared SHIM register access
plbossart Dec 4, 2019
0345d25
soundwire: intel: add clock stop quirks
plbossart Dec 3, 2019
5ebe498
soundwire: renames to prepare support for master drivers/devices
plbossart Sep 10, 2019
0186af1
soundwire: rename dev_to_sdw_dev macro
plbossart Sep 11, 2019
4708d15
soundwire: rename drv_to_sdw_slave_driver macro
plbossart Sep 11, 2019
46a449d
soundwire: bus_type: rename sdw_drv_ to sdw_slave_drv
plbossart Sep 11, 2019
26022ee
soundwire: intel: rename res field as link_res
plbossart Sep 11, 2019
6c3df4a
soundwire: add support for sdw_slave_type
plbossart Sep 11, 2019
3c57ea0
soundwire: slave: move uevent handling to slave
plbossart Nov 14, 2019
b183fdc
soundwire: add initial definitions for sdw_master_device
plbossart Sep 11, 2019
4cdb14e
soundwire: intel: remove platform devices and provide new interface
plbossart Oct 23, 2019
2ca3bb0
soundwire: add device driver to sdw_md_driver
bardliao Sep 12, 2019
80a3ecd
soundwire: intel: add prepare support in sdw dai driver
RanderWang Aug 19, 2019
573cf1f
soundwire: intel: add trigger support in sdw dai driver
RanderWang Aug 19, 2019
8d8b1bd
soundwire: intel: add sdw_stream_setup helper for .startup callback
RanderWang Aug 19, 2019
fbf846b
soundwire: intel: free all resources on hw_free()
plbossart Oct 23, 2019
98f58d7
soundwire: intel_init: add implementation of sdw_intel_enable_irq()
plbossart Oct 23, 2019
21a5e08
soundwire: intel/cadence: merge Soundwire interrupt handlers/threads
bardliao Sep 24, 2019
98ec3fa
soundwire: bus: fix race condition with probe_complete signaling
plbossart Aug 2, 2019
555573b
soundwire: bus: add PM/no-PM versions of read/write functions
plbossart Jun 11, 2019
97461b2
soundwire: bus: write Slave Device Number without runtime_pm
plbossart Sep 26, 2019
ddfcbb2
soundwire: intel: add helpers for link power down and shim wake
plbossart Sep 20, 2019
30e2406
soundwire: intel: Add basic power management support
plbossart Sep 20, 2019
b05d0e1
soundwire: intel: add pm_runtime support
plbossart Sep 20, 2019
a4f61f0
soundwire: intel: reset pm_runtime status during system resume
plbossart Oct 11, 2019
a00c4bf
soundwire: intel: fix race condition on system resume
plbossart Nov 26, 2019
292454f
soundwire: bus: add helper to reset Slave status to UNATTACHED
plbossart Sep 26, 2019
1fd1321
soundwire: intel: call helper to reset Slave states on resume
plbossart Sep 26, 2019
23a18eb
soundwire: bus: check first if Slaves become UNATTACHED
plbossart Sep 26, 2019
7e7bf3a
soundwire: bus: fix race condition with enumeration_complete signaling
plbossart Sep 26, 2019
bdaa921
soundwire: bus: fix race condition with initialization_complete signa…
plbossart Nov 4, 2019
6ea3446
soundwire: bus: fix race condition by tracking UNATTACHED transition
plbossart Nov 8, 2019
3fa0e4c
soundwire: intel: disable pm_runtime when removing a master
plbossart Oct 9, 2019
32d1a70
soundwire: bus: disable pm_runtime in sdw_slave_delete
plbossart Oct 9, 2019
d5237cf
soundwire: stream: remove redundant pr_err traces
plbossart Nov 14, 2019
380617f
soundwire: stream: update state machine and add state checks
plbossart Oct 12, 2019
e48bc07
soundwire: stream: only prepare stream when it is configured.
bardliao Sep 20, 2019
e228b7b
soundwire: stream: do not update parameters during DISABLED-PREPARED …
plbossart Oct 15, 2019
f0b9a79
soundwire: intel: reinitialize IP+DSP in .prepare(), but only when re…
bardliao Oct 14, 2019
d036d08
soundwire: intel: pm_runtime idle scheduling
plbossart Oct 24, 2019
2dfb584
[HACK] add traces to debug aplay suspend/resume issue
plbossart Oct 12, 2019
ef9fbac
pm: add more traces
plbossart Nov 21, 2019
39c89bf
soundwire: cadence_master: remove config update for interrupt setting
RanderWang Dec 2, 2019
c6a78ee
soundwire: intel: add mutex to prevent concurrent access to SHIM regi…
plbossart Dec 2, 2019
cb42e2a
ASoC: SOF: Intel: add SoundWire configuration interface
plbossart Sep 11, 2019
fa197ce
ASoC: SOF: IPC: dai-intel: move ALH declarations in header file
plbossart Aug 16, 2019
695ba08
ASoC: SOF: Intel: hda: add SoundWire stream config/free callbacks
plbossart Jun 26, 2019
1217551
ASoC: SOF: Intel: hda: initial SoundWire machine driver autodetect
plbossart Sep 12, 2019
5301483
ASoC: SOF: Intel: hda: disable SoundWire interrupts on suspend
plbossart Sep 24, 2019
1f36292
ASoC: SOF: Intel: add build support for SoundWire
plbossart Sep 4, 2019
4187551
ASoC: SOF: Intel: hda-ctrl: add reset cycle before parsing capabilities
plbossart Oct 21, 2019
756d4e2
ASoC: SOF: Intel: hda: merge IPC, stream and SoundWire interrupt hand…
bardliao Nov 22, 2019
6585e46
ASoC: codecs: rt700: add Soundwire support
shumingfan Apr 18, 2018
0d078af
ASoC: codecs: rt1308: add SoundWire support
shumingfan Aug 2, 2019
224b0c2
ASoC: codecs: rt711: add SoundWire support
shumingfan Aug 15, 2019
3eccfd0
ASoC: codecs: rt715: add SoundWire support
Aug 21, 2019
5c35f22
ASoC: codecs: Add DEBUG to Makefile
plbossart Apr 18, 2019
e089078
ASoC: codecs: rt715: rt715_sdw_regmap can be static
intel-lab-lkp Oct 18, 2019
a783b9b
ASoC: rt711: changes 32bits address mapping of index defined register…
shumingfan Oct 23, 2019
ac6b305
ASoC: rt700: changes 32bits address mapping of index defined register…
shumingfan Oct 23, 2019
d98e044
ASoC: rt1308-sdw: fix some coding style
shumingfan Oct 23, 2019
380f3b0
Resume correct register setting for dmic recording after suspend.
Oct 24, 2019
7fbb3c3
ASoC: rt711: add JD2 configuration
shumingfan Oct 24, 2019
afcc83a
ASoC: codec:rt715-sdw:Modify register mapping of index from 32bits to…
Oct 25, 2019
d2c4864
ASoC: rt700: fix pop noise while stopping playback
shumingfan Oct 28, 2019
80650eb
ASoC: rt711: fix pop noise while stopping playback
shumingfan Oct 28, 2019
396e05f
ASoC: rt1308-sdw: fix DC offset loading from EFUSE and increase DAC v…
shumingfan Oct 28, 2019
3bbe5a0
ASoC: codec:rt715-sdw: Modify some ret values regarding to warning an…
Oct 29, 2019
93c9c5d
ASoC: rt1308-sdw: output gain enhancement
shumingfan Oct 30, 2019
c06a352
ASoC: rt711: move rt711_parse_dt to rt711_probe
bardliao Nov 4, 2019
d57e940
ASoC: codecs: rt1308-sdw.c: wait for initialization_complete
plbossart Nov 4, 2019
f692524
ASoC: codecs: rt700-sdw.c: wait for initialization_complete
plbossart Nov 4, 2019
31ff781
ASoC: codecs: rt711-sdw.c: wait for initialization_complete
plbossart Nov 4, 2019
0fefa5d
ASoC: codecs: rt715-sdw.c: wait for initialization_complete
plbossart Nov 4, 2019
f6b738d
ASoC: rt700: enable wake_capable
shumingfan Nov 7, 2019
e75a042
ASoC: rt711: enable wake_capable
shumingfan Nov 7, 2019
9f5a037
ASoC: rt715: enable wake_capable
shumingfan Nov 7, 2019
00668f3
ASoC: rt700: re-do io_init in cache_bypass mode when system resume
shumingfan Nov 7, 2019
cf18e0f
ASoC: rt711: re-do io_init in cache_bypass mode when system resume
shumingfan Nov 7, 2019
2085670
ASoC: rt1308-sdw: re-do io_init in cache_bypass mode when system resume
shumingfan Nov 7, 2019
91ab874
ASoC: codec: rt715: Remove unused rt715_index_read function.
Nov 11, 2019
f07b363
ASoC: codecs: rt1308-sdw: check unattach request before wait_for_comp…
plbossart Nov 8, 2019
4690234
ASoC: codecs: rt700-sdw: check unattach request before wait_for_compl…
plbossart Nov 8, 2019
c857a5d
ASoC: codecs: rt711-sdw: check unattach request before wait_for_compl…
plbossart Nov 8, 2019
ec9c7f5
ASoC: codecs: rt715-sdw: check unattach request before wait_for_compl…
plbossart Nov 8, 2019
5d8dbbc
ASoC: rt711: fix no sound output after waking up from deep s3
shumingfan Nov 13, 2019
c6ac6fc
Correct some sdw default registers and add missing registers in rt715…
Nov 22, 2019
1ee1b84
ASoC: rt5682: Add the field "is_sdw" of private data
oder-chiou Nov 22, 2019
64b6b9d
ASoC: rt5682: Add the soundwire support
oder-chiou Nov 26, 2019
09c6b3a
Add missing rt715_reg_defaults values.
Dec 2, 2019
31b73cd
ASoC: rt5682: Fix the merging conflict
oder-chiou Dec 4, 2019
0404cab
ASoC: rt700: mark cache_dirty if redo the io_init funciton
shumingfan Dec 5, 2019
1901a1d
ASoC: rt711: mark cache_dirty if redo the io_init funciton
shumingfan Dec 5, 2019
8e5b152
ASoC: rt715: mark cache_dirty if redo the io_init funciton
shumingfan Dec 5, 2019
c1cc38e
ASoC: rt1308-sdw: mark cache_dirty if redo the io_init funciton
shumingfan Dec 5, 2019
66e41c4
ASoC: Intel: common: soc-acpi: declare new tables for SoundWire
plbossart Aug 24, 2019
2da6481
ASoC: Intel: common: add match tables for ICL w/ SoundWire
bardliao Jun 20, 2019
7f57539
ASoC: Intel: common: add match tables for CNL/CFL/CML w/ SoundWire
RanderWang Jul 22, 2019
51184cb
ASoC: Intel: common: add match tables for TGL w/ SoundWire
plbossart Sep 4, 2019
c1f8123
ASoC: SOF: Intel: reference SoundWire machine lists
plbossart Sep 4, 2019
5c9c9bb
ASoC: Intel: boards: add sdw_rt700 machine driver
plbossart Apr 11, 2019
b1721bb
ASoC: Intel: boards: add sdw_rt711_rt1308_rt715 3-in-1 config support
plbossart Aug 26, 2019
1ef40ac
ASoC: Intel: boards: sdw_rt711: add machine driver
plbossart Sep 17, 2019
e674ae9
ASoC: Intel: boards: SoundWire rt711 + I2S RT1308 configuration
plbossart Sep 25, 2019
1c8f58e
NOT FOR UPSTREAM: Add debug for boards
plbossart Jun 24, 2019
4d5cd42
ASoC: intel: sdw_rt711_rt1308_rt715: remove ENABLE_RT1308_SDW2 flag
bardliao Nov 5, 2019
3c79a7e
ASoC: intel: sdw_rt711_rt1308_rt715: Use a fixed number of num_links and
bardliao Nov 7, 2019
a1dd15a
ASoC: intel:sdw_rt711_i2s_rt1308: add quirk for rt711
RanderWang Nov 12, 2019
e06aff2
ASoC: intel: refine sdw_rt711_rt1308_rt715
RanderWang Nov 12, 2019
cd0b316
ASoC: Intel: sdw_rt711_rt1308_rt715: get more specific DMI info
bardliao Nov 21, 2019
aee5e4f
ASoC: Intel: sdw_rt711_rt1308_rt715: add Dell XPS to DMI table
bardliao Nov 29, 2019
0af464d
ALSA: HDA: intel-dsp-config: add DMI info for Dell laptop
bardliao Nov 5, 2019
a93847b
soundwire: cadence_master: handle multiple status reports per Slave
plbossart Jun 11, 2019
d87f16d
soundwire: Add generic bandwidth allocation algorithm
plbossart Apr 24, 2018
e025acd
soundwire: dynamic_allocation: set grp_ctrl_valid false
bardliao Aug 2, 2019
d2fa864
soundwire: bus: fix device number leak on errors
plbossart Jul 30, 2019
2f3a59c
soundwire: intel: modify DMAT field for ALH
bardliao Aug 19, 2019
891f420
soundwire: intel: fix factor of two in MCLK handling
bardliao Aug 19, 2019
78f49f8
soundwire: cadence_master: log register write info
plbossart Jun 26, 2019
50d59f5
add more traces to bus code
plbossart Jun 11, 2019
cc54c74
add traces for bus
plbossart Aug 1, 2019
26334a0
[HACK] soundwire: add dynamic DEBUG in makefile
plbossart Sep 12, 2019
359435c
ALSA: HDA: intel-dsp-config: add DMI info for Dell laptop
bardliao Nov 20, 2019
8799c2c
Soundwire: generic_bandwidth_allocation: don't free params if it is null
bardliao Dec 2, 2019
f22b344
soundwire: cadence_master: remove useless variable incrementation
plbossart Dec 6, 2019
f6a3646
Merge remote-tracking branch 'sof/integration/soundwire-interfaces' i…
plbossart Dec 6, 2019
cac7b13
Merge remote-tracking branch 'sof/integration/soundwire-intel' into i…
plbossart Dec 6, 2019
fdfcfa7
Merge remote-tracking branch 'sof/integration/soundwire-sof' into int…
plbossart Dec 6, 2019
6709f8d
Merge remote-tracking branch 'sof/integration/realtek-sdw-codecs' int…
plbossart Dec 6, 2019
b5ddd11
Merge remote-tracking branch 'sof/integration/soundwire-machine-drive…
plbossart Dec 6, 2019
b036eac
Merge remote-tracking branch 'sof/integration/soundwire-debug-fixes' …
plbossart Dec 6, 2019
cc704f5
soundwire: bus: fix io error when processing alert event
RanderWang Dec 4, 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
4 changes: 4 additions & 0 deletions drivers/soundwire/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,15 @@ config SOUNDWIRE_CADENCE
config SOUNDWIRE_INTEL
tristate "Intel SoundWire Master driver"
select SOUNDWIRE_CADENCE
select SOUNDWIRE_GENERIC_ALLOCATION
depends on ACPI && SND_SOC
help
SoundWire Intel Master driver.
If you have an Intel platform which has a SoundWire Master then
enable this config option to get the SoundWire support for that
device.

config SOUNDWIRE_GENERIC_ALLOCATION
tristate

endif
6 changes: 5 additions & 1 deletion drivers/soundwire/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
#
# Makefile for soundwire core
#
ccflags-y += -DDEBUG

#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

soundwire-generic-allocation-objs := generic_bandwidth_allocation.o
obj-$(CONFIG_SOUNDWIRE_GENERIC_ALLOCATION) += soundwire-generic-allocation.o

ifdef CONFIG_DEBUG_FS
soundwire-bus-objs += debugfs.o
endif
Expand Down
Loading