aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2014-01-23 21:40:54 -0500
committerMark Brown <broonie@linaro.org>2014-02-03 07:41:37 -0500
commit96c7c0d6f8c6e09e9123f0518130c047c5de40f6 (patch)
treeb3719f7be4c97842724e5b4dbfe2302bca558307
parent39cf3c4064b8db25efe501fec8e3c48a578b4b58 (diff)
ASoC: rsnd: rsnd_scu_hpbif_is_enable() become macro
rsnd_scu_hpbif_is_enable() is used only scu.c now. It can be local macro Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r--sound/soc/sh/rcar/rsnd.h1
-rw-r--r--sound/soc/sh/rcar/scu.c15
2 files changed, 5 insertions, 11 deletions
diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
index 33c01fb9f5fd..a9c58305e2f1 100644
--- a/sound/soc/sh/rcar/rsnd.h
+++ b/sound/soc/sh/rcar/rsnd.h
@@ -303,7 +303,6 @@ int rsnd_scu_probe(struct platform_device *pdev,
303void rsnd_scu_remove(struct platform_device *pdev, 303void rsnd_scu_remove(struct platform_device *pdev,
304 struct rsnd_priv *priv); 304 struct rsnd_priv *priv);
305struct rsnd_mod *rsnd_scu_mod_get(struct rsnd_priv *priv, int id); 305struct rsnd_mod *rsnd_scu_mod_get(struct rsnd_priv *priv, int id);
306bool rsnd_scu_hpbif_is_enable(struct rsnd_mod *mod);
307unsigned int rsnd_scu_get_ssi_rate(struct rsnd_priv *priv, 306unsigned int rsnd_scu_get_ssi_rate(struct rsnd_priv *priv,
308 struct rsnd_mod *ssi_mod, 307 struct rsnd_mod *ssi_mod,
309 struct snd_pcm_runtime *runtime); 308 struct snd_pcm_runtime *runtime);
diff --git a/sound/soc/sh/rcar/scu.c b/sound/soc/sh/rcar/scu.c
index 8181ec55ad21..2f839f72c99c 100644
--- a/sound/soc/sh/rcar/scu.c
+++ b/sound/soc/sh/rcar/scu.c
@@ -31,6 +31,8 @@ struct rsnd_scu {
31#define rsnd_scu_convert_rate(p) ((p)->info->convert_rate) 31#define rsnd_scu_convert_rate(p) ((p)->info->convert_rate)
32#define rsnd_mod_to_scu(_mod) \ 32#define rsnd_mod_to_scu(_mod) \
33 container_of((_mod), struct rsnd_scu, mod) 33 container_of((_mod), struct rsnd_scu, mod)
34#define rsnd_scu_hpbif_is_enable(scu) \
35 (rsnd_scu_mode_flags(scu) & RSND_SCU_USE_HPBIF)
34 36
35#define for_each_rsnd_scu(pos, priv, i) \ 37#define for_each_rsnd_scu(pos, priv, i) \
36 for ((i) = 0; \ 38 for ((i) = 0; \
@@ -113,13 +115,14 @@ static int rsnd_scu_ssi_mode_init(struct rsnd_mod *mod,
113 struct rsnd_dai_stream *io) 115 struct rsnd_dai_stream *io)
114{ 116{
115 struct rsnd_priv *priv = rsnd_mod_to_priv(mod); 117 struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
118 struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
116 int id = rsnd_mod_id(mod); 119 int id = rsnd_mod_id(mod);
117 120
118 /* 121 /*
119 * SSI_MODE0 122 * SSI_MODE0
120 */ 123 */
121 rsnd_mod_bset(mod, SSI_MODE0, (1 << id), 124 rsnd_mod_bset(mod, SSI_MODE0, (1 << id),
122 rsnd_scu_hpbif_is_enable(mod) ? 0 : (1 << id)); 125 rsnd_scu_hpbif_is_enable(scu) ? 0 : (1 << id));
123 126
124 /* 127 /*
125 * SSI_MODE1 128 * SSI_MODE1
@@ -316,14 +319,6 @@ static int rsnd_scu_set_convert_rate(struct rsnd_mod *mod,
316 return 0; 319 return 0;
317} 320}
318 321
319bool rsnd_scu_hpbif_is_enable(struct rsnd_mod *mod)
320{
321 struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
322 u32 flags = rsnd_scu_mode_flags(scu);
323
324 return !!(flags & RSND_SCU_USE_HPBIF);
325}
326
327static int rsnd_scu_init(struct rsnd_mod *mod, 322static int rsnd_scu_init(struct rsnd_mod *mod,
328 struct rsnd_dai *rdai, 323 struct rsnd_dai *rdai,
329 struct rsnd_dai_stream *io) 324 struct rsnd_dai_stream *io)
@@ -449,7 +444,7 @@ int rsnd_scu_probe(struct platform_device *pdev,
449 scu->clk = clk; 444 scu->clk = clk;
450 445
451 ops = &rsnd_scu_non_ops; 446 ops = &rsnd_scu_non_ops;
452 if (rsnd_scu_hpbif_is_enable(&scu->mod)) 447 if (rsnd_scu_hpbif_is_enable(scu))
453 ops = &rsnd_scu_ops; 448 ops = &rsnd_scu_ops;
454 449
455 rsnd_mod_init(priv, &scu->mod, ops, i); 450 rsnd_mod_init(priv, &scu->mod, ops, i);