099dc606114e1f9f64d5c0ddf2e5e7f290a28dc2
[openwrt/staging/dedeckeh.git] /
1 From: Brian Norris <computersforpeace@gmail.com>
2 Date: Thu, 15 Dec 2022 01:33:45 -0800
3 Subject: [PATCH] ASoC: qcom: lpass-cpu: Fix fallback SD line index handling
4
5 [[ Submitted upstream as:
6 https://lore.kernel.org/all/20221231061545.2110253-1-computersforpeace@gmail.com/
7 Currently queued for -next (v6.3?) as:
8 000bca8d706d ASoC: qcom: lpass-cpu: Fix fallback SD line index handling
9 ]]
10
11 These indices should reference the ID placed within the dai_driver
12 array, not the indices of the array itself.
13
14 This fixes commit 4ff028f6c108 ("ASoC: qcom: lpass-cpu: Make I2S SD
15 lines configurable"), which among others, broke IPQ8064 audio
16 (sound/soc/qcom/lpass-ipq806x.c) because it uses ID 4 but we'd stop
17 initializing the mi2s_playback_sd_mode and mi2s_capture_sd_mode arrays
18 at ID 0.
19
20 Fixes: 4ff028f6c108 ("ASoC: qcom: lpass-cpu: Make I2S SD lines configurable")
21 Cc: <stable@vger.kernel.org>
22 Signed-off-by: Brian Norris <computersforpeace@gmail.com>
23 ---
24 sound/soc/qcom/lpass-cpu.c | 5 +++--
25 1 file changed, 3 insertions(+), 2 deletions(-)
26
27 --- a/sound/soc/qcom/lpass-cpu.c
28 +++ b/sound/soc/qcom/lpass-cpu.c
29 @@ -851,10 +851,11 @@ static void of_lpass_cpu_parse_dai_data(
30 struct lpass_data *data)
31 {
32 struct device_node *node;
33 - int ret, id;
34 + int ret, i, id;
35
36 /* Allow all channels by default for backwards compatibility */
37 - for (id = 0; id < data->variant->num_dai; id++) {
38 + for (i = 0; i < data->variant->num_dai; i++) {
39 + id = data->variant->dai_driver[i].id;
40 data->mi2s_playback_sd_mode[id] = LPAIF_I2SCTL_MODE_8CH;
41 data->mi2s_capture_sd_mode[id] = LPAIF_I2SCTL_MODE_8CH;
42 }