bcm27xx: update 6.1 patches from RPi foundation
[openwrt/staging/stintel.git] / target / linux / bcm27xx / patches-6.1 / 950-1268-ASoC-DACplusADCPro-fix-16bit-sample-support-in-clock.patch
1 From ba86793796525f8276fafbaf9d31d5156a2cfcb5 Mon Sep 17 00:00:00 2001
2 From: Joerg Schambacher <joerg@hifiberry.com>
3 Date: Fri, 2 Feb 2024 08:51:06 +0100
4 Subject: [PATCH 1268/1295] ASoC: DACplusADCPro - fix 16bit sample support in
5 clock consumer mode
6
7 The former code did not adjust the physical sample width when in
8 clock consumer mode and has taken the fixed 32 bit default. This
9 has caused the audio to be played at half its frequency due to
10 the fixed bclk_ratio of 64.
11
12 Problem appears only on PI5 as on the former PIs the I2S module
13 did simply run at fixed 64x rate.
14
15 Signed-off-by: Joerg Schambacher <joerg@hifiberry.com>
16 ---
17 sound/soc/bcm/hifiberry_dacplusadcpro.c | 4 +---
18 1 file changed, 1 insertion(+), 3 deletions(-)
19
20 --- a/sound/soc/bcm/hifiberry_dacplusadcpro.c
21 +++ b/sound/soc/bcm/hifiberry_dacplusadcpro.c
22 @@ -383,15 +383,13 @@ static int snd_rpi_hifiberry_dacplusadcp
23 int ret = 0;
24 struct snd_soc_pcm_runtime *rtd = substream->private_data;
25 int channels = params_channels(params);
26 - int width = 32;
27 + int width = snd_pcm_format_physical_width(params_format(params));
28 struct snd_soc_component *dac = asoc_rtd_to_codec(rtd, 0)->component;
29 struct snd_soc_dai *dai = asoc_rtd_to_codec(rtd, 0);
30 struct snd_soc_dai_driver *drv = dai->driver;
31 const struct snd_soc_dai_ops *ops = drv->ops;
32
33 if (snd_rpi_hifiberry_is_dacpro) {
34 - width = snd_pcm_format_physical_width(params_format(params));
35 -
36 snd_rpi_hifiberry_dacplusadcpro_set_sclk(dac,
37 params_rate(params));
38