ASoC: rsnd: CTU kctrl sets once
Same CTU might be used few times if system/platform is using MIX. For example below case. DAI0 playback = <&src0 &ctu02 &mix0 &dvc0 &ssi0>; DAI1 playback = <&src2 &ctu03 &mix0 &dvc0 &ssi0>; This case, ALSA will have CTU,0 and CTU,1 kcontrol interfaces, but these are same CTU. This is confusing. This patch adds new flags and avoid such case. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
b918f1bc7f
commit
99dc79d060
@ -81,8 +81,11 @@ struct rsnd_ctu {
|
|||||||
struct rsnd_kctrl_cfg_m sv3;
|
struct rsnd_kctrl_cfg_m sv3;
|
||||||
struct rsnd_kctrl_cfg_s reset;
|
struct rsnd_kctrl_cfg_s reset;
|
||||||
int channels;
|
int channels;
|
||||||
|
u32 flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define KCTRL_INITIALIZED (1 << 0)
|
||||||
|
|
||||||
#define rsnd_ctu_nr(priv) ((priv)->ctu_nr)
|
#define rsnd_ctu_nr(priv) ((priv)->ctu_nr)
|
||||||
#define for_each_rsnd_ctu(pos, priv, i) \
|
#define for_each_rsnd_ctu(pos, priv, i) \
|
||||||
for ((i) = 0; \
|
for ((i) = 0; \
|
||||||
@ -277,6 +280,9 @@ static int rsnd_ctu_pcm_new(struct rsnd_mod *mod,
|
|||||||
struct rsnd_ctu *ctu = rsnd_mod_to_ctu(mod);
|
struct rsnd_ctu *ctu = rsnd_mod_to_ctu(mod);
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
if (rsnd_flags_has(ctu, KCTRL_INITIALIZED))
|
||||||
|
return 0;
|
||||||
|
|
||||||
/* CTU Pass */
|
/* CTU Pass */
|
||||||
ret = rsnd_kctrl_new_m(mod, io, rtd, "CTU Pass",
|
ret = rsnd_kctrl_new_m(mod, io, rtd, "CTU Pass",
|
||||||
rsnd_kctrl_accept_anytime,
|
rsnd_kctrl_accept_anytime,
|
||||||
@ -326,6 +332,8 @@ static int rsnd_ctu_pcm_new(struct rsnd_mod *mod,
|
|||||||
rsnd_ctu_value_reset,
|
rsnd_ctu_value_reset,
|
||||||
&ctu->reset, 1);
|
&ctu->reset, 1);
|
||||||
|
|
||||||
|
rsnd_flags_set(ctu, KCTRL_INITIALIZED);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user