alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: Mark Brown <broonie@kernel.org>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>,
	Simon <horms@verge.net.au>,
	linux-renesas-soc@vger.kernel.org,
	Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Subject: [PATCH 4/6 v3] ASoC: rsnd: CTU kctrl sets once
Date: Sun, 1 Oct 2017 23:48:46 +0000	[thread overview]
Message-ID: <87wp4emo6t.wl%kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <873772o2ty.wl%kuninori.morimoto.gx@renesas.com>


From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

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>
---
v2 -> v3

 - INITIALIZEED -> INITIALIZED
 - confusable -> confusing

 sound/soc/sh/rcar/ctu.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/sound/soc/sh/rcar/ctu.c b/sound/soc/sh/rcar/ctu.c
index e7f53f4..ad07ba8 100644
--- a/sound/soc/sh/rcar/ctu.c
+++ b/sound/soc/sh/rcar/ctu.c
@@ -81,8 +81,11 @@ struct rsnd_ctu {
 	struct rsnd_kctrl_cfg_m sv3;
 	struct rsnd_kctrl_cfg_s reset;
 	int channels;
+	u32 flags;
 };
 
+#define KCTRL_INITIALIZED	(1 << 0)
+
 #define rsnd_ctu_nr(priv) ((priv)->ctu_nr)
 #define for_each_rsnd_ctu(pos, priv, i)					\
 	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);
 	int ret;
 
+	if (rsnd_flags_has(ctu, KCTRL_INITIALIZED))
+		return 0;
+
 	/* CTU Pass */
 	ret = rsnd_kctrl_new_m(mod, io, rtd, "CTU Pass",
 			       rsnd_kctrl_accept_anytime,
@@ -326,6 +332,8 @@ static int rsnd_ctu_pcm_new(struct rsnd_mod *mod,
 			       rsnd_ctu_value_reset,
 			       &ctu->reset, 1);
 
+	rsnd_flags_set(ctu, KCTRL_INITIALIZED);
+
 	return ret;
 }
 
-- 
1.9.1

  parent reply	other threads:[~2017-10-01 23:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-01 23:47 [PATCH 0/6 v3] ASoC: rsnd: add MIX Volume Ramp support Kuninori Morimoto
2017-10-01 23:47 ` [PATCH 1/6 v3] ASoC: rsnd: add generic rsnd_flags_xxx() macro Kuninori Morimoto
2017-10-04 11:28   ` Applied "ASoC: rsnd: add generic rsnd_flags_xxx() macro" to the asoc tree Mark Brown
2017-10-01 23:48 ` [PATCH 2/6 v3] ASoC: rsnd: use generic rsnd_flags_xxx() macro on ADG Kuninori Morimoto
2017-10-01 23:48 ` [PATCH 3/6 v3] ASoC: rsnd: DVC kctrl sets once Kuninori Morimoto
2017-10-04 11:28   ` Applied "ASoC: rsnd: DVC kctrl sets once" to the asoc tree Mark Brown
2017-10-01 23:48 ` Kuninori Morimoto [this message]
2017-10-04 11:28   ` Applied "ASoC: rsnd: CTU " Mark Brown
2017-10-01 23:49 ` [PATCH 5/6 v3] ASoC: rsnd: makes volume ramp rate list generic Kuninori Morimoto
2017-10-01 23:49 ` [PATCH 6/6 v3] ASoC: rsnd: add MIX Volume Ramp support Kuninori Morimoto
2017-10-04 11:28   ` Applied "ASoC: rsnd: add MIX Volume Ramp support" to the asoc tree Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wp4emo6t.wl%kuninori.morimoto.gx@renesas.com \
    --to=kuninori.morimoto.gx@renesas.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=hiroyuki.yokoyama.vx@renesas.com \
    --cc=horms@verge.net.au \
    --cc=linux-renesas-soc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).