<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/include/sound/soc-dpcm.h, branch linux-7.0.y</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=linux-7.0.y</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=linux-7.0.y'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-02-16T23:51:06+00:00</updated>
<entry>
<title>ASoC: remove dpcm_process_paths()</title>
<updated>2025-02-16T23:51:06+00:00</updated>
<author>
<name>Kuninori Morimoto</name>
<email>kuninori.morimoto.gx@renesas.com</email>
</author>
<published>2025-02-12T02:28:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=40b1f89a1691c4b7740bec2c868f1e4c60346353'/>
<id>urn:sha1:40b1f89a1691c4b7740bec2c868f1e4c60346353</id>
<content type='text'>
dpcm_process_paths() will call dpcm_add_paths() (A) or
dpcm_prune_paths() (B)

	dpcm_process_paths(..., new)
	{
		if (new)
(A)			return dpcm_add_paths(...);
		else
(B)			return dpcm_prune_paths(...);
	}

but the user who need to call dpcm_prune_paths() (B) is only
soc_dpcm_fe_runtime_update(), all other user want to call is
dpcm_add_paths() (A). We don't need to have confusing
dpcm_process_paths(). Let's remove it.

Signed-off-by: Kuninori Morimoto &lt;kuninori.morimoto.gx@renesas.com&gt;
Link: https://patch.msgid.link/87jz9vyjyu.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>ASoC: soc-pcm: makes dpcm_dapm_stream_event() void</title>
<updated>2025-02-16T23:51:02+00:00</updated>
<author>
<name>Kuninori Morimoto</name>
<email>kuninori.morimoto.gx@renesas.com</email>
</author>
<published>2025-02-12T02:24:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7e1caa679686dde5c24d60b139f234568045758f'/>
<id>urn:sha1:7e1caa679686dde5c24d60b139f234568045758f</id>
<content type='text'>
No one uses dpcm_dapm_stream_event() return value, and it always
return 0. Let's makes it void.

Signed-off-by: Kuninori Morimoto &lt;kuninori.morimoto.gx@renesas.com&gt;
Link: https://patch.msgid.link/87seojyk6m.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>ASoC: soc-pcm: makes snd_soc_dpcm_can_be_xxx() local function</title>
<updated>2024-08-28T12:02:20+00:00</updated>
<author>
<name>Kuninori Morimoto</name>
<email>kuninori.morimoto.gx@renesas.com</email>
</author>
<published>2024-08-26T23:41:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=290f31e943a29c93532b1684652b04fd60d0f696'/>
<id>urn:sha1:290f31e943a29c93532b1684652b04fd60d0f696</id>
<content type='text'>
No driver is calling snd_soc_dpcm_can_be_xxx() functions. We don't need
to have EXPORT_SYMBOL_GPL() for them. Let's makes it static function.
One note is that snd_soc_dpcm_fe_can_update() is not used in upstream.
Use #if-endif and keep it for future support.

Signed-off-by: Kuninori Morimoto &lt;kuninori.morimoto.gx@renesas.com&gt;
Link: https://patch.msgid.link/87h6b6df7e.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>ASoC: remove bespoke trigger support</title>
<updated>2024-08-06T12:56:21+00:00</updated>
<author>
<name>Kuninori Morimoto</name>
<email>kuninori.morimoto.gx@renesas.com</email>
</author>
<published>2024-08-06T00:00:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7d2fb3812acde0a76e0d361877e8295db065f9f4'/>
<id>urn:sha1:7d2fb3812acde0a76e0d361877e8295db065f9f4</id>
<content type='text'>
Bespoke trigger support was added when Linux v3.5 by this patch.

	commit 07bf84aaf736781a283b1bd36eaa911453b14574
	("ASoC: dpcm: Add bespoke trigger()")

test-component driver is using it, but this is because it indicates used
function for debug/trace purpose. Except test-component driver, bespoke
trigger has never been used over 10 years in upstream.

We can re-support it if needed in the future, but let's remove it for now,
because it just noise in upstream.

Signed-off-by: Kuninori Morimoto &lt;kuninori.morimoto.gx@renesas.com&gt;
Link: https://patch.msgid.link/87v80ewmdi.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>ASoC: soc-pcm: test if a BE can be prepared</title>
<updated>2023-05-18T17:31:14+00:00</updated>
<author>
<name>Ranjani Sridharan</name>
<email>ranjani.sridharan@linux.intel.com</email>
</author>
<published>2023-05-17T18:57:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e123036be377ddf628226a7c6d4f9af5efd113d3'/>
<id>urn:sha1:e123036be377ddf628226a7c6d4f9af5efd113d3</id>
<content type='text'>
In the BE hw_params configuration, the existing code checks if any of the
existing FEs are prepared, running, paused or suspended - and skips the
configuration in those cases. This allows multiple calls of hw_params
which the ALSA state machine supports.

This check is not handled for the prepare stage, which can lead to the
same BE being prepared multiple times. This patch adds a check similar to
that of the hw_params, with the main difference being that the suspended
state is allowed: the ALSA state machine allows a transition from
suspended to prepared with hw_params skipped.

This problem was detected on Intel IPC4/SoundWire devices, where the BE
dailink .prepare stage is used to configure the SoundWire stream with a
bank switch. Multiple .prepare calls lead to conflicts with the .trigger
operation with IPC4 configurations. This problem was not detected earlier
on Intel devices, HDaudio BE dailinks detect that the link is already
prepared and skip the configuration, and for IPC3 devices there is no BE
trigger.

Link: https://github.com/thesofproject/sof/issues/7596
Signed-off-by: Ranjani Sridharan &lt;ranjani.sridharan@linux.intel.com
Signed-off-by: Bard Liao &lt;yung-chuan.liao@linux.intel.com
Signed-off-by: Pierre-Louis Bossart &lt;pierre-louis.bossart@linux.intel.com
Link: https://lore.kernel.org/r/20230517185731.487124-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org
</content>
</entry>
<entry>
<title>ASoC: soc-pcm.c: remove indirect runtime copy</title>
<updated>2023-03-14T13:58:57+00:00</updated>
<author>
<name>Kuninori Morimoto</name>
<email>kuninori.morimoto.gx@renesas.com</email>
</author>
<published>2023-03-06T01:43:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0d3a5178c2994eaf91ad135816a79138055b394a'/>
<id>urn:sha1:0d3a5178c2994eaf91ad135816a79138055b394a</id>
<content type='text'>
substream-&gt;runtime will be attached when substream was opened
at snd_pcm_attach_substream(). When it uses DPCM,
FE substream-&gt;runtime is attached, but BE substream-&gt;runtime is not.
Thus, we are copying FE substream-&gt;runtime to BE.

But, we are copyig FE substream-&gt;runtime to FE dpcm-&gt;runtime first (A),
and copy it to BE dpcm-&gt;runtime (B), and copy it to
BE substream-&gt;runtime (C).

	static int dpcm_fe_dai_open(...) {
		...
(A)		fe-&gt;dpcm[stream].runtime = fe_substream-&gt;runtime;
		...
	}

	static int dpcm_be_connect(...) {
		...
(B)		be-&gt;dpcm[stream].runtime = fe-&gt;dpcm[stream].runtime;
		...
	}

	int dpcm_be_dai_startup(...) {
		...
(C)		be_substream-&gt;runtime = be-&gt;dpcm[stream].runtime;
		...
	}

It is too roundabout and troublesome.
OTOH, it is directly copying fe_substream-&gt;runtime at dpcm_be_reparent()
without using be-&gt;dpcm[stream].runtime.

	static void dpcm_be_reparent(...)
	{
		...
		for_each_dpcm_fe(be, stream, dpcm) {
			...
=&gt;			be_substream-&gt;runtime = fe_substream-&gt;runtime;
			break;
		}
	}

This patch removes indirect copying.

Signed-off-by: Kuninori Morimoto &lt;kuninori.morimoto.gx@renesas.com&gt;
Link: https://lore.kernel.org/r/87v8je64dh.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>ASoC: soc-pcm: Export widget_in_list()</title>
<updated>2023-01-27T12:13:59+00:00</updated>
<author>
<name>Ranjani Sridharan</name>
<email>ranjani.sridharan@linux.intel.com</email>
</author>
<published>2023-01-27T12:00:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5edcf2a3aad41ee398ac011cda7bccca400b56f0'/>
<id>urn:sha1:5edcf2a3aad41ee398ac011cda7bccca400b56f0</id>
<content type='text'>
Export the widget_in_list() function to be used by other modules.

Signed-off-by: Ranjani Sridharan &lt;ranjani.sridharan@linux.intel.com&gt;
Reviewed-by: Bard Liao &lt;yung-chuan.liao@linux.intel.com&gt;
Reviewed-by: Pierre-Louis Bossart &lt;pierre-louis.bossart@linux.intel.com&gt;
Reviewed-by: Péter Ujfalusi &lt;peter.ujfalusi@linux.intel.com&gt;
Signed-off-by: Peter Ujfalusi &lt;peter.ujfalusi@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20230127120031.10709-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>ASoC: soc-dpcm.h: remove snd_soc_dpcm::hw_param</title>
<updated>2022-10-19T12:05:34+00:00</updated>
<author>
<name>Kuninori Morimoto</name>
<email>kuninori.morimoto.gx@renesas.com</email>
</author>
<published>2022-10-19T00:37:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=25106550f1366bec8a9adefeada5e8ff5205c828'/>
<id>urn:sha1:25106550f1366bec8a9adefeada5e8ff5205c828</id>
<content type='text'>
Current soc-pcm.c is coping fe hw_param to dpcm-&gt;hw_param (A),
fixup it (B), and copy it to be (C).

	int dpcm_be_dai_hw_params(...)
	{
		...
		for_each_dpcm_be(fe, stream, dpcm) {
			...
			/* copy params for each dpcm */
(A)			memcpy(&amp;dpcm-&gt;hw_params, &amp;fe-&gt;dpcm[stream].hw_params, ...) ;

			/* perform any hw_params fixups */
(B)			ret = snd_soc_link_be_hw_params_fixup(be, &amp;dpcm-&gt;hw_params);
			...

			/* copy the fixed-up hw params for BE dai */
(C)			memcpy(&amp;be-&gt;dpcm[stream].hw_params, &amp;dpcm-&gt;hw_params, ...);
			...
		}
		...
	}

But here, (1) it is coping hw_params without caring stream (Playback/Capture),
(2) we can get same value from be. We don't need to have dpcm-&gt;hw_params.
This patch removes it.

Signed-off-by: Kuninori Morimoto &lt;kuninori.morimoto.gx@renesas.com&gt;
Reviewed-by: Amadeusz Sławiński &lt;amadeuszx.slawinski@linux.intel.com&gt;
Link: https://lore.kernel.org/r/87v8ogsl6h.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>ASoC: soc-pcm: improve BE transition for PAUSE_RELEASE</title>
<updated>2022-04-19T15:33:51+00:00</updated>
<author>
<name>Pierre-Louis Bossart</name>
<email>pierre-louis.bossart@linux.intel.com</email>
</author>
<published>2022-04-06T19:00:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9995c1d096c8ab1b5f1edc4141257719f6a53524'/>
<id>urn:sha1:9995c1d096c8ab1b5f1edc4141257719f6a53524</id>
<content type='text'>
Commit 3aa1e96a2b95 ("ASoC: soc-pcm: fix BE handling of PAUSE_RELEASE")
did not modify the existing logic and kept the same logic for the following
transition

    play FE1    -&gt; BE state is START
    pause FE1   -&gt; BE state is PAUSED
    play FE2    -&gt; BE state is START
    stop FE2    -&gt; BE state is STOP &lt;&lt;&lt; !!
    release FE1 -&gt; BE state is START
    stop FE1    -&gt; BE state is STOP

At the time it was identified by reviewers that a better solution
might consist in

    play FE1    -&gt; BE state is START
    pause FE1   -&gt; BE state is PAUSED
    play FE2    -&gt; BE state is START
    stop FE2    -&gt; BE state is PAUSE &lt;&lt;&lt; !!
    release FE1 -&gt; BE state is START
    stop FE1    -&gt; BE state is STOP

This patch suggest a transition to PAUSE when all the 'active' streams
are paused. This would allow for a more consistent resource management
for platforms where PAUSE and STOP are handled differently.

To track the special case of an FE going from PAUSE_PUSH to STOP, we
add a state variable for each FE context. This 'fe_pause' boolean is
set on PAUSE_PUSH and cleared on either PAUSE_RELEASE and STOP
triggers.

Signed-off-by: Pierre-Louis Bossart &lt;pierre-louis.bossart@linux.intel.com&gt;
Reviewed-by: Rander Wang &lt;rander.wang@intel.com&gt;
Reviewed-by: Ranjani Sridharan &lt;ranjani.sridharan@linux.intel.com&gt;
Reviewed-by: Péter Ujfalusi &lt;peter.ujfalusi@linux.intel.com&gt;
Reviewed-by: Bard Liao &lt;yung-chuan.liao@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20220406190056.233481-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>ASoC: soc-pcm: test refcount before triggering</title>
<updated>2021-12-14T17:15:47+00:00</updated>
<author>
<name>Pierre-Louis Bossart</name>
<email>pierre-louis.bossart@linux.intel.com</email>
</author>
<published>2021-12-07T17:37:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=848aedfdc6ba25ad5652797db9266007773e44dd'/>
<id>urn:sha1:848aedfdc6ba25ad5652797db9266007773e44dd</id>
<content type='text'>
On start/pause_release/resume, when more than one FE is connected to
the same BE, it's possible that the trigger is sent more than
once. This is not desirable, we only want to trigger a BE once, which
is straightforward to implement with a refcount.

For stop/pause/suspend, the problem is more complicated: the check
implemented in snd_soc_dpcm_can_be_free_stop() may fail due to a
conceptual deadlock when we trigger the BE before the FE. In this
case, the FE states have not yet changed, so there are corner cases
where the TRIGGER_STOP is never sent - the dual case of start where
multiple triggers might be sent.

This patch suggests an unconditional trigger in all cases, without
checking the FE states, using a refcount protected by the BE PCM
stream lock.

Signed-off-by: Pierre-Louis Bossart &lt;pierre-louis.bossart@linux.intel.com&gt;
Reviewed-by: Kai Vehmanen &lt;kai.vehmanen@linux.intel.com&gt;
Reviewed-by: Bard Liao &lt;yung-chuan.liao@linux.intel.com&gt;
Reviewed-by: Ranjani Sridharan &lt;ranjani.sridharan@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20211207173745.15850-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
</feed>
