aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/sh/rcar
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2015-05-20 23:49:54 -0400
committerMark Brown <broonie@kernel.org>2015-05-21 06:58:48 -0400
commit5626ad0866657c4758958040589b395d2a58816d (patch)
treef2df8d929ad9bf29c877db39b0729495a565c0a6 /sound/soc/sh/rcar
parentb847357979048f718aa7e218050982ec9c306285 (diff)
ASoC: rsnd: add rsnd_dai_stream_quit()
Current Renesas R-Car sound driver calls rsnd_dai_stream_init() when start, but it didn't call paired function. This patch adds rsnd_dai_stream_quit() for it. This is prepare for interrupt error status check feature support. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com> Tested by: Cao Minh Hiep <cm-hiep@jinso.co.jp> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sh/rcar')
-rw-r--r--sound/soc/sh/rcar/core.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
index 405cacdbedfb..2b7323c92994 100644
--- a/sound/soc/sh/rcar/core.c
+++ b/sound/soc/sh/rcar/core.c
@@ -315,7 +315,7 @@ void rsnd_dai_pointer_update(struct rsnd_dai_stream *io, int byte)
315 } 315 }
316} 316}
317 317
318static int rsnd_dai_stream_init(struct rsnd_dai_stream *io, 318static void rsnd_dai_stream_init(struct rsnd_dai_stream *io,
319 struct snd_pcm_substream *substream) 319 struct snd_pcm_substream *substream)
320{ 320{
321 struct snd_pcm_runtime *runtime = substream->runtime; 321 struct snd_pcm_runtime *runtime = substream->runtime;
@@ -327,8 +327,11 @@ static int rsnd_dai_stream_init(struct rsnd_dai_stream *io,
327 runtime->channels * 327 runtime->channels *
328 samples_to_bytes(runtime, 1); 328 samples_to_bytes(runtime, 1);
329 io->next_period_byte = io->byte_per_period; 329 io->next_period_byte = io->byte_per_period;
330}
330 331
331 return 0; 332static void rsnd_dai_stream_quit(struct rsnd_dai_stream *io)
333{
334 io->substream = NULL;
332} 335}
333 336
334static 337static
@@ -363,9 +366,7 @@ static int rsnd_soc_dai_trigger(struct snd_pcm_substream *substream, int cmd,
363 366
364 switch (cmd) { 367 switch (cmd) {
365 case SNDRV_PCM_TRIGGER_START: 368 case SNDRV_PCM_TRIGGER_START:
366 ret = rsnd_dai_stream_init(io, substream); 369 rsnd_dai_stream_init(io, substream);
367 if (ret < 0)
368 goto dai_trigger_end;
369 370
370 ret = rsnd_platform_call(priv, dai, start, ssi_id); 371 ret = rsnd_platform_call(priv, dai, start, ssi_id);
371 if (ret < 0) 372 if (ret < 0)
@@ -391,6 +392,8 @@ static int rsnd_soc_dai_trigger(struct snd_pcm_substream *substream, int cmd,
391 ret = rsnd_platform_call(priv, dai, stop, ssi_id); 392 ret = rsnd_platform_call(priv, dai, stop, ssi_id);
392 if (ret < 0) 393 if (ret < 0)
393 goto dai_trigger_end; 394 goto dai_trigger_end;
395
396 rsnd_dai_stream_quit(io);
394 break; 397 break;
395 default: 398 default:
396 ret = -EINVAL; 399 ret = -EINVAL;