ASoC: mediatek: mtk-btcvsd: use the interrupt trigger type from DT
Subsystems (3)
PATCH 1/1 ASoC: mediatek: mtk-btcvsd: use the interrupt trigger type from DT
The driver requests its interrupt with IRQF_TRIGGER_LOW, which overrides the trigger type given in the device tree. That only works where a polarity inverter such as mediatek,mt6577-sysirq sits between the BT-SCO interrupt and the GIC. On SoCs that route it straight to a GICv3 SPI as level-high, MT6789 for example, gic_set_type() rejects a level-low SPI, request_irq() fails with -EINVAL and the driver does not probe.
Pass no trigger flags so that the type configured from the "interrupts" property is used. The binding example keeps IRQ_TYPE_LEVEL_LOW, which is still what such a node gets, and no in-tree device tree uses this compatible yet. MediaTek's downstream version of this driver requests the interrupt with IRQF_TRIGGER_NONE and describes it as IRQ_TYPE_LEVEL_HIGH in its MT6789, MT6833, MT6853, MT6855, MT6873 and MT6879 device trees.
Found and drafted with an AI coding assistant while bringing up MT6789.
---
Notes:
The same change is in the MediaTek-derived copy of this driver that runs on an MT6789 phone (GIC_SPI 407 IRQ_TYPE_LEVEL_HIGH): it probes and is in use (logs of the 6.18 build). This exact mainline change was not built or run. No Fixes tag because no in-tree device tree is affected; a tag pointing at 4bd8597dc36c (the commit that added the driver) can be added if preferred.
sound/soc/mediatek/common/mtk-btcvsd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
sound/soc/mediatek/common/mtk-btcvsd.c +1 -2
@@ -1298,8 +1298,7 @@ static int mtk_btcvsd_snd_probe(struct platform_device *pdev)return irq_id <0 ? irq_id : -ENXIO ; ret =devm_request_irq (dev, irq_id, mtk_btcvsd_snd_irq_handler, -IRQF_TRIGGER_LOW ,"BTCVSD_ISR_Handle" , - (void *)btcvsd); +0 ,"BTCVSD_ISR_Handle" , (void *)btcvsd);if (ret) {dev_err (dev,"could not request_irq for BTCVSD_ISR_Handle\n" );return ret;
Signature · 1 line
2.54.0 (Apple Git-157)