Re: [PATCH] soundwire: qcom: Take the interrupt trigger type from DT

From: Srinivas Kandagatla

Date: Tue Dec 01 2026 - 13:25:41 EST




On 11/29/26 3:13 PM, Vladyslav Tymoshchuk wrote:
> 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")
> Signed-off-by: Vladyslav Tymoshchuk <tvlad744@xxxxxxxxx>


Reviewed-by: Srinivas Kandagatla<srinivas.kandagatla@xxxxxxxxxxxxxxxx>

--Srini
> ---
> 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(-)
>
> diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c
> index ad28a0fa345d..25c5f3b6d1ad 100644
> --- a/drivers/soundwire/qcom.c
> +++ b/drivers/soundwire/qcom.c
> @@ -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");