提交 f33238e9 编写于 作者: K Kuninori Morimoto 提交者: Mark Brown

ASoC: sh: fsi: call fsi_hw_startup/shutdown from fsi_dai_trigger()

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: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 9c59dd34
...@@ -1232,7 +1232,9 @@ static int fsi_dai_startup(struct snd_pcm_substream *substream, ...@@ -1232,7 +1232,9 @@ static int fsi_dai_startup(struct snd_pcm_substream *substream,
{ {
struct fsi_priv *fsi = fsi_get_priv(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, static void fsi_dai_shutdown(struct snd_pcm_substream *substream,
...@@ -1240,7 +1242,6 @@ static void fsi_dai_shutdown(struct snd_pcm_substream *substream, ...@@ -1240,7 +1242,6 @@ static void fsi_dai_shutdown(struct snd_pcm_substream *substream,
{ {
struct fsi_priv *fsi = fsi_get_priv(substream); struct fsi_priv *fsi = fsi_get_priv(substream);
fsi_hw_shutdown(fsi, dai->dev);
fsi->rate = 0; fsi->rate = 0;
} }
...@@ -1254,11 +1255,13 @@ static int fsi_dai_trigger(struct snd_pcm_substream *substream, int cmd, ...@@ -1254,11 +1255,13 @@ static int fsi_dai_trigger(struct snd_pcm_substream *substream, int cmd,
switch (cmd) { switch (cmd) {
case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_START:
fsi_stream_init(fsi, io, substream); fsi_stream_init(fsi, io, substream);
fsi_hw_startup(fsi, io, dai->dev);
ret = fsi_stream_transfer(io); ret = fsi_stream_transfer(io);
if (0 == ret) if (0 == ret)
fsi_stream_start(fsi, io); fsi_stream_start(fsi, io);
break; break;
case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_STOP:
fsi_hw_shutdown(fsi, dai->dev);
fsi_stream_stop(fsi, io); fsi_stream_stop(fsi, io);
fsi_stream_quit(fsi, io); fsi_stream_quit(fsi, io);
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册