summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2014-01-24 02:38:26 (GMT)
committerMark Brown <broonie@linaro.org>2014-02-03 12:41:15 (GMT)
commit013f38fe260af6f505ad5da5f6b0db3e42ca1fbb (patch)
tree3af9e6d9caf7b37213e3d0a35ff174659c1ce5c0
parent6acef1721c1046be8b5f44b839c28817cfbd66c6 (diff)
downloadlinux-013f38fe260af6f505ad5da5f6b0db3e42ca1fbb.tar.xz
ASoC: rsnd: control SCU ops in probe timing
SCU will be used if platform requested to use. Current driver is checking it in runtime, but, it can be decided in probe timing. This patch do it 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/scu.c30
1 files changed, 11 insertions, 19 deletions
diff --git a/sound/soc/sh/rcar/scu.c b/sound/soc/sh/rcar/scu.c
index e4b82ab..ab5f1d2 100644
--- a/sound/soc/sh/rcar/scu.c
+++ b/sound/soc/sh/rcar/scu.c
@@ -270,24 +270,10 @@ static int rsnd_scu_start(struct rsnd_mod *mod,
{
struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
- struct device *dev = rsnd_priv_to_dev(priv);
int ret;
- /*
- * SCU will be used if it has RSND_SCU_USE_HPBIF flags
- */
- if (!rsnd_scu_hpbif_is_enable(mod)) {
- /* it use PIO transter */
- dev_dbg(dev, "%s%d is not used\n",
- rsnd_mod_name(mod), rsnd_mod_id(mod));
-
- return 0;
- }
-
clk_enable(scu->clk);
- /* it use DMA transter */
-
ret = rsnd_src_set_route_if_gen1(priv, mod, rdai, io);
if (ret < 0)
return ret;
@@ -310,9 +296,6 @@ static int rsnd_scu_stop(struct rsnd_mod *mod,
struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
- if (!rsnd_scu_hpbif_is_enable(mod))
- return 0;
-
rsnd_scu_transfer_stop(priv, mod, rdai, io);
clk_disable(scu->clk);
@@ -326,6 +309,10 @@ static struct rsnd_mod_ops rsnd_scu_ops = {
.stop = rsnd_scu_stop,
};
+static struct rsnd_mod_ops rsnd_scu_non_ops = {
+ .name = "scu (non)",
+};
+
struct rsnd_mod *rsnd_scu_mod_get(struct rsnd_priv *priv, int id)
{
if (WARN_ON(id < 0 || id >= rsnd_scu_nr(priv)))
@@ -340,6 +327,7 @@ int rsnd_scu_probe(struct platform_device *pdev,
{
struct device *dev = rsnd_priv_to_dev(priv);
struct rsnd_scu *scu;
+ struct rsnd_mod_ops *ops;
struct clk *clk;
char name[RSND_SCU_NAME_SIZE];
int i, nr;
@@ -364,11 +352,15 @@ int rsnd_scu_probe(struct platform_device *pdev,
if (IS_ERR(clk))
return PTR_ERR(clk);
- rsnd_mod_init(priv, &scu->mod,
- &rsnd_scu_ops, i);
scu->info = &info->scu_info[i];
scu->clk = clk;
+ ops = &rsnd_scu_non_ops;
+ if (rsnd_scu_hpbif_is_enable(&scu->mod))
+ ops = &rsnd_scu_ops;
+
+ rsnd_mod_init(priv, &scu->mod, ops, i);
+
dev_dbg(dev, "SCU%d probed\n", i);
}
dev_dbg(dev, "scu probed\n");