diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2014-01-23 21:38:33 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-02-03 07:41:15 -0500 |
commit | a204d90c91208d9b63ba309a1c44f582751e58c9 (patch) | |
tree | 033627d411637bb74a5f1b5d27a7520b99f71369 /sound/soc/sh/rcar/scu.c | |
parent | 013f38fe260af6f505ad5da5f6b0db3e42ca1fbb (diff) |
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: 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.c | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/sound/soc/sh/rcar/scu.c b/sound/soc/sh/rcar/scu.c index ab5f1d21731e..e1e08738b9d4 100644 --- a/sound/soc/sh/rcar/scu.c +++ b/sound/soc/sh/rcar/scu.c | |||
@@ -264,7 +264,7 @@ bool rsnd_scu_hpbif_is_enable(struct rsnd_mod *mod) | |||
264 | return !!(flags & RSND_SCU_USE_HPBIF); | 264 | return !!(flags & RSND_SCU_USE_HPBIF); |
265 | } | 265 | } |
266 | 266 | ||
267 | static int rsnd_scu_start(struct rsnd_mod *mod, | 267 | static int rsnd_scu_init(struct rsnd_mod *mod, |
268 | struct rsnd_dai *rdai, | 268 | struct rsnd_dai *rdai, |
269 | struct rsnd_dai_stream *io) | 269 | struct rsnd_dai_stream *io) |
270 | { | 270 | { |
@@ -282,13 +282,30 @@ static int rsnd_scu_start(struct rsnd_mod *mod, | |||
282 | if (ret < 0) | 282 | if (ret < 0) |
283 | return ret; | 283 | return ret; |
284 | 284 | ||
285 | ret = rsnd_scu_transfer_start(priv, mod, rdai, io); | 285 | return 0; |
286 | if (ret < 0) | 286 | } |
287 | return ret; | 287 | |
288 | static int rsnd_scu_quit(struct rsnd_mod *mod, | ||
289 | struct rsnd_dai *rdai, | ||
290 | struct rsnd_dai_stream *io) | ||
291 | { | ||
292 | struct rsnd_scu *scu = rsnd_mod_to_scu(mod); | ||
293 | |||
294 | clk_disable(scu->clk); | ||
288 | 295 | ||
289 | return 0; | 296 | return 0; |
290 | } | 297 | } |
291 | 298 | ||
299 | static int rsnd_scu_start(struct rsnd_mod *mod, | ||
300 | struct rsnd_dai *rdai, | ||
301 | struct rsnd_dai_stream *io) | ||
302 | { | ||
303 | struct rsnd_priv *priv = rsnd_mod_to_priv(mod); | ||
304 | struct rsnd_scu *scu = rsnd_mod_to_scu(mod); | ||
305 | |||
306 | return rsnd_scu_transfer_start(priv, mod, rdai, io); | ||
307 | } | ||
308 | |||
292 | static int rsnd_scu_stop(struct rsnd_mod *mod, | 309 | static int rsnd_scu_stop(struct rsnd_mod *mod, |
293 | struct rsnd_dai *rdai, | 310 | struct rsnd_dai *rdai, |
294 | struct rsnd_dai_stream *io) | 311 | struct rsnd_dai_stream *io) |
@@ -298,13 +315,13 @@ static int rsnd_scu_stop(struct rsnd_mod *mod, | |||
298 | 315 | ||
299 | rsnd_scu_transfer_stop(priv, mod, rdai, io); | 316 | rsnd_scu_transfer_stop(priv, mod, rdai, io); |
300 | 317 | ||
301 | clk_disable(scu->clk); | ||
302 | |||
303 | return 0; | 318 | return 0; |
304 | } | 319 | } |
305 | 320 | ||
306 | static struct rsnd_mod_ops rsnd_scu_ops = { | 321 | static struct rsnd_mod_ops rsnd_scu_ops = { |
307 | .name = "scu", | 322 | .name = "scu", |
323 | .init = rsnd_scu_init, | ||
324 | .quit = rsnd_scu_quit, | ||
308 | .start = rsnd_scu_start, | 325 | .start = rsnd_scu_start, |
309 | .stop = rsnd_scu_stop, | 326 | .stop = rsnd_scu_stop, |
310 | }; | 327 | }; |