Skip to content

Commit f55c21d

Browse files
committed
ASoC: codecs: cs42l84: set up PLL for more sample rates
Previously, this driver only advertised support for 48 kHz and 96 kHz sample rates, as there was no PLL configuration data specified for any other sample rate/BCLK. The CS42L84 is an Apple-specific variant of CS42L42. The PLL configuration parameters for a variety of common BCLKs are available in the latter's datasheet. What happens if we just use those? As it turns out, they work just fine. Fill out more PLL config parameters in the PLL config lookup table, and advertise the corresponding sample rates to userspace. This enables 44.1, 88.2, 172.6 and 192 kHz output and input. Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
1 parent 89c915d commit f55c21d

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

sound/soc/codecs/cs42l84.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,11 @@ struct cs42l84_pll_params {
357357
* Common PLL Settings for given BCLK
358358
*/
359359
static const struct cs42l84_pll_params pll_ratio_table[] = {
360+
{ 2822400, 1, 0, 0x40, 0x000000, 0x03, 0x10, 11289600},
360361
{ 3072000, 1, 0, 0x40, 0x000000, 0x03, 0x10, 12288000},
362+
{ 5644800, 1, 0, 0x40, 0x000000, 0x03, 0x10, 11289600},
361363
{ 6144000, 1, 1, 0x40, 0x000000, 0x03, 0x10, 12288000},
364+
{ 11289600, 0, 0, 0, 0, 0, 0, 11289600},
362365
{ 12288000, 0, 0, 0, 0, 0, 0, 12288000},
363366
{ 24576000, 1, 3, 0x40, 0x000000, 0x03, 0x10, 12288000},
364367
};
@@ -670,14 +673,18 @@ static struct snd_soc_dai_driver cs42l84_dai = {
670673
.stream_name = "Playback",
671674
.channels_min = 1,
672675
.channels_max = 2,
673-
.rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000,
676+
.rates = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 |
677+
SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 |
678+
SNDRV_PCM_RATE_176400 | SNDRV_PCM_RATE_192000,
674679
.formats = CS42L84_FORMATS,
675680
},
676681
.capture = {
677682
.stream_name = "Capture",
678683
.channels_min = 1,
679684
.channels_max = 1,
680-
.rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000,
685+
.rates = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 |
686+
SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 |
687+
SNDRV_PCM_RATE_176400 | SNDRV_PCM_RATE_192000,
681688
.formats = CS42L84_FORMATS,
682689
},
683690
.symmetric_rate = 1,

0 commit comments

Comments
 (0)