Commit graph

419 commits

Author SHA1 Message Date
Kuninori Morimoto
bbd2bac8d6
ASoC: soc-pcm: indicate error message at dpcm_apply_symmetry()
Indicating error message when failed case is very useful for debuging.
In many case, its style is like below.

	int function(...)
	{
		...
		return ret;
	}

	int caller(...)
	{
		...
		ret = function(...);
		if (ret < 0)
			dev_err(...)
		...
	}

This is not so bad, but in this style *each caller* needs to indicate
duplicate same error message, and some caller is forgetting to do it.
And caller can't indicate detail function() error information.

If function() indicates error message, we can get same and
detail information without forgot.

	int function(...)
	{
		...
		if (ret < 0)
			dev_err(...)

		return ret;
	}

	int caller(...)
	{
		...
		ret = function(...);
		...
	}

This patch follow above style at dpcm_apply_symmetry(...)

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87k0q9utb9.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-19 12:23:57 +00:00
Kuninori Morimoto
db3aa39c91
ASoC: soc-pcm: indicate error message at dpcm_be_dai_trigger()
Indicating error message when failed case is very useful for debuging.
In many case, its style is like below.

	int function(...)
	{
		...
		return ret;
	}

	int caller(...)
	{
		...
		ret = function(...);
		if (ret < 0)
			dev_err(...)
		...
	}

This is not so bad, but in this style *each caller* needs to indicate
duplicate same error message, and some caller is forgetting to do it.
And caller can't indicate detail function() error information.

If function() indicates error message, we can get same and
detail information without forgot.

	int function(...)
	{
		...
		if (ret < 0)
			dev_err(...)

		return ret;
	}

	int caller(...)
	{
		...
		ret = function(...);
		...
	}

Now, dpcm_be_dai_trigger() user uses it like below.

	err = dpcm_be_dai_trigger(...);
	if (err < 0)
		dev_err(..., "ASoC: trigger FE failed %d\n", err);

But we can get more detail information if dpcm_be_dai_trigger() itself
had dev_err(). And above error message is confusable,
failed is *BE*, not *FE*.

This patch indicates error message at dpcm_be_dai_trigger().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87lfaputbe.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-19 12:23:56 +00:00
Kuninori Morimoto
d479f00b79
ASoC: soc-pcm: indicate error message at dpcm_path_get()
Indicating error message when failed case is very useful for debuging.
In many case, its style is like below.

	int function(...)
	{
		...
		return ret;
	}

	int caller(...)
	{
		...
		ret = function(...);
		if (ret < 0)
			dev_err(...)
		...
	}

This is not so bad, but in this style *each caller* needs to indicate
duplicate same error message, and some caller is forgetting to do it.
And caller can't indicate detail function() error information.

If function() indicates error message, we can get same and
detail information without forgot.

	int function(...)
	{
		...
		if (ret < 0)
			dev_err(...)

		return ret;
	}

	int caller(...)
	{
		...
		ret = function(...);
		...
	}

Now, many place uses dpcm_path_get() like below

	ret = dpcm_path_get(...);
	if (ret < 0)
		goto error;
(A)	else if (ret == 0)
		dev_dbg(...)

But here, (A) part can be indicated at dpcm_path_get() not caller.
It is simple and readable code.

This patch do it.
Small detail behaviors will be exchanged by this patch.

	1) indicates debug info (= path numbers) if path > 0 case only
	   (It was *always* indicated).
	2) soc_dpcm_fe_runtime_update() is indicating error message
	   for paths < 0 case, but it is already done at dpcm_path_get().
	   Thus just remove it. but dev_dbg() vs dev_warn() is exchanged.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87mtv5utbj.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-19 12:23:55 +00:00
Kuninori Morimoto
dab7eeb404
ASoC: soc-pcm: indicate error message at soc_pcm_prepare()
Indicating error message when failed case is very useful for debuging.
In many case, its style is like below.

	int function(...)
	{
		...
		return ret;
	}

	int caller(...)
	{
		...
		ret = function(...);
		if (ret < 0)
			dev_err(...)
		...
	}

This is not so bad, but in this style *each caller* needs to indicate
duplicate same error message, and some caller is forgetting to do it.
And caller can't indicate detail function() error information.

If function() indicates error message, we can get same and
detail information without forgot.

	int function(...)
	{
		...
		if (ret < 0)
			dev_err(...)

		return ret;
	}

	int caller(...)
	{
		...
		ret = function(...);
		...
	}

This patch follow above style at soc_pcm_prepare().

By this patch, dpcm_fe/be_dai_prepare(...)
temporary lacks FE/BE error info, but it will reborn soon.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87o8flutbn.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-19 12:23:54 +00:00
Kuninori Morimoto
cb11f79b4a
ASoC: soc-pcm: indicate error message at soc_pcm_hw_params()
Indicating error message when failed case is very useful for debuging.
In many case, its style is like below.

	int function(...)
	{
		...
		return ret;
	}

	int caller(...)
	{
		...
		ret = function(...);
		if (ret < 0)
			dev_err(...)
		...
	}

This is not so bad, but in this style *each caller* needs to indicate
duplicate same error message, and some caller is forgetting to do it.
And caller can't indicate detail function() error information.

If function() indicates error message, we can get same and
detail information without forgot.

	int function(...)
	{
		...
		if (ret < 0)
			dev_err(...)

		return ret;
	}

	int caller(...)
	{
		...
		ret = function(...);
		...
	}

This patch follow above style at soc_pcm_hw_params().

By this patch, dpcm_fe/be_dai_hw_params(...)
temporary lacks FE/BE error info, but it will reborn soon.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87pn01utbt.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-19 12:23:53 +00:00
Kuninori Morimoto
e4b044f458
ASoC: soc-pcm: indicate error message at soc_pcm_open()
Indicating error message when failed case is very useful for debuging.
In many case, its style is like below.

	int function(...)
	{
		...
		return ret;
	}

	int caller(...)
	{
		...
		ret = function(...);
		if (ret < 0)
			dev_err(...)
		...
	}

This is not so bad, but in this style *each caller* needs to indicate
duplicate same error message, and some caller is forgetting to do it.
And caller can't indicate detail function() error information.

If function() indicates error message, we can get same and
detail information without forgot.

	int function(...)
	{
		...
		if (ret < 0)
			dev_err(...)

		return ret;
	}

	int caller(...)
	{
		...
		ret = function(...);
		...
	}

This patch follow above style at soc_pcm_open().

By this patch, dpcm_fe/be_dai_startup(...)
temporary lacks FE/BE error info, but it will reborn soon.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87r1khutby.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-19 12:23:52 +00:00
Kuninori Morimoto
531590bb40
ASoC: soc-pcm: share DPCM BE DAI stop operation
soc-pcm has very similar but different DPCM BE DAI stop operation at
	1) dpcm_be_dai_startup() error case rollback
	2) dpcm_be_dai_startup_unwind()
	3) dpcm_be_dai_shutdown()

The differences are
	1) for rollback
	2) Doesn't check by snd_soc_dpcm_be_can_update() (Is this bug ?)
	3) Do soc_pcm_hw_free() if it was not !OPENed and !HW_FREEed,
	   and call soc_pcm_close().

We can share same code by
	1) hw_free is not needed. Needs last dpcm as rollback.
	2) hw_free is not needed.
	3) hw_free is     needed.

This patch adds new dpcm_be_dai_stop() and share these 3.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87a6rduoam.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-12 14:26:32 +00:00
Kuninori Morimoto
20048a9a40
ASoC: soc-pcm: remove unneeded !rtd->dai_link check
rtd->dai_link is setuped at soc_new_pcm_runtime(),
thus "rtd->dai_link == NULL" is never happen.
This patch removes unneeded !rtd->dai_link check

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87blbtuoar.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-12 14:26:31 +00:00
Kuninori Morimoto
1db19c1518
ASoC: soc-pcm: fixup dpcm_be_dai_startup() user count
At dpcm_be_dai_startup_unwind(), it indicates error message at (1)
if this function was called with no users.
But, it doesn't use "continue" here. Thus, users will be a
negative number at (2)

	void dpcm_be_dai_startup_unwind(...)
	{
		...
		for_each_dpcm_be(...) {
			...
(1)			if (be->dpcm[stream].users == 0)
				dev_err(...);

(2)			if (--be->dpcm[stream].users != 0)
				continue;

At dpcm_be_dai_startup(), it indicates error message if
user reached to MAX USERS at (A).
But, it doesn't use "continue" here. Thus, it will be over
MAX USERS at (B).

	int dpcm_be_dai_startup(...)
	{
		...
		for_each_dpcm_be(...) {
			...
(A)			if (be->dpcm[stream].users == DPCM_MAX_BE_USERS)
				dev_err(...);

(B)			if (be->dpcm[stream].users++ != 0)
				continue;

These are just bug. This patch fixup these.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87czw9uoav.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-12 14:26:30 +00:00
Kuninori Morimoto
c393281a3c
ASoC: soc-pcm: add soc_hw_sanity_check()
Current soc_pcm_open() is checking runtime->hw parameters, but having
such function is very helpful for reading code.

This patch adds new soc_hw_sanity_check() and checks runtime->hw
parameters there. And print its debug message there, too.

Debug message print out timing is exchanged after this patch,
but it is not a big deal, because it is for debug.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87eegpuob1.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-12 14:26:29 +00:00
Kuninori Morimoto
68cbc55737
ASoC: soc-pcm: add soc_pcm_update_symmetry()
Current soc-pcm has soc_pcm_has_symmetry() and using it as

	if (soc_pcm_has_symmetry(substream))
		substream->runtime->hw.info |= SNDRV_PCM_INFO_JOINT_DUPLEX;

We want to share same operation as same function.
This patch adds soc_pcm_update_symmetry() and pack above code in
one function.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87ft15uob6.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-12 14:26:28 +00:00
Kuninori Morimoto
56e749ba75
ASoC: soc-pcm: direct copy at snd_soc_set_runtime_hwparams()
snd_soc_set_runtime_hwparams() is called from each driver
to initialize hw parameters,
but coping each parameters one-by-one.

Current code is not copying all parameters, but no big effect
if we do it. This patch copies all parameters by simple code.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87h7lluoba.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-12 14:26:27 +00:00
Kuninori Morimoto
6fb8944cd2
ASoC: soc-pcm: add soc_cpu/codec_dai_name() macro
soc-pcm needs DAI name and it will be "multicpu/multicodec" if it has
many DAIs. But current code is using very verbose for it.
This patch uses macro and makes code simple.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87im61uobf.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-12 14:26:26 +00:00
Kuninori Morimoto
f8fc9ec56f
ASoC: soc-pcm: check DAI activity under soc_pcm_apply_symmetry()
soc_pcm_apply_symmetry() is used like below in all cases.

	if (snd_soc_dai_active(dai)) {
		err = soc_pcm_apply_symmetry(fe_substream, dai);
		...
	}

Because of this style, the code is deep nested.
This patch checks it under soc_pcm_apply_symmetry(), and makes code simple.

	static int soc_pcm_apply_symmetry(...)
	{
		...
=>		if (!snd_soc_dai_active(...))
			return 0;
		...
	}

=>	ret = soc_pcm_apply_symmetry();
	if (ret < 0)
		...

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87k0qhuobl.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-12 14:26:25 +00:00
Mark Brown
d59748076b
Merge series "ASoC: core: remove cppcheck warnings" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
This is the first batch of cleanups to make cppcheck more usable,
currently we have way too many warnings that drown real issues.

Pierre-Louis Bossart (6):
  ASoC: soc-ops: remove useless assignment
  ASoC: soc-pcm: remove redundant assignment
  ASoC: soc-pcm: remove shadowing variable
  ASoC: soc-pcm: add error log
  ASoC: soc-topology: clarify expression
  ASoC: generic: simple-card-utils: remove useless assignment

 sound/soc/generic/simple-card-utils.c |  2 +-
 sound/soc/soc-ops.c                   |  2 +-
 sound/soc/soc-pcm.c                   |  4 ++--
 sound/soc/soc-topology.c              | 16 ++++++++--------
 4 files changed, 12 insertions(+), 12 deletions(-)

--
2.25.1
2021-03-10 13:08:32 +00:00
Pierre-Louis Bossart
61456212e8
ASoC: soc-pcm: add error log
cppcheck warning:

sound/soc/soc-pcm.c:1907:6: style: Variable 'err' is assigned a value
that is never used. [unreadVariable]
 err = dpcm_be_dai_hw_free(fe, stream);
     ^

it's not clear why dpcm_be_dai_hw_free() is sometimes called without
testing the error status, and sometimes an error message is provided.

When in doubt, add an error message for consistency. This may have to
be revisited.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210218221921.88991-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10 13:06:56 +00:00
Pierre-Louis Bossart
61b9eedd93
ASoC: soc-pcm: remove shadowing variable
cppcheck warning:

sound/soc/soc-pcm.c:1718:7: style: Local variable 'i' shadows outer
variable [shadowVariable]
  int i;
      ^
sound/soc/soc-pcm.c:1696:6: note: Shadowed declaration
 int i;
     ^
sound/soc/soc-pcm.c:1718:7: note: Shadow variable
  int i;
      ^

the second variable seems totally unnecessary.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210218221921.88991-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10 13:06:55 +00:00
Pierre-Louis Bossart
9dbe774091
ASoC: soc-pcm: remove redundant assignment
cppcheck warning:

sound/soc/soc-pcm.c:2398:7: style: Variable 'ret' is reassigned a
value before the old one has been used. [redundantAssignment]
  ret = -EINVAL;
      ^
sound/soc/soc-pcm.c:2395:7: note: ret is assigned
  ret = -EINVAL;
      ^
sound/soc/soc-pcm.c:2398:7: note: ret is overwritten
  ret = -EINVAL;
      ^

This looks like a copy/paste or git merge issue.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210218221921.88991-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10 13:06:54 +00:00
Kuninori Morimoto
4fe28461e2
ASoC: soc-pcm: unpack dpcm_set_fe_runtime()
dpcm_fe_dai_startup() (= A) calls dpcm_set_fe_runtime() (= B) to setup
DPCM runtime. From *naming point of view*, it sounds like setup function
for FE.

(A)	static int dpcm_fe_dai_startup(...)
	{
		...
(B)		dpcm_set_fe_runtime(...);
		...
	}

But in dpcm_set_fe_runtime() (= B),
It  setups FE by dpcm_runtime_setup_fe() (= X),
and setups BE by dpcm_runtime_merge_xxx() (= Y).

(B)	static void dpcm_set_fe_runtime(...)
	{
		...
(X)		dpcm_runtime_setup_fe(...);

 ^		dpcm_runtime_setup_be_format(...);
(Y)		dpcm_runtime_setup_be_chan(...);
 v		dpcm_runtime_setup_be_rate(...);
	}

These means that the function which is called as xxx_fe_xxx()
is setups both FE and BE. This is confusable and can be hot bed for bug.

Now dpcm_set_fe_runtime() (= B) is simple enough and confusable naming,
let's unpack it at dpcm_fe_dai_startup().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87mtvxvsgn.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10 13:06:48 +00:00
Kuninori Morimoto
1b8cb123f3
ASoC: soc-pcm: add dpcm_runtime_setup()
dpcm_fe_dai_startup() (= A) calls dpcm_set_fe_runtime() (= B) to setup
DPCM runtime. From *naming point of view*, it sounds like setup function
for FE.

(A)	static int dpcm_fe_dai_startup(...)
	{
		...
(B)		dpcm_set_fe_runtime(...);
		...
	}

But in dpcm_set_fe_runtime() (= B),
It  setups FE by dpcm_runtime_setup_fe() (= X),
and setups BE by dpcm_runtime_merge_xxx() (= Y).

(B)	static void dpcm_set_fe_runtime(...)
	{
		...
(X)		dpcm_runtime_setup_fe(...);

 ^		dpcm_runtime_merge_format(...);
(Y)		dpcm_runtime_merge_chan(...);
 v		dpcm_runtime_merge_rate(...);
	}

These means that the function which is called as xxx_fe_xxx()
is setups both FE and BE. This is confusable and can be hot bed for bug.

This patch renames unclear dpcm_runtime_merge_xxx() (= Y) to
more clear dpcm_runtime_setup_be_xxx().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87o8gdvsgr.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10 13:06:47 +00:00
Kuninori Morimoto
5f53898af1
ASoC: soc-pcm: add dpcm_runtime_setup_fe()
dpcm_fe_dai_startup() (= A) calls dpcm_set_fe_runtime() (= B) to setup
DPCM runtime. From *naming point of view*, it sounds like setup function
for FE.

(A)	static int dpcm_fe_dai_startup(...)
	{
		...
(B)		dpcm_set_fe_runtime(...);
		...
	}

But in dpcm_set_fe_runtime() (= B),
It  setups FE by for_each loop (= X),
and setups BE by dpcm_runtime_merge_xxx() (= Y).

(B)	static void dpcm_set_fe_runtime(...)
	{
		...
 ^		for_each_rtd_cpu_dais(...) {
 |			...
(X)			soc_pcm_hw_update_rate(...);
 |			soc_pcm_hw_update_chan(...);
 |			soc_pcm_hw_update_format(...);
 v		}

 ^		dpcm_runtime_merge_format(...);
(Y)		dpcm_runtime_merge_chan(...);
 v		dpcm_runtime_merge_rate(...);
	}

These means that the function which is called as xxx_fe_xxx()
is setups both FE and BE. This is confusable and can be hot bed for bug.

To tidyup it, as 1st step, this patch adds new dpcm_runtime_setup_fe()
for (X).

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87pn0tvsgx.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10 13:06:46 +00:00
Kuninori Morimoto
7f4a763642
ASoC: soc-pcm: unpack dpcm_init_runtime_hw()
dpcm_init_runtime_hw() is now just verbose function.
This patch unpacks it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87r1l9vsh4.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10 13:06:45 +00:00
Kuninori Morimoto
6053a840f7
ASoC: soc-pcm: remove strange format storing
dpcm_init_runtime_hw() (= A) is used from dpcm_set_fe_runtime() (= B)
with for_each_rtd_cpu_dais() loop (= C), and it checks formats (= D).

(A)	static void dpcm_init_runtime_hw(...)
	{
		...
 ^		if (runtime->hw.formats)
 | (D1)			runtime->hw.formats &= stream->formats;
(D)		else
 | (D2)			runtime->hw.formats = stream->formats;
 v	}

(B)	static void dpcm_set_fe_runtime(...)
	{
		...
(C)		for_each_rtd_cpu_dais(rtd, i, cpu_dai) {
			...
(A)			dpcm_init_runtime_hw(...);
		}
	}

If this for_each_rtd_cpu_dais() loop (= C) calls
dpcm_init_runtime_hw() (= A) multiple times, this means it is Multi-CPU.

If we focus to format operation at (D), using mask (= D1) is understandable
because it restricts unsupported format.
But, enabling format when zero format case (= D2) is very strange,
because it might enables unsupported format.

This runtime->hw.formats is initialized by ULLONG_MAX at soc_pcm_hw_init(),
thus becoming zero format means it can't use such format.
And doing this strange format operation is only here.

This patch removes strange format operation (= D2), and use standard
soc_pcm_hw_update_format() for it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87sg5pvshq.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10 13:06:44 +00:00
Kai Vehmanen
8a353d7baf
ASoC: soc-pcm: fix hw param limits calculation for multi-DAI
In case DPCM runtime has multiple CPU DAIs, dpcm_init_runtime_hw() is
called multiple times, once for each CPU DAI. This will lead to
ignoring hw limits of all but the last DAI.

Fix this by moving soc_pcm_hw_init() up by one level to
dpcm_init_runtime_hw().

Fixes: 140f553d12 ("ASoC: soc-pcm: fix hwparams min/max init for dpcm")
Suggested-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210216172251.3023723-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-17 18:04:40 +00:00
Kai Vehmanen
140f553d12
ASoC: soc-pcm: fix hwparams min/max init for dpcm
When runtime is initialized with dpcm_init_runtime_hw(), some of the
min/max calculations assume that defaults are set. For example
calculation of channel min/max values may be done using zero-initialized
data and soc_pcm_hw_update_chan() will always return max-channels of 0
in this case. This will result in failure to open the PCM at all.

Fix the issue by calling soc_pcm_hw_init() before calling any
soc_pcm_hw_update_*() functions.

Remove the conditional code on runtime->hw.formats as this field
is anyways set in soc_pcm_hw_init().

Fixes: 6cb56a4549 ("ASoC: soc-pcm: add soc_pcm_hw_update_chan()")
Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210214220414.2876690-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-15 20:19:50 +00:00
Kuninori Morimoto
debc71f26c
ASoC: soc-pcm: add soc_pcm_hw_update_format()
We have soc_pcm_hw_update_xxx() now.
This patch creates same function for format.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/87pn1g90oa.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-12 12:36:45 +00:00
Kuninori Morimoto
6cb56a4549
ASoC: soc-pcm: add soc_pcm_hw_update_chan()
We have soc_pcm_hw_update_rate() now.
This patch creates same function for chan.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/87r1lw90oo.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-12 12:36:44 +00:00
Kuninori Morimoto
f6c04af5dc
ASoC: soc-pcm: add soc_pcm_hw_update_rate()
To update hw, we need to follow setting order

	1) set hw->rates
	2) call snd_pcm_limit_hw_rates()
	3) update hw->rate_min/max

To avoid random settings, this patch adds new soc_pcm_hw_update_rate()
and share updating code.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/87sg6c90qv.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-12 12:36:43 +00:00
Shengjiu Wang
b6eabd247d
ASoC: soc-pcm: change error message to debug message
This log message should be a debug message, because it
doesn't return directly but continue next loop.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/1612771965-5776-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-10 17:22:56 +00:00
Kuninori Morimoto
dd5abc7834
ASoC: soc-pcm: fixup snd_pcm_limit_hw_rates() timing
soc-pcm has snd_pcm_limit_hw_rates() which determine rate_min/rate_max.
It updates runtime->hw.rate_min/max (A) based on hw->rates (B).

	int snd_pcm_limit_hw_rates(...)
	{
		int i;
		for (...) {
(B)			if (runtime->hw.rates & (1 << i)) {
(A)				runtime->hw.rate_min = ...
				break;
			}
		}
		for (...) {
(B)			if (runtime->hw.rates & (1 << i)) {
(A)				runtime->hw.rate_max = ...
				break;
			}
		}
		return 0;
	}

This means, setup order is

	1) set hw->rates
	2) call snd_pcm_limit_hw_rates()
	3) update hw->rate_min/max

soc_pcm_init_runtime_hw() is calling it in good order

	static void soc_pcm_init_runtime_hw(xxx)
	{
		...
1)		hw->rates = snd_pcm_rate_mask_intersect(...);

2)		snd_pcm_limit_hw_rates(...);

3)		hw->rate_min = max(...);
		hw->rate_min = max(...);
		hw->rate_max = min_not_zero(...);
		hw->rate_max = min_not_zero(...);
	}

But, dpcm_fe_dai_startup() is not.

	static int dpcm_fe_dai_startup(xxx)
	{
		...
1) 3)		dpcm_set_fe_runtime(...);
2)		snd_pcm_limit_hw_rates(...);
		...
	}

More detail of dpcm_set_fe_runtime() is

	static void dpcm_set_fe_runtime()
	{
		...
		for_each_rtd_cpu_dais(rtd, i, cpu_dai) {
			...

3) 1)			dpcm_init_runtime_hw(...);
		}
		...
3) 1)		dpcm_runtime_merge_rate(...);
	}

This patch fixup these into

	static void dpcm_set_fe_runtime()
	{
		...
		for_each_rtd_cpu_dais(rtd, i, cpu_dai) {
			...

1) 2) 3)		dpcm_init_runtime_hw(...);
		}
		...
1) 2) 3)	dpcm_runtime_merge_rate(...);
	}

	static int dpcm_fe_dai_startup(xxx)
	{
		...
		dpcm_set_fe_runtime(...);
-		snd_pcm_limit_hw_rates(...);
		...
	}

Link: https://lore.kernel.org/r/87k15l7ewd.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/8735ytaig8.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-03 17:41:43 +00:00
Kuninori Morimoto
4b260f4254
ASoC: soc-pcm: use snd_pcm_hardware at dpcm_runtime_merge_xxx()
soc-pcm has dpcm_runtime_merge_xxx() functions,
but uses parameters are very verbose.

	dpcm_runtime_merge_format(...,	&runtime->hw.formats);
	dpcm_runtime_merge_chan(...,	&runtime->hw.channels_min,
					&runtime->hw.channels_max);
	dpcm_runtime_merge_rate(...,	&runtime->hw.rates,
					&runtime->hw.rate_min,
					&runtime->hw.rate_max);

We want to replace it into

	dpcm_runtime_merge_format(...,	runtime);
	dpcm_runtime_merge_chan(...,	runtime);
	dpcm_runtime_merge_rate(...,	runtime);

This patch do it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/874kj9aigd.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-03 17:41:42 +00:00
Kuninori Morimoto
2b39123b13
ASoC: soc-pcm: add soc_create_pcm() and simplify soc_new_pcm()
soc_new_pcm() implementation is very long / verbose / complex,
thus, it is very difficult to read.
If we read it carefully, we can notice that it is consisted by

	int soc_new_pcm(...)
	{
		(1) judging playback/caputre part
		(2) creating the PCM part
		(3) setup pcm/rtd part
	}

This patch adds new soc_create_pcm() for (2) part
and offload it from snd_pcm_new().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/875z3paigi.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-03 17:41:41 +00:00
Kuninori Morimoto
7fc6bebd58
ASoC: soc-pcm: add soc_get_playback_capture() and simplify soc_new_pcm()
soc_new_pcm() implementation is very long / verbose / complex,
thus, it is very difficult to read.
If we read it carefully, we can notice that it is consisted by

	int soc_new_pcm(...)
	{
		(1) judging playback/caputre part
		(2) creating the PCM part
		(3) setup pcm/rtd part
	}

This patch adds new soc_get_playback_capture() for (1) part
and offload it from soc_new_pcm().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/877do5aign.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-03 17:41:40 +00:00
Kuninori Morimoto
e04e7b8ccd
ASoC: soc-pcm: tidyup pcm setting
Current soc_new_pcm() setups pcm randomly.
This patch tidyup it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/878s8laigt.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-03 17:41:39 +00:00
Kuninori Morimoto
3a90672111
ASoC: soc-pcm: cleanup soc_pcm_params_symmetry()
soc_pcm_params_symmetry() checks rate/channel/sample_bits state.
These are very similar but different, thus, it needs to have very
verbose code.
This patch use macro for it and make code more simple.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/878s8un6si.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:38:22 +00:00
Kuninori Morimoto
fac110cbcd
ASoC: soc-pcm: cleanup soc_pcm_apply_symmetry()
soc_pcm_apply_symmetry() want to call snd_pcm_hw_constraint_single()
for rate/channel/sample_bits, but, it needs many condition checks.
These are very similar but different, thus, it needs to have very
verbose code.
This patch use macro for it and make code more simple.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87a6tan6sm.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:38:21 +00:00
Kuninori Morimoto
f14654ddf2
ASoC: sync parameter naming : rate / sample_bits
snd_pcm_runtime / snd_soc_dai / snd_soc_dai_driver / snd_soc_dai_link
have related parameter which is similar but not same naming.

	struct snd_pcm_runtime {
		...
(A)		unsigned int rate;
		...
(B)		unsigned int sample_bits;
		...
	};

	struct snd_soc_dai {
		...
(A)		unsigned int rate;
(B)		unsigned int sample_bits;
		...
	};

	struct snd_soc_dai_driver {
		...
(A)		unsigned int symmetric_rates:1;
(B)		unsigned int symmetric_samplebits:1;
		...
	};

	struct snd_soc_dai_link {
		...
(A)		unsigned int symmetric_rates:1;
(B)		unsigned int symmetric_samplebits:1;
		...
	};

Because it is similar but not same naming rule,
code can be verbose / can't share macro.

This patch sync naming rule for framework.
	- xxx_rates;
	+ xxx_rate;

	- xxx_samplebits;
	+ xxx_sample_bits;

old name will be removed if all drivers were switched
to new naming rule.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87wnweolj6.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:37:43 +00:00
Kuninori Morimoto
80f454e283
ASoC: soc-pcm: revert soc_pcm_apply_symmetry()
commit a39748d03c ("ASoC: soc-pcm: cleanup soc_pcm_apply_symmetry()")
was applied by miscommunication.
To more cleanup code, and to be easy review, this patch reverts it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87y2guoljm.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21 12:37:43 +00:00
Kuninori Morimoto
a39748d03c
ASoC: soc-pcm: cleanup soc_pcm_apply_symmetry()
soc_pcm_apply_symmetry() want to call snd_pcm_hw_constraint_single()
for rate/channel/sample_bits, but, it needs many condition check.
These are very similar but different, thus, it needs to have very
verbose code.
This patch use macro for it and make code more simple.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87wnxo7uyq.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-13 11:33:12 +00:00
Kuninori Morimoto
2805b8bd3e
ASoC: soc-pcm: add soc_pcm_set_dai_params()
Getting rate/channels/sample_bits from param needs fixed method.
This patch adds new soc_pcm_set_dai_params() and replace existing code.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87y2i47uyw.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-13 11:33:11 +00:00
Kuninori Morimoto
a7e20444ef
ASoC: soc-pcm: add dpcm_set_be_update_state()
soc-pcm has dpcm_set_fe_update_state() to update FE's runtime_update
(except dpcm_fe_dai_do_trigger() which needs to update it without it).
OTOH, it doesn't have BE's update function.

	O: dpcm_set_fe_update_state()
	X: dpcm_set_be_update_state()

This patch add BE's dpcm_set_fe_update_state()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87zh2k7uz1.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-13 11:33:10 +00:00
Kuninori Morimoto
9c6d7f9346
ASoC: soc-pcm: move dpcm_set_fe_update_state()
This patch moves dpcm_set_fe_update_state() to top side.
This is prepare for cleanup soc-pcm.c

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/871rfw99jn.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-13 11:33:10 +00:00
Dan Carpenter
e91b65b36f
ASoC: soc-pcm: Fix an uninitialized error code
The error path here doesn't set "ret" so it returns uninitialized data
instead of a negative error code.

Fixes: 2c1382840c ("ASoC: soc-pcm: disconnect BEs if the FE is not ready")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/X/wfXQFxeMLvpO+1@mwanda
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-11 14:03:55 +00:00
Souptick Joarder
4eeed5f403
ASoC: soc-pcm: return correct -ERRNO in failure path
Kernel test robot throws below error ->

sound/soc/soc-pcm.c:2523 dpcm_run_update_startup() error: uninitialized
symbol 'ret'.

Initializing ret = 0 and returning correct -ERRNO in failure path.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
Link: https://lore.kernel.org/r/1610163901-5523-1-git-send-email-jrdr.linux@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-11 14:03:52 +00:00
朱灿灿
2c1382840c
ASoC: soc-pcm: disconnect BEs if the FE is not ready
FE is connected to two BEs, BE1 is active, BE2 is deactive.
When closing BE1, FE/BE1 is in HW_FREE state, then BE2 is
startup by mixer runtime update.

For FE is in HW_FREE state, dpcm_run_update_startup() will skip
BE2's startup because FE's state is HW_FREE, BE2 stays in FE's
be_clients list.

During FE's closed, the dpcm_fe_dai_close() will close all related
BEs, BE2 will be closed. This will lead to BE2's dpcm[stream].users
mismatch.

We need disconnet all pending BEs in the corner case.

Signed-off-by: zhucancan <zhucancan@vivo.com>
Link: https://lore.kernel.org/r/AAoArwDfDnoefyxzy2wyiaqm.1.1608885766936.Hmail.zhucancan@vivo.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-07 16:14:13 +00:00
Kuninori Morimoto
6374f493d9
ASoC: soc-pcm: care trigger rollback
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 < 0)
				break;

(*)			ret = snd_soc_pcm_component_trigger(substream, cmd);
			if (ret < 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 < 0)
				break;

			ret = snd_soc_pcm_component_trigger(substream, cmd);
			if (ret < 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 <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87a6uycssd.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-09 12:13:38 +00:00
Kuninori Morimoto
a9faca15a6
ASoC: soc-pcm: remove dpcm_do_trigger()
dpcm_be_dai_trigger() is calling dpcm_do_trigger()
at each SNDRV_PCM_TRIGGER_xxx (1).

	int dpcm_be_dai_trigger(...)
	{
		for_each_dpcm_be(fe, stream, dpcm) {
(B)			...
			switch (cmd) {
			case SNDRV_PCM_TRIGGER_START:
				...
(1)				ret = dpcm_do_trigger(...);
				...
			case SNDRV_PCM_TRIGGER_RESUME:
				...
(1)				ret = dpcm_do_trigger(...);
				...
			case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
				...
(1)				ret = dpcm_do_trigger(...);
				...
			case SNDRV_PCM_TRIGGER_STOP:
				...
(1)				ret = dpcm_do_trigger(...);
				...
			case SNDRV_PCM_TRIGGER_SUSPEND:
				...
(1)				ret = dpcm_do_trigger(...);
				...
			case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
				...
(1)				ret = dpcm_do_trigger(...);
				...
			}
		}
	}

But it is just very verbose and duplicated function.
Because We can indicate dev_dbg() (A) at dpcm_be_dai_trigger() (B).
And dev_err() (C) is not needed because soc_pcm_trigger() itself
indicates error message when error.

	static int dpcm_do_trigger(...)
	{
		int ret;

(A)		dev_dbg(...);

		ret = soc_pcm_trigger(substream, cmd);
		if (ret < 0)
(C)			dev_err(...);

		return ret;
	}

This patch replace dpcm_do_trigger() to soc_pcm_trigger().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87blfecssk.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-09 12:13:37 +00:00
Ranjani Sridharan
bb9dd3ce61
ASoC: pcm: send DAPM_STREAM_STOP event in dpcm_fe_dai_shutdown
A recent change removed the call to send the DAPM_STREAM_STOP
event in dpcm_fe_dai_shutdown. But this causes a regression
when a PCM prepare is not paired with a hw_free. So, add
the DAPM_STREAM_STOP event back to dpcm_fe_dai_shutdown()
to fix this.

The new sequence would be:
soc_pcm_prepare()
    -> SND_SOC_DAPM_STREAM_START

soc_pcm_hw_free()
    -> soc_pcm_hw_free()
	-> SND_SOC_DAPM_STREAM_STOP

dpcm_fe_dai_shutdown()
    -> SND_SOC_DAPM_STREAM_STOP

Note that the DAPM_STREAM_STOP will be called twice but it seems
harmless.

Fixes: a27b421f1d ('ASoC: pcm: call snd_soc_dapm_stream_stop() in soc_pcm_hw_clean')

Reported-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20201202193343.912942-1-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-07 14:18:02 +00:00
Ranjani Sridharan
a27b421f1d
ASoC: pcm: call snd_soc_dapm_stream_stop() in soc_pcm_hw_clean
Currently, the SND_SOC_DAPM_STREAM_START event is sent during
pcm_prepare() but the SND_SOC_DAPM_STREAM_STOP event is
sent only in dpcm_fe_dai_shutdown() after soc_pcm_close().
This results in an imbalance between when the DAPM widgets
receive the PRE/POST_PMU/PMD events. So call
snd_soc_dapm_stream_stop() in soc_pcm_hw_clean() before the
snd_soc_pcm_component_hw_free() to keep the stream_stop DAPM
event balanced with the stream_start event in soc_pm_prepare().

Also, in order to prevent duplicate DAPM stream events,
remove the call for DAPM STREAM_START event in dpcm_fe_dai_prepare()
and the call for DAPM STREAM_STOP event in dpcm_fe_dai_shutdown().

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20201117215001.163107-1-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-19 13:00:05 +00:00
Sameer Pujar
aa293777bf
ASoC: soc-pcm: Get all BEs along DAPM path
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 <spujar@nvidia.com>
Link: https://lore.kernel.org/r/1604329814-24779-3-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-10 17:28:18 +00:00