Skip to content

Commit cd0774f

Browse files
morimotoDinh Nguyen
authored andcommitted
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 <[email protected]> Tested-by: Keita Kobayashi <[email protected]> Tested by: Cao Minh Hiep <[email protected]> Signed-off-by: Mark Brown <[email protected]> (cherry picked from commit 5626ad0) Signed-off-by: Simon Horman <[email protected]>
1 parent c0aaddf commit cd0774f

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

sound/soc/sh/rcar/core.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ void rsnd_dai_pointer_update(struct rsnd_dai_stream *io, int byte)
315315
}
316316
}
317317

318-
static int rsnd_dai_stream_init(struct rsnd_dai_stream *io,
318+
static void rsnd_dai_stream_init(struct rsnd_dai_stream *io,
319319
struct snd_pcm_substream *substream)
320320
{
321321
struct snd_pcm_runtime *runtime = substream->runtime;
@@ -327,8 +327,11 @@ static int rsnd_dai_stream_init(struct rsnd_dai_stream *io,
327327
runtime->channels *
328328
samples_to_bytes(runtime, 1);
329329
io->next_period_byte = io->byte_per_period;
330+
}
330331

331-
return 0;
332+
static void rsnd_dai_stream_quit(struct rsnd_dai_stream *io)
333+
{
334+
io->substream = NULL;
332335
}
333336

334337
static
@@ -363,9 +366,7 @@ static int rsnd_soc_dai_trigger(struct snd_pcm_substream *substream, int cmd,
363366

364367
switch (cmd) {
365368
case SNDRV_PCM_TRIGGER_START:
366-
ret = rsnd_dai_stream_init(io, substream);
367-
if (ret < 0)
368-
goto dai_trigger_end;
369+
rsnd_dai_stream_init(io, substream);
369370

370371
ret = rsnd_platform_call(priv, dai, start, ssi_id);
371372
if (ret < 0)
@@ -391,6 +392,8 @@ static int rsnd_soc_dai_trigger(struct snd_pcm_substream *substream, int cmd,
391392
ret = rsnd_platform_call(priv, dai, stop, ssi_id);
392393
if (ret < 0)
393394
goto dai_trigger_end;
395+
396+
rsnd_dai_stream_quit(io);
394397
break;
395398
default:
396399
ret = -EINVAL;

0 commit comments

Comments
 (0)