diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2011-05-23 07:46:23 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-05-24 06:41:40 -0400 |
commit | 1ddddd36353c40fbf8faad955fcc26e05f656121 (patch) | |
tree | 4b2c9d0099d9f08a7f7f1a7de99ee2fd849c9ff1 /sound | |
parent | 4f56cde17e3373219b56d2e9a91dbcd0ad228af7 (diff) |
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>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/sh/fsi.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c index 83f6fdce75ee..643d256e13c8 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, | |||
654 | pm_runtime_put_sync(dev); | 654 | pm_runtime_put_sync(dev); |
655 | } | 655 | } |
656 | 656 | ||
657 | #define fsi_port_start(f) __fsi_port_clk_ctrl(f, 1) | 657 | #define fsi_port_start(f, i) __fsi_port_clk_ctrl(f, i, 1) |
658 | #define fsi_port_stop(f) __fsi_port_clk_ctrl(f, 0) | 658 | #define fsi_port_stop(f, i) __fsi_port_clk_ctrl(f, i, 0) |
659 | static void __fsi_port_clk_ctrl(struct fsi_priv *fsi, int enable) | 659 | static void __fsi_port_clk_ctrl(struct fsi_priv *fsi, int is_play, int enable) |
660 | { | 660 | { |
661 | struct fsi_master *master = fsi_get_master(fsi); | 661 | struct fsi_master *master = fsi_get_master(fsi); |
662 | u32 soft = fsi_is_port_a(fsi) ? PASR : PBSR; | 662 | u32 soft = fsi_is_port_a(fsi) ? PASR : PBSR; |
663 | u32 clk = fsi_is_port_a(fsi) ? CRA : CRB; | 663 | u32 clk = fsi_is_port_a(fsi) ? CRA : CRB; |
664 | int is_master = fsi_is_clk_master(fsi); | 664 | int is_master = fsi_is_clk_master(fsi); |
665 | 665 | ||
666 | if (enable) | ||
667 | fsi_irq_enable(fsi, is_play); | ||
668 | else | ||
669 | fsi_irq_disable(fsi, is_play); | ||
670 | |||
666 | fsi_master_mask_set(master, SOFT_RST, soft, (enable) ? soft : 0); | 671 | fsi_master_mask_set(master, SOFT_RST, soft, (enable) ? soft : 0); |
667 | if (is_master) | 672 | if (is_master) |
668 | fsi_master_mask_set(master, CLK_RST, clk, (enable) ? clk : 0); | 673 | 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 | struct snd_soc_dai *dai) | 906 | struct snd_soc_dai *dai) |
902 | { | 907 | { |
903 | struct fsi_priv *fsi = fsi_get_priv(substream); | 908 | struct fsi_priv *fsi = fsi_get_priv(substream); |
904 | int is_play = fsi_is_play(substream); | ||
905 | |||
906 | fsi_irq_disable(fsi, is_play); | ||
907 | 909 | ||
908 | if (fsi_is_clk_master(fsi)) | 910 | if (fsi_is_clk_master(fsi)) |
909 | fsi_set_master_clk(dai->dev, fsi, fsi->rate, 0); | 911 | 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 | case SNDRV_PCM_TRIGGER_START: | 926 | case SNDRV_PCM_TRIGGER_START: |
925 | fsi_stream_push(fsi, is_play, substream); | 927 | fsi_stream_push(fsi, is_play, substream); |
926 | ret = is_play ? fsi_data_push(fsi) : fsi_data_pop(fsi); | 928 | ret = is_play ? fsi_data_push(fsi) : fsi_data_pop(fsi); |
927 | fsi_irq_enable(fsi, is_play); | 929 | fsi_port_start(fsi, is_play); |
928 | fsi_port_start(fsi); | ||
929 | break; | 930 | break; |
930 | case SNDRV_PCM_TRIGGER_STOP: | 931 | case SNDRV_PCM_TRIGGER_STOP: |
931 | fsi_port_stop(fsi); | 932 | fsi_port_stop(fsi, is_play); |
932 | fsi_irq_disable(fsi, is_play); | ||
933 | fsi_stream_pop(fsi, is_play); | 933 | fsi_stream_pop(fsi, is_play); |
934 | break; | 934 | break; |
935 | } | 935 | } |