lede/target/linux/bcm27xx/patches-6.6/950-0951-ASoC-dwc-Correct-channel-count-reporting.patch
=?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= 975ce33610 bcm27xx: pull 6.6 patches from RPi
Adds latest 6.6 patches from the Raspberry Pi repository.

These patches were generated from:
https://github.com/raspberrypi/linux/commits/rpi-6.6.y/

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2025-04-29 23:01:01 +08:00

47 lines
1.6 KiB
Diff

From 747080a2aaacfbf54f591646fbcf3bca04b268bc Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.com>
Date: Mon, 11 Mar 2024 12:23:43 +0000
Subject: [PATCH 0951/1085] ASoC: dwc: Correct channel count reporting
The DWC I2S driver treats the channel count register values as if they
encode a power of two (2, 4, 8, 16), but they actually encode a
multiple of 2 (2, 4, 6, 8).
Also improve the error message when asked for an unsupported number
of channels.
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
---
sound/soc/dwc/dwc-i2s.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/sound/soc/dwc/dwc-i2s.c
+++ b/sound/soc/dwc/dwc-i2s.c
@@ -319,7 +319,7 @@ static int dw_i2s_hw_params(struct snd_p
case TWO_CHANNEL_SUPPORT:
break;
default:
- dev_err(dev->dev, "channel not supported\n");
+ dev_err(dev->dev, "channel count %d not supported\n", config->chan_nr);
return -EINVAL;
}
@@ -707,7 +707,7 @@ static int dw_configure_dai(struct dw_i2
idx = 1;
dw_i2s_dai->playback.channels_min = MIN_CHANNEL_NUM;
dw_i2s_dai->playback.channels_max =
- 1 << (COMP1_TX_CHANNELS(comp1) + 1);
+ 2 * (COMP1_TX_CHANNELS(comp1) + 1);
dw_i2s_dai->playback.formats = formats[idx];
dw_i2s_dai->playback.rates = rates;
}
@@ -721,7 +721,7 @@ static int dw_configure_dai(struct dw_i2
idx = 1;
dw_i2s_dai->capture.channels_min = MIN_CHANNEL_NUM;
dw_i2s_dai->capture.channels_max =
- 1 << (COMP1_RX_CHANNELS(comp1) + 1);
+ 2 * (COMP1_RX_CHANNELS(comp1) + 1);
dw_i2s_dai->capture.formats = formats[idx];
dw_i2s_dai->capture.rates = rates;
}