aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2013-10-18 01:50:59 -0400
committerMark Brown <broonie@linaro.org>2013-10-20 12:28:37 -0400
commitcdcfcac968a1ec648434892b6addd80e66a5a892 (patch)
treefbe99d504bcf2b169c62674523a14aabbb54a2be
parent2192f81c53a7879c803f0f7d6c49645fdf6c2f6a (diff)
ASoC: rcar: add rsnd_scu_hpbif_is_enable()
Current SSI needs RSND_SSI_DEPENDENT flag to decide dependent/independent mode. And SCU needs RSND_SCU_USE_HPBIF flag to decide HPBIF is enable/disable. But these 2 means same things. This patch adds new rsnd_scu_hpbif_is_enable() function, and merges above methods. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r--include/sound/rcar_snd.h1
-rw-r--r--sound/soc/sh/rcar/rsnd.h1
-rw-r--r--sound/soc/sh/rcar/scu.c12
-rw-r--r--sound/soc/sh/rcar/ssi.c8
4 files changed, 15 insertions, 7 deletions
diff --git a/include/sound/rcar_snd.h b/include/sound/rcar_snd.h
index fe66533e9b7a..6b4211c256b3 100644
--- a/include/sound/rcar_snd.h
+++ b/include/sound/rcar_snd.h
@@ -36,7 +36,6 @@
36#define RSND_SSI_CLK_PIN_SHARE (1 << 31) 36#define RSND_SSI_CLK_PIN_SHARE (1 << 31)
37#define RSND_SSI_CLK_FROM_ADG (1 << 30) /* clock parent is master */ 37#define RSND_SSI_CLK_FROM_ADG (1 << 30) /* clock parent is master */
38#define RSND_SSI_SYNC (1 << 29) /* SSI34_sync etc */ 38#define RSND_SSI_SYNC (1 << 29) /* SSI34_sync etc */
39#define RSND_SSI_DEPENDENT (1 << 28) /* SSI needs SRU/SCU */
40 39
41#define RSND_SSI_PLAY (1 << 24) 40#define RSND_SSI_PLAY (1 << 24)
42 41
diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
index 3868aaf41cc4..5feb67ca2d24 100644
--- a/sound/soc/sh/rcar/rsnd.h
+++ b/sound/soc/sh/rcar/rsnd.h
@@ -281,6 +281,7 @@ int rsnd_scu_probe(struct platform_device *pdev,
281void rsnd_scu_remove(struct platform_device *pdev, 281void rsnd_scu_remove(struct platform_device *pdev,
282 struct rsnd_priv *priv); 282 struct rsnd_priv *priv);
283struct rsnd_mod *rsnd_scu_mod_get(struct rsnd_priv *priv, int id); 283struct rsnd_mod *rsnd_scu_mod_get(struct rsnd_priv *priv, int id);
284bool rsnd_scu_hpbif_is_enable(struct rsnd_mod *mod);
284#define rsnd_scu_nr(priv) ((priv)->scu_nr) 285#define rsnd_scu_nr(priv) ((priv)->scu_nr)
285 286
286/* 287/*
diff --git a/sound/soc/sh/rcar/scu.c b/sound/soc/sh/rcar/scu.c
index 2df2e9150b89..1ab1bce6be7f 100644
--- a/sound/soc/sh/rcar/scu.c
+++ b/sound/soc/sh/rcar/scu.c
@@ -146,20 +146,26 @@ static int rsnd_scu_set_hpbif(struct rsnd_priv *priv,
146 return 0; 146 return 0;
147} 147}
148 148
149bool rsnd_scu_hpbif_is_enable(struct rsnd_mod *mod)
150{
151 struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
152 u32 flags = rsnd_scu_mode_flags(scu);
153
154 return !!(flags & RSND_SCU_USE_HPBIF);
155}
156
149static int rsnd_scu_start(struct rsnd_mod *mod, 157static int rsnd_scu_start(struct rsnd_mod *mod,
150 struct rsnd_dai *rdai, 158 struct rsnd_dai *rdai,
151 struct rsnd_dai_stream *io) 159 struct rsnd_dai_stream *io)
152{ 160{
153 struct rsnd_priv *priv = rsnd_mod_to_priv(mod); 161 struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
154 struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
155 struct device *dev = rsnd_priv_to_dev(priv); 162 struct device *dev = rsnd_priv_to_dev(priv);
156 u32 flags = rsnd_scu_mode_flags(scu);
157 int ret; 163 int ret;
158 164
159 /* 165 /*
160 * SCU will be used if it has RSND_SCU_USE_HPBIF flags 166 * SCU will be used if it has RSND_SCU_USE_HPBIF flags
161 */ 167 */
162 if (!(flags & RSND_SCU_USE_HPBIF)) { 168 if (!rsnd_scu_hpbif_is_enable(mod)) {
163 /* it use PIO transter */ 169 /* it use PIO transter */
164 dev_dbg(dev, "%s%d is not used\n", 170 dev_dbg(dev, "%s%d is not used\n",
165 rsnd_mod_name(mod), rsnd_mod_id(mod)); 171 rsnd_mod_name(mod), rsnd_mod_id(mod));
diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
index fae26d3f79d2..7613256c9840 100644
--- a/sound/soc/sh/rcar/ssi.c
+++ b/sound/soc/sh/rcar/ssi.c
@@ -106,6 +106,7 @@ static void rsnd_ssi_mode_init(struct rsnd_priv *priv,
106{ 106{
107 struct device *dev = rsnd_priv_to_dev(priv); 107 struct device *dev = rsnd_priv_to_dev(priv);
108 struct rsnd_ssi *ssi; 108 struct rsnd_ssi *ssi;
109 struct rsnd_mod *scu;
109 u32 flags; 110 u32 flags;
110 u32 val; 111 u32 val;
111 int i; 112 int i;
@@ -116,13 +117,14 @@ static void rsnd_ssi_mode_init(struct rsnd_priv *priv,
116 ssiu->ssi_mode0 = 0; 117 ssiu->ssi_mode0 = 0;
117 for_each_rsnd_ssi(ssi, priv, i) { 118 for_each_rsnd_ssi(ssi, priv, i) {
118 flags = rsnd_ssi_mode_flags(ssi); 119 flags = rsnd_ssi_mode_flags(ssi);
120 scu = rsnd_scu_mod_get(priv, rsnd_mod_id(&ssi->mod));
119 121
120 /* see also BUSIF_MODE */ 122 /* see also BUSIF_MODE */
121 if (!(flags & RSND_SSI_DEPENDENT)) { 123 if (rsnd_scu_hpbif_is_enable(scu)) {
124 dev_dbg(dev, "SSI%d uses DEPENDENT mode\n", i);
125 } else {
122 ssiu->ssi_mode0 |= (1 << i); 126 ssiu->ssi_mode0 |= (1 << i);
123 dev_dbg(dev, "SSI%d uses INDEPENDENT mode\n", i); 127 dev_dbg(dev, "SSI%d uses INDEPENDENT mode\n", i);
124 } else {
125 dev_dbg(dev, "SSI%d uses DEPENDENT mode\n", i);
126 } 128 }
127 } 129 }
128 130