ASoC: rsnd: has .symmetric_rates if SSIs are sharing WS pin
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tue, 12 Jun 2018 05:52:00 +0000 (05:52 +0000)
committerMark Brown <broonie@kernel.org>
Mon, 18 Jun 2018 11:26:42 +0000 (12:26 +0100)
If SSIs are sharing WS pin, it should has .symmetric_rates.
This patch sets it.

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>
sound/soc/sh/rcar/core.c
sound/soc/sh/rcar/ssi.c

index af04d41..6bbddde 100644 (file)
@@ -1085,6 +1085,12 @@ static void __rsnd_dai_probe(struct rsnd_priv *priv,
                of_node_put(capture);
        }
 
+       if (rsnd_ssi_is_pin_sharing(io_capture) ||
+           rsnd_ssi_is_pin_sharing(io_playback)) {
+               /* should have symmetric_rates if pin sharing */
+               drv->symmetric_rates = 1;
+       }
+
        dev_dbg(dev, "%s (%s/%s)\n", rdai->name,
                rsnd_io_to_mod_ssi(io_playback) ? "play"    : " -- ",
                rsnd_io_to_mod_ssi(io_capture) ? "capture" : "  --   ");
index 9538f76..4e60564 100644 (file)
@@ -1055,9 +1055,10 @@ struct rsnd_mod *rsnd_ssi_mod_get(struct rsnd_priv *priv, int id)
 
 int __rsnd_ssi_is_pin_sharing(struct rsnd_mod *mod)
 {
-       struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
+       if (!mod)
+               return 0;
 
-       return !!(rsnd_flags_has(ssi, RSND_SSI_CLK_PIN_SHARE));
+       return !!(rsnd_flags_has(rsnd_mod_to_ssi(mod), RSND_SSI_CLK_PIN_SHARE));
 }
 
 static u32 *rsnd_ssi_get_status(struct rsnd_dai_stream *io,