Skip to content

Commit

Permalink
ASoC: sh: fsi: call fsi_hw_startup/shutdown from fsi_dai_trigger()
Browse files Browse the repository at this point in the history
fsi_hw_startup/shutdown() needs the setup of bus width,
but it is impossible to get parameter of snd_pcm_runtime at this timing.
So, these functions are changed so that be called from fsi_dai_trigger().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Kuninori Morimoto authored and Mark Brown committed May 19, 2012
1 parent 9c59dd3 commit f33238e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions sound/soc/sh/fsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1232,15 +1232,16 @@ static int fsi_dai_startup(struct snd_pcm_substream *substream,
{
struct fsi_priv *fsi = fsi_get_priv(substream);

return fsi_hw_startup(fsi, fsi_stream_get(fsi, substream), dai->dev);
fsi->rate = 0;

return 0;
}

static void fsi_dai_shutdown(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
struct fsi_priv *fsi = fsi_get_priv(substream);

fsi_hw_shutdown(fsi, dai->dev);
fsi->rate = 0;
}

Expand All @@ -1254,11 +1255,13 @@ static int fsi_dai_trigger(struct snd_pcm_substream *substream, int cmd,
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
fsi_stream_init(fsi, io, substream);
fsi_hw_startup(fsi, io, dai->dev);
ret = fsi_stream_transfer(io);
if (0 == ret)
fsi_stream_start(fsi, io);
break;
case SNDRV_PCM_TRIGGER_STOP:
fsi_hw_shutdown(fsi, dai->dev);
fsi_stream_stop(fsi, io);
fsi_stream_quit(fsi, io);
break;
Expand Down

0 comments on commit f33238e

Please sign in to comment.