Skip to content

Commit 40b3713

Browse files
miquelraynalbroonie
authored andcommitted
ASoC: tlv320aic32x4: Fix bdiv clock rate derivation
Current code expects a single channel to be always used. Fix this situation by forwarding the number of channels used. Then fix the derivation of the bdiv clock rate. Fixes: 96c3bb0 ("ASoC: tlv320aic32x4: Dynamically Determine Clocking") Suggested-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/r/20200911173140.29984-3-miquel.raynal@bootlin.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 5b4458e commit 40b3713

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

sound/soc/codecs/tlv320aic32x4.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ static int aic32x4_set_processing_blocks(struct snd_soc_component *component,
665665
}
666666

667667
static int aic32x4_setup_clocks(struct snd_soc_component *component,
668-
unsigned int sample_rate)
668+
unsigned int sample_rate, unsigned int channels)
669669
{
670670
u8 aosr;
671671
u16 dosr;
@@ -753,7 +753,9 @@ static int aic32x4_setup_clocks(struct snd_soc_component *component,
753753
dosr);
754754

755755
clk_set_rate(clocks[5].clk,
756-
sample_rate * 32);
756+
sample_rate * 32 *
757+
channels);
758+
757759
return 0;
758760
}
759761
}
@@ -775,7 +777,8 @@ static int aic32x4_hw_params(struct snd_pcm_substream *substream,
775777
u8 iface1_reg = 0;
776778
u8 dacsetup_reg = 0;
777779

778-
aic32x4_setup_clocks(component, params_rate(params));
780+
aic32x4_setup_clocks(component, params_rate(params),
781+
params_channels(params));
779782

780783
switch (params_width(params)) {
781784
case 16:

0 commit comments

Comments
 (0)