<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/include/sound/soc.h, branch linux-5.11.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-5.11.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-5.11.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2020-12-09T12:13:38Z</updated>
<entry>
<title>ASoC: soc-pcm: care trigger rollback</title>
<updated>2020-12-09T12:13:38Z</updated>
<author>
<name>Kuninori Morimoto</name>
<email>kuninori.morimoto.gx@renesas.com</email>
</author>
<published>2020-11-30T23:51:33Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=6374f493d93b2232444b94989c380d5aada5b810'/>
<id>urn:sha1:6374f493d93b2232444b94989c380d5aada5b810</id>
<content type='text'>
soc_pcm_trigger() calls DAI/Component/Link trigger,
but some of them might be failed.

	static int soc_pcm_trigger(...)
	{
		...
		switch (cmd) {
		case SNDRV_PCM_TRIGGER_START:
		case SNDRV_PCM_TRIGGER_RESUME:
		case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
			ret = snd_soc_link_trigger(substream, cmd);
			if (ret &lt; 0)
				break;

(*)			ret = snd_soc_pcm_component_trigger(substream, cmd);
			if (ret &lt; 0)
				break;

			ret = snd_soc_pcm_dai_trigger(substream, cmd);
			break;
		case SNDRV_PCM_TRIGGER_STOP:
		case SNDRV_PCM_TRIGGER_SUSPEND:
		case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
			ret = snd_soc_pcm_dai_trigger(substream, cmd);
			if (ret &lt; 0)
				break;

			ret = snd_soc_pcm_component_trigger(substream, cmd);
			if (ret &lt; 0)
				break;

			ret = snd_soc_link_trigger(substream, cmd);
			break;
		}
		...
	}

For example, if soc_pcm_trigger() failed at (*) point,
we need to rollback previous succeeded trigger.

This patch adds trigger mark for DAI/Component/Link,
and do STOP if START/RESUME/PAUSE_RELEASE were failed.

Because it need to use new rollback parameter,
we need to modify DAI/Component/Link trigger functions in the same time.

Signed-off-by: Kuninori Morimoto &lt;kuninori.morimoto.gx@renesas.com&gt;
Link: https://lore.kernel.org/r/87a6uycssd.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>ASoC: add soc-jack.h</title>
<updated>2020-11-30T12:54:02Z</updated>
<author>
<name>Kuninori Morimoto</name>
<email>kuninori.morimoto.gx@renesas.com</email>
</author>
<published>2020-11-29T23:45:26Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=ddfbe828f2ed13f9145c5c5fa17cb0a1b58e0bc9'/>
<id>urn:sha1:ddfbe828f2ed13f9145c5c5fa17cb0a1b58e0bc9</id>
<content type='text'>
ALSA SoC has soc-jack.c, but doesn't have soc-jack.h.
This patch creates new soc-jack.h and moves snd_soc_jack_xxx()
from soc.h.

Signed-off-by: Kuninori Morimoto &lt;kuninori.morimoto.gx@renesas.com&gt;
Link: https://lore.kernel.org/r/87wny3u3zg.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>ASoC: soc-component: add mark for snd_soc_link_compr_startup/shutdown()</title>
<updated>2020-11-26T13:09:36Z</updated>
<author>
<name>Kuninori Morimoto</name>
<email>kuninori.morimoto.gx@renesas.com</email>
</author>
<published>2020-11-18T23:50:14Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=cd7c7d10e8f4ab1dac0bdb2019abc0fad995a788'/>
<id>urn:sha1:cd7c7d10e8f4ab1dac0bdb2019abc0fad995a788</id>
<content type='text'>
soc_compr_open() does rollback when failed (A),
but, it is almost same as soc_compr_free().

	static int soc_compr_open(xxx)
	{
		...
		if (ret &lt; 0)
			goto xxx_err;
		...
		return 0;

 ^	machine_err:
 |		...
 |	out:
(A)		...
 |	pm_err:
 |		...
 v		return ret;
	}

The difference is
soc_compr_free()  is for all dai/component/substream,
rollback          is for succeeded part only.

This kind of duplicated code can be a hotbed of bugs,
thus, we want to share soc_compr_free() and rollback.
	1) snd_soc_dai_compr_startup/shutdown()
	2) snd_soc_component_compr_open/free()
=&gt;	3) snd_soc_link_compr_startup/shutdown()

This patch is for 3) snd_soc_link_compr_startup/shutdown()
and adds new cstream mark.
It will mark cstream when startup() was suceeded.
If rollback happen *after* that, it will check rollback flag
and marked cstream.

It cares *previous* startup() only now,
but we might want to check *whole* marked cstream in the future.
This patch is using macro so that it can be easily adjust to it.

Signed-off-by: Kuninori Morimoto &lt;kuninori.morimoto.gx@renesas.com&gt;
Link: https://lore.kernel.org/r/87k0ui5iwf.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>ASoC: soc-pcm: Get all BEs along DAPM path</title>
<updated>2020-11-10T17:28:18Z</updated>
<author>
<name>Sameer Pujar</name>
<email>spujar@nvidia.com</email>
</author>
<published>2020-11-02T15:10:09Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=aa293777bfeb75fb8872565ef99cc0e8b98b5c7d'/>
<id>urn:sha1:aa293777bfeb75fb8872565ef99cc0e8b98b5c7d</id>
<content type='text'>
dpcm_end_walk_at_be() stops the graph walk when first BE is found for
the given FE component. In a component model we may want to connect
multiple DAIs from different components. A new flag is introduced in
'snd_soc_card', which when set allows DAI/component chaining. Later
PCM operations can be called for all these listed components for a
valid DAPM path.

Signed-off-by: Sameer Pujar &lt;spujar@nvidia.com&gt;
Link: https://lore.kernel.org/r/1604329814-24779-3-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>ASoC: soc-pcm: add soc_pcm_hw_clean() and call it from soc_pcm_hw_params/free()</title>
<updated>2020-10-26T16:44:18Z</updated>
<author>
<name>Kuninori Morimoto</name>
<email>kuninori.morimoto.gx@renesas.com</email>
</author>
<published>2020-09-29T04:32:01Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=4662c59688b8db8834aab14f0d37a4f26fc0dd20'/>
<id>urn:sha1:4662c59688b8db8834aab14f0d37a4f26fc0dd20</id>
<content type='text'>
soc_pcm_hw_params() does rollback when failed (A),
but, it is almost same as soc_pcm_hw_free().

	static int soc_pcm_hw_params(xxx)
	{
		...
		if (ret &lt; 0)
			goto xxx_err;
		...
		return ret;

 ^	component_err:
 |		...
 |	interface_err:
(A)		...
 |	codec_err:
 |		...
 v		return ret;
	}

The difference is
soc_pcm_hw_free() is for all dai/component/substream,
rollback          is for succeeded part only.

This kind of duplicated code can be a hotbed of bugs,
thus, we want to share soc_pcm_hw_free() and rollback.

Now, soc_pcm_hw_params/free() are handling
	1) snd_soc_link_hw_params/free()
	2) snd_soc_pcm_component_hw_params/free()
	3) snd_soc_dai_hw_params/free()

Now, 1) to 3) are handled.
This patch adds new soc_pcm_hw_clean() and call it from
soc_pcm_hw_params() as rollback, and from soc_pcm_hw_free() as
normal close handler.

Other difference is that soc_pcm_hw_free() handles digital mute
if it was last user. Rollback also handles it by this patch.

Signed-off-by: Kuninori Morimoto &lt;kuninori.morimoto.gx@renesas.com&gt;
Link: https://lore.kernel.org/r/87h7rhgqab.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>ASoC: soc-link: add mark for snd_soc_link_hw_params/free()</title>
<updated>2020-10-26T16:44:15Z</updated>
<author>
<name>Kuninori Morimoto</name>
<email>kuninori.morimoto.gx@renesas.com</email>
</author>
<published>2020-09-29T04:31:25Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=918ad772c4e47f26bc1b5040a79336b7063626cf'/>
<id>urn:sha1:918ad772c4e47f26bc1b5040a79336b7063626cf</id>
<content type='text'>
soc_pcm_hw_params() does rollback when failed (A),
but, it is almost same as soc_pcm_hw_free().

	static int soc_pcm_hw_params(xxx)
	{
		...
		if (ret &lt; 0)
			goto xxx_err;
		...
		return ret;

 ^	component_err:
 |		...
 |	interface_err:
(A)		...
 |	codec_err:
 |		...
 v		return ret;
	}

The difference is
soc_pcm_hw_free() is for all dai/component/substream,
rollback          is for succeeded part only.

This kind of duplicated code can be a hotbed of bugs,
thus, we want to share soc_pcm_hw_free() and rollback.

Now, soc_pcm_hw_params/free() are handling
=&gt;	1) snd_soc_link_hw_params/free()
	2) snd_soc_pcm_component_hw_params/free()
	3) snd_soc_dai_hw_params/free()

This patch is for 1) snd_soc_link_hw_params/free().

The idea of having bit-flag or counter is not enough for this purpose.
For example if one DAI is used for 2xPlaybacks for some reasons,
and if 1st Playback was succeeded but 2nd Playback was failed,
2nd Playback rollback doesn't need to call shutdown.
But it has succeeded bit-flag or counter via 1st Playback,
thus, 2nd Playback rollback will call unneeded shutdown.
And 1st Playback's necessary shutdown will not be called,
because bit-flag or counter was cleared by wrong 2nd Playback rollback.

To avoid such case, this patch marks substream pointer when hw_params() was
succeeded. If rollback needed, it will check rollback flag and marked
substream pointer.

One note here ist that it cares *previous* hw_params() only now,
but we might want to check *whole* marked substream in the future.
This patch is using macro named "push/pop", so that it can be easily
update.

Signed-off-by: Kuninori Morimoto &lt;kuninori.morimoto.gx@renesas.com&gt;
Link: https://lore.kernel.org/r/87lfgtgqba.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>ASoC: soc.h: remove for_each_rtd_dais_rollback()</title>
<updated>2020-10-26T16:44:13Z</updated>
<author>
<name>Kuninori Morimoto</name>
<email>kuninori.morimoto.gx@renesas.com</email>
</author>
<published>2020-09-29T04:31:11Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=5560d8c6053c98e3ce17b988dde743792ae613c8'/>
<id>urn:sha1:5560d8c6053c98e3ce17b988dde743792ae613c8</id>
<content type='text'>
commit 140a4532cdb8 ("ASoC: soc-pcm: add soc_pcm_clean() and call it
from soc_pcm_open/close()") uses soc_pcm_clean() and then
for_each_rtd_dais_rollback() is no longer used.
This patch removes it.

Signed-off-by: Kuninori Morimoto &lt;kuninori.morimoto.gx@renesas.com&gt;
Link: https://lore.kernel.org/r/87o8lpgqbp.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>ASoC: soc-link: add mark for snd_soc_link_startup/shutdown()</title>
<updated>2020-09-28T16:01:43Z</updated>
<author>
<name>Kuninori Morimoto</name>
<email>kuninori.morimoto.gx@renesas.com</email>
</author>
<published>2020-09-28T00:00:57Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=6064ed73cd2405d13c252b190ac64c03ab40e4b9'/>
<id>urn:sha1:6064ed73cd2405d13c252b190ac64c03ab40e4b9</id>
<content type='text'>
soc_pcm_open() does rollback when failed (A),
but, it is almost same as soc_pcm_close().

	static int soc_pcm_open(xxx)
	{
		...
		if (ret &lt; 0)
			goto xxx_err;
		...
		return 0;

 ^	config_err:
 |		...
 |	rtd_startup_err:
(A)		...
 |	component_err:
 |		...
 v		return ret;
	}

The difference is
soc_pcm_close() is for all dai/component/substream,
rollback        is for succeeded part only.

This kind of duplicated code can be a hotbed of bugs,
thus, we want to share soc_pcm_close() and rollback.

Now, soc_pcm_open/close() are handling
	1) snd_soc_dai_startup/shutdown()
=&gt;	2) snd_soc_link_startup/shutdown()
	3) snd_soc_component_module_get/put()
	4) snd_soc_component_open/close()
	5) pm_runtime_put/get()

This patch is for 2) snd_soc_link_startup/shutdown().

The idea of having bit-flag or counter is not enough for this purpose.
For example if one DAI is used for 2xPlaybacks for some reasons,
and if 1st Playback was succeeded but 2nd Playback was failed,
2nd Playback rollback doesn't need to call shutdown.
But it has succeeded bit-flag or counter via 1st Playback,
thus, 2nd Playback rollback will call unneeded shutdown.
And 1st Playback's necessary shutdown will not be called,
because bit-flag or counter was cleared by wrong 2nd Playback rollback.

To avoid such case, this patch marks substream pointer when startup() was
succeeded. If rollback needed, it will check rollback flag and marked
substream pointer.

One note here is that it cares *current* startup() only now.
but we might want to check *whole* marked substream in the future.
This patch is using macro named "push/pop", so that it can be easily
update.

Signed-off-by: Kuninori Morimoto &lt;kuninori.morimoto.gx@renesas.com&gt;
Link: https://lore.kernel.org/r/87k0webwnv.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge branch 'asoc-5.9' into asoc-5.10</title>
<updated>2020-09-17T15:35:38Z</updated>
<author>
<name>Mark Brown</name>
<email>broonie@kernel.org</email>
</author>
<published>2020-09-17T15:35:38Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=4db68e62a0b912655c598de829b05b2383da0cab'/>
<id>urn:sha1:4db68e62a0b912655c598de829b05b2383da0cab</id>
<content type='text'>
</content>
</entry>
<entry>
<title>ASoC: core: Do not cleanup uninitialized dais on soc_pcm_open failure</title>
<updated>2020-09-07T11:40:24Z</updated>
<author>
<name>Cezary Rojewski</name>
<email>cezary.rojewski@intel.com</email>
</author>
<published>2020-09-07T11:19:39Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=20244b2a8a8728c63233d33146e007dcacbcc5c4'/>
<id>urn:sha1:20244b2a8a8728c63233d33146e007dcacbcc5c4</id>
<content type='text'>
Introduce for_each_rtd_dais_rollback macro which behaves exactly like
for_each_codec_dais_rollback and its cpu_dais equivalent but for all
dais instead.

Use newly added macro to fix soc_pcm_open error path and prevent
uninitialized dais from being cleaned-up.

Signed-off-by: Cezary Rojewski &lt;cezary.rojewski@intel.com&gt;
Fixes: 5d9fa03e6c35 ("ASoC: soc-pcm: tidyup soc_pcm_open() order")
Acked-by: Liam Girdwood &lt;liam.r.girdwood@linux.intel.com&gt;
Acked-by: Kuninori Morimoto &lt;kuninori.morimoto.gx@renesas.com&gt;
Link: https://lore.kernel.org/r/20200907111939.16169-1-cezary.rojewski@intel.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
</feed>
