Skip to content

Commit b2cb84d

Browse files
committed
Merge tag 'asoc-fix-v6.5-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v6.5 A lot of fixes here for the Qualcomm CODEC drivers, there was quite a bit of fragility with the SoundWire probe due to the combined DT and hotplug approach that the bus has which Johan Hovold fixed along with a bunch of other issues that came up in the process. Srivinvas Kandagatla also fixed some separate issues that have been lurking for a while in the Qualcomm AP side, and there's a good set of AMD fixes from Vijendar Mukunda too.
2 parents 69ea4c9 + e8bf174 commit b2cb84d

File tree

24 files changed

+270
-122
lines changed

24 files changed

+270
-122
lines changed

Documentation/devicetree/bindings/sound/audio-graph-card2.yaml

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -39,22 +39,4 @@ required:
3939

4040
additionalProperties: false
4141

42-
examples:
43-
- |
44-
sound {
45-
compatible = "audio-graph-card2";
46-
47-
links = <&cpu_port>;
48-
};
49-
50-
cpu {
51-
compatible = "cpu-driver";
52-
53-
cpu_port: port { cpu_ep: endpoint { remote-endpoint = <&codec_ep>; }; };
54-
};
55-
56-
codec {
57-
compatible = "codec-driver";
58-
59-
port { codec_ep: endpoint { remote-endpoint = <&cpu_ep>; }; };
60-
};
42+
...

Documentation/devicetree/bindings/sound/google,sc7180-trogdor.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
77
title: Google SC7180-Trogdor ASoC sound card driver
88

99
maintainers:
10-
- Rohit kumar <rohitkr@codeaurora.org>
10+
- Rohit kumar <quic_rohkumar@quicinc.com>
1111
- Cheng-Yi Chiang <cychiang@chromium.org>
1212

1313
description:

Documentation/devicetree/bindings/sound/qcom,lpass-cpu.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ title: Qualcomm Technologies Inc. LPASS CPU dai driver
88

99
maintainers:
1010
- Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
11-
- Rohit kumar <rohitkr@codeaurora.org>
11+
- Rohit kumar <quic_rohkumar@quicinc.com>
1212

1313
description: |
1414
Qualcomm Technologies Inc. SOC Low-Power Audio SubSystem (LPASS) that consist

MAINTAINERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1865,9 +1865,11 @@ M: Martin Povišer <povik+lin@cutebit.org>
18651865
L: asahi@lists.linux.dev
18661866
L: alsa-devel@alsa-project.org (moderated for non-subscribers)
18671867
S: Maintained
1868+
F: Documentation/devicetree/bindings/sound/adi,ssm3515.yaml
18681869
F: Documentation/devicetree/bindings/sound/apple,*
18691870
F: sound/soc/apple/*
18701871
F: sound/soc/codecs/cs42l83-i2c.c
1872+
F: sound/soc/codecs/ssm3515.c
18711873

18721874
ARM/APPLE MACHINE SUPPORT
18731875
M: Hector Martin <marcan@marcan.st>

sound/soc/amd/acp/amd.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ int snd_amd_acp_find_config(struct pci_dev *pci);
173173

174174
static inline u64 acp_get_byte_count(struct acp_dev_data *adata, int dai_id, int direction)
175175
{
176-
u64 byte_count, low = 0, high = 0;
176+
u64 byte_count = 0, low = 0, high = 0;
177177

178178
if (direction == SNDRV_PCM_STREAM_PLAYBACK) {
179179
switch (dai_id) {
@@ -191,7 +191,7 @@ static inline u64 acp_get_byte_count(struct acp_dev_data *adata, int dai_id, int
191191
break;
192192
default:
193193
dev_err(adata->dev, "Invalid dai id %x\n", dai_id);
194-
return -EINVAL;
194+
goto POINTER_RETURN_BYTES;
195195
}
196196
} else {
197197
switch (dai_id) {
@@ -213,12 +213,13 @@ static inline u64 acp_get_byte_count(struct acp_dev_data *adata, int dai_id, int
213213
break;
214214
default:
215215
dev_err(adata->dev, "Invalid dai id %x\n", dai_id);
216-
return -EINVAL;
216+
goto POINTER_RETURN_BYTES;
217217
}
218218
}
219219
/* Get 64 bit value from two 32 bit registers */
220220
byte_count = (high << 32) | low;
221221

222+
POINTER_RETURN_BYTES:
222223
return byte_count;
223224
}
224225

sound/soc/amd/ps/acp63.h

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,28 @@
116116
#define ACP63_SDW0_DMA_MAX_STREAMS 6
117117
#define ACP63_SDW1_DMA_MAX_STREAMS 2
118118
#define ACP_P1_AUDIO_TX_THRESHOLD 6
119+
120+
/*
121+
* Below entries describes SDW0 instance DMA stream id and DMA irq bit mapping
122+
* in ACP_EXTENAL_INTR_CNTL register.
123+
* Stream id IRQ Bit
124+
* 0 (SDW0_AUDIO0_TX) 28
125+
* 1 (SDW0_AUDIO1_TX) 26
126+
* 2 (SDW0_AUDIO2_TX) 24
127+
* 3 (SDW0_AUDIO0_RX) 27
128+
* 4 (SDW0_AUDIO1_RX) 25
129+
* 5 (SDW0_AUDIO2_RX) 23
130+
*/
119131
#define SDW0_DMA_TX_IRQ_MASK(i) (ACP_AUDIO0_TX_THRESHOLD - (2 * (i)))
120-
#define SDW0_DMA_RX_IRQ_MASK(i) (ACP_AUDIO0_RX_THRESHOLD - (2 * (i)))
132+
#define SDW0_DMA_RX_IRQ_MASK(i) (ACP_AUDIO0_RX_THRESHOLD - (2 * ((i) - 3)))
133+
134+
/*
135+
* Below entries describes SDW1 instance DMA stream id and DMA irq bit mapping
136+
* in ACP_EXTENAL_INTR_CNTL1 register.
137+
* Stream id IRQ Bit
138+
* 0 (SDW1_AUDIO1_TX) 6
139+
* 1 (SDW1_AUDIO1_RX) 5
140+
*/
121141
#define SDW1_DMA_IRQ_MASK(i) (ACP_P1_AUDIO_TX_THRESHOLD - (i))
122142

123143
#define ACP_DELAY_US 5

sound/soc/amd/ps/pci-ps.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ static int sdw_amd_scan_controller(struct device *dev)
257257
&sdw_manager_bitmap, 1);
258258

259259
if (ret) {
260-
dev_err(dev, "Failed to read mipi-sdw-manager-list: %d\n", ret);
260+
dev_dbg(dev, "Failed to read mipi-sdw-manager-list: %d\n", ret);
261261
return -EINVAL;
262262
}
263263
count = hweight32(sdw_manager_bitmap);
@@ -641,7 +641,7 @@ static int snd_acp63_probe(struct pci_dev *pci,
641641
ret = get_acp63_device_config(val, pci, adata);
642642
/* ACP PCI driver probe should be continued even PDM or SoundWire Devices are not found */
643643
if (ret) {
644-
dev_err(&pci->dev, "get acp device config failed:%d\n", ret);
644+
dev_dbg(&pci->dev, "get acp device config failed:%d\n", ret);
645645
goto skip_pdev_creation;
646646
}
647647
ret = create_acp63_platform_devs(pci, adata, addr);

sound/soc/amd/ps/ps-sdw-dma.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ static struct sdw_dma_ring_buf_reg sdw0_dma_ring_buf_reg[ACP63_SDW0_DMA_MAX_STRE
3030
ACP_AUDIO2_TX_LINEARPOSITIONCNTR_LOW, ACP_AUDIO2_TX_LINEARPOSITIONCNTR_HIGH},
3131
{ACP_AUDIO0_RX_DMA_SIZE, ACP_AUDIO0_RX_FIFOADDR, ACP_AUDIO0_RX_FIFOSIZE,
3232
ACP_AUDIO0_RX_RINGBUFSIZE, ACP_AUDIO0_RX_RINGBUFADDR, ACP_AUDIO0_RX_INTR_WATERMARK_SIZE,
33-
ACP_AUDIO0_TX_LINEARPOSITIONCNTR_LOW, ACP_AUDIO0_TX_LINEARPOSITIONCNTR_HIGH},
33+
ACP_AUDIO0_RX_LINEARPOSITIONCNTR_LOW, ACP_AUDIO0_RX_LINEARPOSITIONCNTR_HIGH},
3434
{ACP_AUDIO1_RX_DMA_SIZE, ACP_AUDIO1_RX_FIFOADDR, ACP_AUDIO1_RX_FIFOSIZE,
3535
ACP_AUDIO1_RX_RINGBUFSIZE, ACP_AUDIO1_RX_RINGBUFADDR, ACP_AUDIO1_RX_INTR_WATERMARK_SIZE,
3636
ACP_AUDIO1_RX_LINEARPOSITIONCNTR_LOW, ACP_AUDIO1_RX_LINEARPOSITIONCNTR_HIGH},
@@ -39,6 +39,11 @@ static struct sdw_dma_ring_buf_reg sdw0_dma_ring_buf_reg[ACP63_SDW0_DMA_MAX_STRE
3939
ACP_AUDIO2_RX_LINEARPOSITIONCNTR_LOW, ACP_AUDIO2_RX_LINEARPOSITIONCNTR_HIGH}
4040
};
4141

42+
/*
43+
* SDW1 instance supports one TX stream and one RX stream.
44+
* For TX/RX streams DMA registers programming for SDW1 instance, it uses ACP_P1_AUDIO1 register
45+
* set as per hardware register documentation
46+
*/
4247
static struct sdw_dma_ring_buf_reg sdw1_dma_ring_buf_reg[ACP63_SDW1_DMA_MAX_STREAMS] = {
4348
{ACP_P1_AUDIO1_TX_DMA_SIZE, ACP_P1_AUDIO1_TX_FIFOADDR, ACP_P1_AUDIO1_TX_FIFOSIZE,
4449
ACP_P1_AUDIO1_TX_RINGBUFSIZE, ACP_P1_AUDIO1_TX_RINGBUFADDR,
@@ -59,6 +64,12 @@ static u32 sdw0_dma_enable_reg[ACP63_SDW0_DMA_MAX_STREAMS] = {
5964
ACP_SW0_AUDIO2_RX_EN,
6065
};
6166

67+
/*
68+
* SDW1 instance supports one TX stream and one RX stream.
69+
* For TX/RX streams DMA enable register programming for SDW1 instance,
70+
* it uses ACP_SW1_AUDIO1_TX_EN and ACP_SW1_AUDIO1_RX_EN registers
71+
* as per hardware register documentation.
72+
*/
6273
static u32 sdw1_dma_enable_reg[ACP63_SDW1_DMA_MAX_STREAMS] = {
6374
ACP_SW1_AUDIO1_TX_EN,
6475
ACP_SW1_AUDIO1_RX_EN,
@@ -307,12 +318,13 @@ static u64 acp63_sdw_get_byte_count(struct acp_sdw_dma_stream *stream, void __io
307318
pos_high_reg = sdw1_dma_ring_buf_reg[stream->stream_id].pos_high_reg;
308319
break;
309320
default:
310-
return -EINVAL;
321+
goto POINTER_RETURN_BYTES;
311322
}
312323
if (pos_low_reg) {
313324
byte_count.bcount.high = readl(acp_base + pos_high_reg);
314325
byte_count.bcount.low = readl(acp_base + pos_low_reg);
315326
}
327+
POINTER_RETURN_BYTES:
316328
return byte_count.bytescount;
317329
}
318330

sound/soc/codecs/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,7 @@ config SND_SOC_CS35L41_I2C
715715

716716
config SND_SOC_CS35L45
717717
tristate
718+
select REGMAP_IRQ
718719

719720
config SND_SOC_CS35L45_SPI
720721
tristate "Cirrus Logic CS35L45 CODEC (SPI)"
@@ -1942,6 +1943,7 @@ config SND_SOC_WCD934X
19421943
tristate "WCD9340/WCD9341 Codec"
19431944
depends on COMMON_CLK
19441945
depends on SLIMBUS
1946+
select REGMAP_IRQ
19451947
select REGMAP_SLIMBUS
19461948
select SND_SOC_WCD_MBHC
19471949
depends on MFD_WCD934X || COMPILE_TEST

sound/soc/codecs/rt5640.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ static const struct reg_sequence init_list[] = {
5353
{RT5640_PR_BASE + 0x3d, 0x3600},
5454
{RT5640_PR_BASE + 0x12, 0x0aa8},
5555
{RT5640_PR_BASE + 0x14, 0x0aaa},
56-
{RT5640_PR_BASE + 0x20, 0x6110},
5756
{RT5640_PR_BASE + 0x21, 0xe0e0},
5857
{RT5640_PR_BASE + 0x23, 0x1804},
5958
};
@@ -2567,9 +2566,10 @@ static void rt5640_enable_jack_detect(struct snd_soc_component *component,
25672566
if (jack_data && jack_data->use_platform_clock)
25682567
rt5640->use_platform_clock = jack_data->use_platform_clock;
25692568

2570-
ret = request_irq(rt5640->irq, rt5640_irq,
2571-
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
2572-
"rt5640", rt5640);
2569+
ret = devm_request_threaded_irq(component->dev, rt5640->irq,
2570+
NULL, rt5640_irq,
2571+
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
2572+
"rt5640", rt5640);
25732573
if (ret) {
25742574
dev_warn(component->dev, "Failed to reguest IRQ %d: %d\n", rt5640->irq, ret);
25752575
rt5640_disable_jack_detect(component);
@@ -2622,8 +2622,9 @@ static void rt5640_enable_hda_jack_detect(
26222622

26232623
rt5640->jack = jack;
26242624

2625-
ret = request_irq(rt5640->irq, rt5640_irq,
2626-
IRQF_TRIGGER_RISING | IRQF_ONESHOT, "rt5640", rt5640);
2625+
ret = devm_request_threaded_irq(component->dev, rt5640->irq,
2626+
NULL, rt5640_irq, IRQF_TRIGGER_RISING | IRQF_ONESHOT,
2627+
"rt5640", rt5640);
26272628
if (ret) {
26282629
dev_warn(component->dev, "Failed to reguest IRQ %d: %d\n", rt5640->irq, ret);
26292630
rt5640->irq = -ENXIO;

0 commit comments

Comments
 (0)