summaryrefslogtreecommitdiffstats
path: root/sound/soc/sh/rcar/ssi.c
diff options
context:
space:
mode:
authorKuninori Morimoto2016-02-18 09:18:54 +0100
committerMark Brown2016-02-19 16:53:02 +0100
commit4f5c634d58e71963d3c34a0a4af9ec71785f094f (patch)
tree93e1610c01c34063356918eb1c2eb961253b0c78 /sound/soc/sh/rcar/ssi.c
parentASoC: rsnd: move rsnd_ssi_irq() position (diff)
downloadkernel-qcow2-linux-4f5c634d58e71963d3c34a0a4af9ec71785f094f.tar.gz
kernel-qcow2-linux-4f5c634d58e71963d3c34a0a4af9ec71785f094f.tar.xz
kernel-qcow2-linux-4f5c634d58e71963d3c34a0a4af9ec71785f094f.zip
ASoC: rsnd: judge multi SSI in runtime
Current rsnd supports multi SSI (maximum 4 SSI for 8ch), and, it should determine whether using each SSI or not in runtime. Current judgement is vague, and had broken by c308abe45e2("ASoC: rsnd: rsnd_ssi_is_multi_slave() macro uses rsnd_ssi_multi_slaves()") This patch makes clean it, and solve this issue. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sh/rcar/ssi.c')
-rw-r--r--sound/soc/sh/rcar/ssi.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
index d46bc08ad977..32f1f5fb82b6 100644
--- a/sound/soc/sh/rcar/ssi.c
+++ b/sound/soc/sh/rcar/ssi.c
@@ -144,7 +144,7 @@ static void rsnd_ssi_status_check(struct rsnd_mod *mod,
rsnd_mod_name(mod), rsnd_mod_id(mod));
}
-u32 rsnd_ssi_multi_slaves(struct rsnd_dai_stream *io)
+static u32 rsnd_ssi_multi_slaves(struct rsnd_dai_stream *io)
{
struct rsnd_mod *mod;
enum rsnd_mod_type types[] = {
@@ -166,6 +166,17 @@ u32 rsnd_ssi_multi_slaves(struct rsnd_dai_stream *io)
return mask;
}
+u32 rsnd_ssi_multi_slaves_runtime(struct rsnd_dai_stream *io)
+{
+ struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
+ u32 mask = rsnd_ssi_multi_slaves(io);
+
+ if (mask && (runtime->channels >= 6))
+ return mask;
+
+ return 0;
+}
+
static int rsnd_ssi_master_clk_start(struct rsnd_mod *mod,
struct rsnd_dai_stream *io)
{
@@ -415,7 +426,7 @@ static int rsnd_ssi_start(struct rsnd_mod *mod,
* EN will be set via SSIU :: SSI_CONTROL
* if Multi channel mode
*/
- if (rsnd_ssi_multi_slaves(io))
+ if (rsnd_ssi_multi_slaves_runtime(io))
return 0;
rsnd_mod_bset(mod, SSICR, EN, EN);