summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorMichael Sit Wei Hong <michael.wei.hong.sit@intel.com>2020-07-30 13:53:17 +0800
committerMark Brown <broonie@kernel.org>2020-07-30 20:13:41 +0100
commitd13389849caf05d79141d317bdf2f6b318e65f87 (patch)
tree77f667d9e15c23f26b87d6b424903b51e5e05fc5 /sound
parentb81f8df8039e6dca8f9533fe0b549139b907e61f (diff)
downloadlinux-d13389849caf05d79141d317bdf2f6b318e65f87.tar.bz2
ASoC: Intel: KMB: Rework disable channel function
All channels are enabled at boot up, this patch ensures that all channels are disabled at boot and whenever the function is called. Signed-off-by: Michael Sit Wei Hong <michael.wei.hong.sit@intel.com> Reviewed-by: Sia Jee Heng <jee.heng.sia@intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200730055319.1522-3-michael.wei.hong.sit@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/intel/keembay/kmb_platform.c10
-rw-r--r--sound/soc/intel/keembay/kmb_platform.h1
2 files changed, 8 insertions, 3 deletions
diff --git a/sound/soc/intel/keembay/kmb_platform.c b/sound/soc/intel/keembay/kmb_platform.c
index dcc5ac561545..16f9fc4c663d 100644
--- a/sound/soc/intel/keembay/kmb_platform.c
+++ b/sound/soc/intel/keembay/kmb_platform.c
@@ -109,14 +109,14 @@ static unsigned int kmb_pcm_rx_fn(struct kmb_i2s_info *kmb_i2s,
static inline void kmb_i2s_disable_channels(struct kmb_i2s_info *kmb_i2s,
u32 stream)
{
- struct i2s_clk_config_data *config = &kmb_i2s->config;
u32 i;
+ /* Disable all channels regardless of configuration*/
if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
- for (i = 0; i < config->chan_nr / 2; i++)
+ for (i = 0; i < MAX_ISR; i++)
writel(0, kmb_i2s->i2s_base + TER(i));
} else {
- for (i = 0; i < config->chan_nr / 2; i++)
+ for (i = 0; i < MAX_ISR; i++)
writel(0, kmb_i2s->i2s_base + RER(i));
}
}
@@ -637,6 +637,10 @@ static int kmb_plat_dai_probe(struct platform_device *pdev)
return ret;
}
+ /* To ensure none of the channels are enabled at boot up */
+ kmb_i2s_disable_channels(kmb_i2s, SNDRV_PCM_STREAM_PLAYBACK);
+ kmb_i2s_disable_channels(kmb_i2s, SNDRV_PCM_STREAM_CAPTURE);
+
dev_set_drvdata(dev, kmb_i2s);
return ret;
diff --git a/sound/soc/intel/keembay/kmb_platform.h b/sound/soc/intel/keembay/kmb_platform.h
index 6bf221aa8fff..9756b132c12f 100644
--- a/sound/soc/intel/keembay/kmb_platform.h
+++ b/sound/soc/intel/keembay/kmb_platform.h
@@ -90,6 +90,7 @@
#define MAX_CHANNEL_NUM 8
#define MIN_CHANNEL_NUM 2
+#define MAX_ISR 4
#define TWO_CHANNEL_SUPPORT 2 /* up to 2.0 */
#define FOUR_CHANNEL_SUPPORT 4 /* up to 3.1 */