Skip to content

Commit 39473c2

Browse files
committed
Merge series "ASoC: Intel: KMB: TDM Enablement patches" from Michael Sit Wei Hong <[email protected]>:
This patch series is to enable multiple features on the Keembay Platform Michael Sit Wei Hong (4): ASoC: Intel: KMB: Add 8kHz audio support ASoC: Intel: KMB: Rework disable channel function ASoC: Intel: KMB: Enable TDM audio capture dt-bindings: sound: intel,keembay-i2s: Add channel-max property .../bindings/sound/intel,keembay-i2s.yaml | 8 + sound/soc/intel/keembay/kmb_platform.c | 137 +++++++++++++----- sound/soc/intel/keembay/kmb_platform.h | 1 + 3 files changed, 112 insertions(+), 34 deletions(-) -- 2.17.1
2 parents 3d026a8 + d133898 commit 39473c2

File tree

2 files changed

+24
-9
lines changed

2 files changed

+24
-9
lines changed

sound/soc/intel/keembay/kmb_platform.c

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ static const struct snd_pcm_hardware kmb_pcm_hardware = {
2828
SNDRV_PCM_INFO_MMAP_VALID |
2929
SNDRV_PCM_INFO_BATCH |
3030
SNDRV_PCM_INFO_BLOCK_TRANSFER,
31-
.rates = SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_48000,
32-
.rate_min = 16000,
31+
.rates = SNDRV_PCM_RATE_8000 |
32+
SNDRV_PCM_RATE_16000 |
33+
SNDRV_PCM_RATE_48000,
34+
.rate_min = 8000,
3335
.rate_max = 48000,
3436
.formats = SNDRV_PCM_FMTBIT_S16_LE |
3537
SNDRV_PCM_FMTBIT_S24_LE |
@@ -107,14 +109,14 @@ static unsigned int kmb_pcm_rx_fn(struct kmb_i2s_info *kmb_i2s,
107109
static inline void kmb_i2s_disable_channels(struct kmb_i2s_info *kmb_i2s,
108110
u32 stream)
109111
{
110-
struct i2s_clk_config_data *config = &kmb_i2s->config;
111112
u32 i;
112113

114+
/* Disable all channels regardless of configuration*/
113115
if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
114-
for (i = 0; i < config->chan_nr / 2; i++)
116+
for (i = 0; i < MAX_ISR; i++)
115117
writel(0, kmb_i2s->i2s_base + TER(i));
116118
} else {
117-
for (i = 0; i < config->chan_nr / 2; i++)
119+
for (i = 0; i < MAX_ISR; i++)
118120
writel(0, kmb_i2s->i2s_base + RER(i));
119121
}
120122
}
@@ -533,8 +535,10 @@ static struct snd_soc_dai_driver intel_kmb_platform_dai[] = {
533535
.playback = {
534536
.channels_min = 2,
535537
.channels_max = 2,
536-
.rates = SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_48000,
537-
.rate_min = 16000,
538+
.rates = SNDRV_PCM_RATE_8000 |
539+
SNDRV_PCM_RATE_16000 |
540+
SNDRV_PCM_RATE_48000,
541+
.rate_min = 8000,
538542
.rate_max = 48000,
539543
.formats = (SNDRV_PCM_FMTBIT_S32_LE |
540544
SNDRV_PCM_FMTBIT_S24_LE |
@@ -543,8 +547,14 @@ static struct snd_soc_dai_driver intel_kmb_platform_dai[] = {
543547
.capture = {
544548
.channels_min = 2,
545549
.channels_max = 2,
546-
.rates = SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_48000,
547-
.rate_min = 16000,
550+
/*
551+
* .channels_max will be overwritten
552+
* if provided by Device Tree
553+
*/
554+
.rates = SNDRV_PCM_RATE_8000 |
555+
SNDRV_PCM_RATE_16000 |
556+
SNDRV_PCM_RATE_48000,
557+
.rate_min = 8000,
548558
.rate_max = 48000,
549559
.formats = (SNDRV_PCM_FMTBIT_S32_LE |
550560
SNDRV_PCM_FMTBIT_S24_LE |
@@ -627,6 +637,10 @@ static int kmb_plat_dai_probe(struct platform_device *pdev)
627637
return ret;
628638
}
629639

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+
630644
dev_set_drvdata(dev, kmb_i2s);
631645

632646
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)