Commit a204d90c authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: rsnd: add rsnd_scu_init(), and separate init/start

Current scu.c has rsnd_scu_start(),
and, operation of initialization/start
are implemented in this function.
This patch adds new rsnd_scu_init() and separates
rsnd_scu_start(), since rsnd_mod_ops has .init/.start callbacks.
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 013f38fe
...@@ -264,7 +264,7 @@ bool rsnd_scu_hpbif_is_enable(struct rsnd_mod *mod) ...@@ -264,7 +264,7 @@ bool rsnd_scu_hpbif_is_enable(struct rsnd_mod *mod)
return !!(flags & RSND_SCU_USE_HPBIF); return !!(flags & RSND_SCU_USE_HPBIF);
} }
static int rsnd_scu_start(struct rsnd_mod *mod, static int rsnd_scu_init(struct rsnd_mod *mod,
struct rsnd_dai *rdai, struct rsnd_dai *rdai,
struct rsnd_dai_stream *io) struct rsnd_dai_stream *io)
{ {
...@@ -282,13 +282,30 @@ static int rsnd_scu_start(struct rsnd_mod *mod, ...@@ -282,13 +282,30 @@ static int rsnd_scu_start(struct rsnd_mod *mod,
if (ret < 0) if (ret < 0)
return ret; return ret;
ret = rsnd_scu_transfer_start(priv, mod, rdai, io); return 0;
if (ret < 0) }
return ret;
static int rsnd_scu_quit(struct rsnd_mod *mod,
struct rsnd_dai *rdai,
struct rsnd_dai_stream *io)
{
struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
clk_disable(scu->clk);
return 0; return 0;
} }
static int rsnd_scu_start(struct rsnd_mod *mod,
struct rsnd_dai *rdai,
struct rsnd_dai_stream *io)
{
struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
return rsnd_scu_transfer_start(priv, mod, rdai, io);
}
static int rsnd_scu_stop(struct rsnd_mod *mod, static int rsnd_scu_stop(struct rsnd_mod *mod,
struct rsnd_dai *rdai, struct rsnd_dai *rdai,
struct rsnd_dai_stream *io) struct rsnd_dai_stream *io)
...@@ -298,13 +315,13 @@ static int rsnd_scu_stop(struct rsnd_mod *mod, ...@@ -298,13 +315,13 @@ static int rsnd_scu_stop(struct rsnd_mod *mod,
rsnd_scu_transfer_stop(priv, mod, rdai, io); rsnd_scu_transfer_stop(priv, mod, rdai, io);
clk_disable(scu->clk);
return 0; return 0;
} }
static struct rsnd_mod_ops rsnd_scu_ops = { static struct rsnd_mod_ops rsnd_scu_ops = {
.name = "scu", .name = "scu",
.init = rsnd_scu_init,
.quit = rsnd_scu_quit,
.start = rsnd_scu_start, .start = rsnd_scu_start,
.stop = rsnd_scu_stop, .stop = rsnd_scu_stop,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment