summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorJose Abreu <Jose.Abreu@synopsys.com>2016-04-05 18:08:02 +0100
committerMark Brown <broonie@kernel.org>2016-04-05 11:57:54 -0700
commit613c7c4003c8338a9a638485d95de2775948295b (patch)
tree52320549b8663703f34afb7596cc61b14b73ca7d /sound
parentf55532a0c0b8bb6148f4e07853b876ef73bc69ca (diff)
downloadlinux-613c7c4003c8338a9a638485d95de2775948295b.tar.bz2
ASoC: dwc: Unmask I2S interrupts only for enabled channels
There is no need to unmask all interrupts at I2S start. This can cause performance issues in slower platforms. Unmask only the interrupts for the used channels. Signed-off-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/dwc/designware_i2s.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sound/soc/dwc/designware_i2s.c b/sound/soc/dwc/designware_i2s.c
index bff258d7bcea..3effcd1a7df8 100644
--- a/sound/soc/dwc/designware_i2s.c
+++ b/sound/soc/dwc/designware_i2s.c
@@ -147,17 +147,18 @@ static inline void i2s_clear_irqs(struct dw_i2s_dev *dev, u32 stream)
static void i2s_start(struct dw_i2s_dev *dev,
struct snd_pcm_substream *substream)
{
+ struct i2s_clk_config_data *config = &dev->config;
u32 i, irq;
i2s_write_reg(dev->i2s_base, IER, 1);
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
- for (i = 0; i < 4; i++) {
+ for (i = 0; i < (config->chan_nr / 2); i++) {
irq = i2s_read_reg(dev->i2s_base, IMR(i));
i2s_write_reg(dev->i2s_base, IMR(i), irq & ~0x30);
}
i2s_write_reg(dev->i2s_base, ITER, 1);
} else {
- for (i = 0; i < 4; i++) {
+ for (i = 0; i < (config->chan_nr / 2); i++) {
irq = i2s_read_reg(dev->i2s_base, IMR(i));
i2s_write_reg(dev->i2s_base, IMR(i), irq & ~0x03);
}