summaryrefslogtreecommitdiff
path: root/sound/soc/sh/rcar/scu.c
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2014-01-24 02:39:32 (GMT)
committerMark Brown <broonie@linaro.org>2014-02-03 12:41:36 (GMT)
commit7b5ce9759a60ebdffa1e76224ccb3d85bd06e4ac (patch)
treef367d8dc86900563f57f463b84d558a6c3f86f1e /sound/soc/sh/rcar/scu.c
parent6f3ab6c1c022e7a4877d38940cd45ae7804a15e2 (diff)
downloadlinux-7b5ce9759a60ebdffa1e76224ccb3d85bd06e4ac.tar.xz
ASoC: rsnd: SSI_MODE0/1 settings goes to scu.c
SRU (Gen1) / SCU (Gen2) / SSIU (Gen2) are controlled under scu.c. (SCU + SSIU (Gen2) was SRU (Gen1)) And register of SSI_MODE0/1 are mapped on these IP. But these have been implemented under ssi.c on this driver. The naming is very confusable, but it should be implemented under scu.c Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/sh/rcar/scu.c')
-rw-r--r--sound/soc/sh/rcar/scu.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/sound/soc/sh/rcar/scu.c b/sound/soc/sh/rcar/scu.c
index 5d2dbbb..ade1047 100644
--- a/sound/soc/sh/rcar/scu.c
+++ b/sound/soc/sh/rcar/scu.c
@@ -49,6 +49,46 @@ struct rsnd_scu {
((pos) = (struct rsnd_scu *)(priv)->scu + i); \
i++)
+static int rsnd_scu_ssi_mode_init(struct rsnd_mod *mod,
+ struct rsnd_dai *rdai,
+ struct rsnd_dai_stream *io)
+{
+ struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
+ int id = rsnd_mod_id(mod);
+
+ /*
+ * SSI_MODE0
+ */
+ rsnd_mod_bset(mod, SSI_MODE0, (1 << id),
+ rsnd_scu_hpbif_is_enable(mod) ? 0 : (1 << id));
+
+ /*
+ * SSI_MODE1
+ */
+ if (rsnd_ssi_is_pin_sharing(rsnd_ssi_mod_get(priv, id))) {
+ int shift = -1;
+ switch (id) {
+ case 1:
+ shift = 0;
+ break;
+ case 2:
+ shift = 2;
+ break;
+ case 4:
+ shift = 16;
+ break;
+ }
+
+ if (shift >= 0)
+ rsnd_mod_bset(mod, SSI_MODE1,
+ 0x3 << shift,
+ rsnd_dai_is_clk_master(rdai) ?
+ 0x2 << shift : 0x1 << shift);
+ }
+
+ return 0;
+}
+
/* Gen1 only */
static int rsnd_src_set_route_if_gen1(
struct rsnd_mod *mod,
@@ -235,6 +275,10 @@ static int rsnd_scu_init(struct rsnd_mod *mod,
clk_enable(scu->clk);
+ ret = rsnd_scu_ssi_mode_init(mod, rdai, io);
+ if (ret < 0)
+ return ret;
+
ret = rsnd_src_set_route_if_gen1(mod, rdai, io);
if (ret < 0)
return ret;
@@ -301,6 +345,7 @@ static struct rsnd_mod_ops rsnd_scu_ops = {
static struct rsnd_mod_ops rsnd_scu_non_ops = {
.name = "scu (non)",
+ .init = rsnd_scu_ssi_mode_init,
};
struct rsnd_mod *rsnd_scu_mod_get(struct rsnd_priv *priv, int id)