| From 640c889570e0563c5a0e3bc7caf89bba5244d8b4 Mon Sep 17 00:00:00 2001 |
| From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> |
| Date: Mon, 23 May 2011 20:46:23 +0900 |
| Subject: 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: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> |
| Acked-by: Liam Girdwood <lrg@ti.com> |
| Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> |
| (cherry picked from commit 1ddddd36353c40fbf8faad955fcc26e05f656121) |
| |
| Signed-off-by: Simon Horman <horms@verge.net.au> |
| --- |
| sound/soc/sh/fsi.c | 20 ++++++++++---------- |
| 1 file changed, 10 insertions(+), 10 deletions(-) |
| |
| diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c |
| index 78a1631..c445e86 100644 |
| --- a/sound/soc/sh/fsi.c |
| +++ b/sound/soc/sh/fsi.c |
| @@ -654,15 +654,20 @@ static void __fsi_module_clk_ctrl(struct fsi_master *master, |
| pm_runtime_put_sync(dev); |
| } |
| |
| -#define fsi_port_start(f) __fsi_port_clk_ctrl(f, 1) |
| -#define fsi_port_stop(f) __fsi_port_clk_ctrl(f, 0) |
| -static void __fsi_port_clk_ctrl(struct fsi_priv *fsi, int enable) |
| +#define fsi_port_start(f, i) __fsi_port_clk_ctrl(f, i, 1) |
| +#define fsi_port_stop(f, i) __fsi_port_clk_ctrl(f, i, 0) |
| +static void __fsi_port_clk_ctrl(struct fsi_priv *fsi, int is_play, int enable) |
| { |
| struct fsi_master *master = fsi_get_master(fsi); |
| u32 soft = fsi_is_port_a(fsi) ? PASR : PBSR; |
| u32 clk = fsi_is_port_a(fsi) ? CRA : CRB; |
| 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); |
| if (is_master) |
| 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, |
| struct snd_soc_dai *dai) |
| { |
| 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)) |
| 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, |
| case SNDRV_PCM_TRIGGER_START: |
| fsi_stream_push(fsi, is_play, substream); |
| ret = is_play ? fsi_data_push(fsi) : fsi_data_pop(fsi); |
| - fsi_irq_enable(fsi, is_play); |
| - fsi_port_start(fsi); |
| + fsi_port_start(fsi, is_play); |
| break; |
| case SNDRV_PCM_TRIGGER_STOP: |
| - fsi_port_stop(fsi); |
| - fsi_irq_disable(fsi, is_play); |
| + fsi_port_stop(fsi, is_play); |
| fsi_stream_pop(fsi, is_play); |
| break; |
| } |
| -- |
| 1.7.10.2.565.gbd578b5 |
| |