From e579487dd22b0d9429f1ad007a50f6a727a8217f Mon Sep 17 00:00:00 2001 From: Xenolphthalein <21215869+Xenolphthalein@users.noreply.github.com> Date: Fri, 4 Dec 2026 15:35:05 +0100 Subject: [PATCH] irqchip/qcom-pdc: register before the device initcalls The TLMM looks up its wakeup parent, the PDC, at probe and defers without it. The PDC registers as a built-in platform driver, with the device initcalls, so it binds after the TLMM's first try, and the TLMM waits for the deferred probes of the late initcalls: on the PICO 4 its pin states apply at 0.61 s instead of 0.18 s, after the display's clock controller and the SMMUs have probed. Register the driver at arch_initcall: the PDC binds as soon as its device is made, and the TLMM right after it. --- drivers/irqchip/qcom-pdc.c | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/drivers/irqchip/qcom-pdc.c b/drivers/irqchip/qcom-pdc.c index 2014dbb0bc43..216d0803b0e0 100644 --- a/drivers/irqchip/qcom-pdc.c +++ b/drivers/irqchip/qcom-pdc.c @@ -445,8 +445,31 @@ static int qcom_pdc_probe(struct platform_device *pdev, struct device_node *pare return ret; } -IRQCHIP_PLATFORM_DRIVER_BEGIN(qcom_pdc) -IRQCHIP_MATCH("qcom,pdc", qcom_pdc_probe) -IRQCHIP_PLATFORM_DRIVER_END(qcom_pdc) +static const struct of_device_id qcom_pdc_irqchip_match_table[] = { + { .compatible = "qcom,pdc", .data = qcom_pdc_probe }, + { } +}; +MODULE_DEVICE_TABLE(of, qcom_pdc_irqchip_match_table); + +static struct platform_driver qcom_pdc_driver = { + .probe = platform_irqchip_probe, + .driver = { + .name = "qcom_pdc", + .of_match_table = qcom_pdc_irqchip_match_table, + .suppress_bind_attrs = true, + }, +}; + +/* + * The TLMM needs its wakeup parent at probe. Registered with the device initcalls, the PDC binds + * after the TLMM's first try, and the TLMM, deferred until the late initcalls, holds back every pin + * state and GPIO until then. Registered before the platform devices are made, the PDC binds as + * its device appears, and the TLMM right after it. + */ +static int __init qcom_pdc_init(void) +{ + return platform_driver_register(&qcom_pdc_driver); +} +arch_initcall(qcom_pdc_init); MODULE_DESCRIPTION("Qualcomm Technologies, Inc. Power Domain Controller"); MODULE_LICENSE("GPL v2");