Skip to content

Commit d133898

Browse files
michaelsit-iotgbroonie
authored andcommitted
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 <[email protected]> Reviewed-by: Sia Jee Heng <[email protected]> Reviewed-by: Pierre-Louis Bossart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent b81f8df commit d133898

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

sound/soc/intel/keembay/kmb_platform.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,14 @@ static unsigned int kmb_pcm_rx_fn(struct kmb_i2s_info *kmb_i2s,
109109
static inline void kmb_i2s_disable_channels(struct kmb_i2s_info *kmb_i2s,
110110
u32 stream)
111111
{
112-
struct i2s_clk_config_data *config = &kmb_i2s->config;
113112
u32 i;
114113

114+
/* Disable all channels regardless of configuration*/
115115
if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
116-
for (i = 0; i < config->chan_nr / 2; i++)
116+
for (i = 0; i < MAX_ISR; i++)
117117
writel(0, kmb_i2s->i2s_base + TER(i));
118118
} else {
119-
for (i = 0; i < config->chan_nr / 2; i++)
119+
for (i = 0; i < MAX_ISR; i++)
120120
writel(0, kmb_i2s->i2s_base + RER(i));
121121
}
122122
}
@@ -637,6 +637,10 @@ static int kmb_plat_dai_probe(struct platform_device *pdev)
637637
return ret;
638638
}
639639

640+
/* To ensure none of the channels are enabled at boot up */
641+
kmb_i2s_disable_channels(kmb_i2s, SNDRV_PCM_STREAM_PLAYBACK);
642+
kmb_i2s_disable_channels(kmb_i2s, SNDRV_PCM_STREAM_CAPTURE);
643+
640644
dev_set_drvdata(dev, kmb_i2s);
641645

642646
return ret;

sound/soc/intel/keembay/kmb_platform.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090

9191
#define MAX_CHANNEL_NUM 8
9292
#define MIN_CHANNEL_NUM 2
93+
#define MAX_ISR 4
9394

9495
#define TWO_CHANNEL_SUPPORT 2 /* up to 2.0 */
9596
#define FOUR_CHANNEL_SUPPORT 4 /* up to 3.1 */

0 commit comments

Comments
 (0)