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: 96c3bb0023
("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>
This commit is contained in:
parent
5b4458ebb4
commit
40b3713628
1 changed files with 6 additions and 3 deletions
|
@ -665,7 +665,7 @@ static int aic32x4_set_processing_blocks(struct snd_soc_component *component,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int aic32x4_setup_clocks(struct snd_soc_component *component,
|
static int aic32x4_setup_clocks(struct snd_soc_component *component,
|
||||||
unsigned int sample_rate)
|
unsigned int sample_rate, unsigned int channels)
|
||||||
{
|
{
|
||||||
u8 aosr;
|
u8 aosr;
|
||||||
u16 dosr;
|
u16 dosr;
|
||||||
|
@ -753,7 +753,9 @@ static int aic32x4_setup_clocks(struct snd_soc_component *component,
|
||||||
dosr);
|
dosr);
|
||||||
|
|
||||||
clk_set_rate(clocks[5].clk,
|
clk_set_rate(clocks[5].clk,
|
||||||
sample_rate * 32);
|
sample_rate * 32 *
|
||||||
|
channels);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -775,7 +777,8 @@ static int aic32x4_hw_params(struct snd_pcm_substream *substream,
|
||||||
u8 iface1_reg = 0;
|
u8 iface1_reg = 0;
|
||||||
u8 dacsetup_reg = 0;
|
u8 dacsetup_reg = 0;
|
||||||
|
|
||||||
aic32x4_setup_clocks(component, params_rate(params));
|
aic32x4_setup_clocks(component, params_rate(params),
|
||||||
|
params_channels(params));
|
||||||
|
|
||||||
switch (params_width(params)) {
|
switch (params_width(params)) {
|
||||||
case 16:
|
case 16:
|
||||||
|
|
Loading…
Add table
Reference in a new issue