Skip to contentSkip to conversation

soundwire: qcom: Take the interrupt trigger type from DT

PATCH In review Vladyslav Tymoshchuk 2 participants 2 messages Nov 29 – Dec 1

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 soundwire: qcom: Take the interrupt trigger type from DT

The driver requests its interrupt with IRQF_TRIGGER_RISING, while the DT nodes that give a type for it describe it as level high. The request switches the line to edge, and the mapping stays after the driver is unbound. The next probe then fails, as the type does not match the one from DT:

irq: type mismatch, failed to map hwirq-187 for interrupt-controller@16000000! qcom-soundwire 6ad0000.soundwire: Failed to request soundwire irq qcom-soundwire 6ad0000.soundwire: probe with driver qcom-soundwire failed with error -22

Use the type from DT. Keep the rising edge for wcd9340, where the DT does not give a type.

Fixes 02efb49aa805 ("soundwire: qcom: add support for SoundWire controller")

---
Tested on a OnePlus Pad 3 (SM8750; the board DT is not upstream yet), v7.3-rc5 plus board patches, unbind and bind of 6ad0000.soundwire:

without the patch 2/2 fail to probe, no sound card until reboot
with the patch 3/3 bind, the sound card comes back

With the patch the interrupt is level and the counts do not rise at idle or during playback.

The kernel with the patch also had "soundwire: qcom: Disable runtime PM and avoid clock underflow in qcom_swrm_remove()" from Lee Jones' series and other patches for ADSP restart. Without Lee's patch the rebind ran into an oops in swrm_runtime_resume() (1/1). On next-20261127 I only built the patch. I could not test other SoCs.

I used an AI assistant (Claude) to find the problem and write the patch.

 drivers/soundwire/qcom.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/soundwire/qcom.c +2 -2
index ad28a0fa345d..25c5f3b6d1ad 100644
@@ -1940,8 +1940,8 @@ static int qcom_swrm_probe(struct platform_device *pdev)
 
 	ret = devm_request_threaded_irq(dev, ctrl->irq, NULL,
 					qcom_swrm_irq_handler,
-					IRQF_TRIGGER_RISING |
-					IRQF_ONESHOT,
+					(irq_get_trigger_type(ctrl->irq) ?:
+					 IRQF_TRIGGER_RISING) | IRQF_ONESHOT,
 					"soundwire", ctrl);
 	if (ret) {
 		dev_err(dev, "Failed to request soundwire irq\n");
Signature · 1 line
2.43.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Vladyslav Tymoshchuk

The driver requests its interrupt with IRQF_TRIGGER_RISING, while the DT nodes that give a type for it describe it as level high. The request switches the line to edge, and the mapping stays after the driver is unbound. The next probe then fails, as the type does not match the one from DT:

irq: type mismatch, failed to map hwirq-187 for interrupt-controller@16000000! qcom-soundwire 6ad0000.soundwire: Failed to request soundwire irq qcom-soundwire 6ad0000.soundwire: probe with driver qcom-soundwire failed with error -22

Quoted 5 lines

Use the type from DT. Keep the rising edge for wcd9340, where the DT does not give a type.

Fixes 02efb49aa805 ("soundwire: qcom: add support for SoundWire controller")

--Srini

Quoted 36 lines

---
Tested on a OnePlus Pad 3 (SM8750; the board DT is not upstream yet), v7.3-rc5 plus board patches, unbind and bind of 6ad0000.soundwire:

without the patch 2/2 fail to probe, no sound card until reboot
with the patch 3/3 bind, the sound card comes back

With the patch the interrupt is level and the counts do not rise at idle or during playback.

The kernel with the patch also had "soundwire: qcom: Disable runtime PM and avoid clock underflow in qcom_swrm_remove()" from Lee Jones' series and other patches for ADSP restart. Without Lee's patch the rebind ran into an oops in swrm_runtime_resume() (1/1). On next-20261127 I only built the patch. I could not test other SoCs.

I used an AI assistant (Claude) to find the problem and write the patch.

 drivers/soundwire/qcom.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/soundwire/qcom.c +2 -2
index ad28a0fa345d..25c5f3b6d1ad 100644
@@ -1940,8 +1940,8 @@ static int qcom_swrm_probe(struct platform_device *pdev)
 
 	ret = devm_request_threaded_irq(dev, ctrl->irq, NULL,
 					qcom_swrm_irq_handler,
-					IRQF_TRIGGER_RISING |
-					IRQF_ONESHOT,
+					(irq_get_trigger_type(ctrl->irq) ?:
+					 IRQF_TRIGGER_RISING) | IRQF_ONESHOT,
 					"soundwire", ctrl);
 	if (ret) {
 		dev_err(dev, "Failed to request soundwire irq\n");