Skip to content

Commit 5a19c7f

Browse files
zywang33rkhuangtao
authored andcommitted
ASoC: es8328: Enabling support for 12Mhz sysclk
Change-Id: If9dea6039ab562023c81c2394c9286b7adc4a8c5 Signed-off-by: Chris Zhong <zyw@rock-chips.com>
1 parent fb0938d commit 5a19c7f

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

sound/soc/codecs/es8328.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,16 @@ static const struct snd_pcm_hw_constraint_list constraints_12288 = {
3939
.list = rates_12288,
4040
};
4141

42+
static unsigned int ratios_12000[] = {
43+
8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000,
44+
48000, 88235, 96000,
45+
};
46+
47+
static struct snd_pcm_hw_constraint_list constraints_12000 = {
48+
.count = ARRAY_SIZE(ratios_12000),
49+
.list = ratios_12000,
50+
};
51+
4252
static const unsigned int rates_11289[] = {
4353
8018, 11025, 22050, 44100, 88200,
4454
};
@@ -578,6 +588,14 @@ static int es8328_set_sysclk(struct snd_soc_dai *codec_dai,
578588
es8328->sysclk_constraints = &constraints_12288;
579589
es8328->mclk_ratios = ratios_12288;
580590
break;
591+
592+
case 24000000:
593+
mclkdiv2 = 1;
594+
/* fallthru */
595+
case 12000000:
596+
es8328->sysclk_constraints = &constraints_12000;
597+
es8328->mclk_ratios = ratios_12000;
598+
break;
581599
default:
582600
return -EINVAL;
583601
}

0 commit comments

Comments
 (0)