Commit 1ddddd36 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: sh: fsi: irq control moves to fsi_port_start/stop

Using fsi_irq_enable/disable in fsi_port_start/stop is very natural.
This patch is preparation of cleanup suspend/resume patch.
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: default avatarLiam Girdwood <lrg@ti.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 4f56cde1
...@@ -654,15 +654,20 @@ static void __fsi_module_clk_ctrl(struct fsi_master *master, ...@@ -654,15 +654,20 @@ static void __fsi_module_clk_ctrl(struct fsi_master *master,
pm_runtime_put_sync(dev); pm_runtime_put_sync(dev);
} }
#define fsi_port_start(f) __fsi_port_clk_ctrl(f, 1) #define fsi_port_start(f, i) __fsi_port_clk_ctrl(f, i, 1)
#define fsi_port_stop(f) __fsi_port_clk_ctrl(f, 0) #define fsi_port_stop(f, i) __fsi_port_clk_ctrl(f, i, 0)
static void __fsi_port_clk_ctrl(struct fsi_priv *fsi, int enable) static void __fsi_port_clk_ctrl(struct fsi_priv *fsi, int is_play, int enable)
{ {
struct fsi_master *master = fsi_get_master(fsi); struct fsi_master *master = fsi_get_master(fsi);
u32 soft = fsi_is_port_a(fsi) ? PASR : PBSR; u32 soft = fsi_is_port_a(fsi) ? PASR : PBSR;
u32 clk = fsi_is_port_a(fsi) ? CRA : CRB; u32 clk = fsi_is_port_a(fsi) ? CRA : CRB;
int is_master = fsi_is_clk_master(fsi); int is_master = fsi_is_clk_master(fsi);
if (enable)
fsi_irq_enable(fsi, is_play);
else
fsi_irq_disable(fsi, is_play);
fsi_master_mask_set(master, SOFT_RST, soft, (enable) ? soft : 0); fsi_master_mask_set(master, SOFT_RST, soft, (enable) ? soft : 0);
if (is_master) if (is_master)
fsi_master_mask_set(master, CLK_RST, clk, (enable) ? clk : 0); fsi_master_mask_set(master, CLK_RST, clk, (enable) ? clk : 0);
...@@ -901,9 +906,6 @@ static void fsi_dai_shutdown(struct snd_pcm_substream *substream, ...@@ -901,9 +906,6 @@ static void fsi_dai_shutdown(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai) struct snd_soc_dai *dai)
{ {
struct fsi_priv *fsi = fsi_get_priv(substream); struct fsi_priv *fsi = fsi_get_priv(substream);
int is_play = fsi_is_play(substream);
fsi_irq_disable(fsi, is_play);
if (fsi_is_clk_master(fsi)) if (fsi_is_clk_master(fsi))
fsi_set_master_clk(dai->dev, fsi, fsi->rate, 0); fsi_set_master_clk(dai->dev, fsi, fsi->rate, 0);
...@@ -924,12 +926,10 @@ static int fsi_dai_trigger(struct snd_pcm_substream *substream, int cmd, ...@@ -924,12 +926,10 @@ static int fsi_dai_trigger(struct snd_pcm_substream *substream, int cmd,
case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_START:
fsi_stream_push(fsi, is_play, substream); fsi_stream_push(fsi, is_play, substream);
ret = is_play ? fsi_data_push(fsi) : fsi_data_pop(fsi); ret = is_play ? fsi_data_push(fsi) : fsi_data_pop(fsi);
fsi_irq_enable(fsi, is_play); fsi_port_start(fsi, is_play);
fsi_port_start(fsi);
break; break;
case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_STOP:
fsi_port_stop(fsi); fsi_port_stop(fsi, is_play);
fsi_irq_disable(fsi, is_play);
fsi_stream_pop(fsi, is_play); fsi_stream_pop(fsi, is_play);
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment