Skip to content

Commit 95bf930

Browse files
johnstultz-workMarc Zyngier
authored andcommitted
irqchip/qcom-pdc: Allow QCOM_PDC to be loadable as a permanent module
Allows qcom-pdc driver to be loaded as a permanent module Also, due to the fact that IRQCHIP_DECLARE becomes a no-op when building as a module, we have to replace it with platform driver hooks explicitly. Thanks to Saravana for his help on pointing out the IRQCHIP_DECLARE issue and guidance on a solution. Signed-off-by: John Stultz <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Cc: Andy Gross <[email protected]> Cc: Bjorn Andersson <[email protected]> Cc: Joerg Roedel <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Jason Cooper <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Linus Walleij <[email protected]> Cc: Maulik Shah <[email protected]> Cc: Lina Iyer <[email protected]> Cc: Saravana Kannan <[email protected]> Cc: Todd Kjos <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Link: https://lore.kernel.org/r/[email protected]
1 parent 8d16f5b commit 95bf930

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

drivers/irqchip/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ config GOLDFISH_PIC
425425
for Goldfish based virtual platforms.
426426

427427
config QCOM_PDC
428-
bool "QCOM PDC"
428+
tristate "QCOM PDC"
429429
depends on ARCH_QCOM
430430
select IRQ_DOMAIN_HIERARCHY
431431
help

drivers/irqchip/qcom-pdc.c

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@
1111
#include <linux/irqdomain.h>
1212
#include <linux/io.h>
1313
#include <linux/kernel.h>
14+
#include <linux/module.h>
1415
#include <linux/of.h>
1516
#include <linux/of_address.h>
1617
#include <linux/of_device.h>
18+
#include <linux/of_irq.h>
1719
#include <linux/soc/qcom/irq.h>
1820
#include <linux/spinlock.h>
1921
#include <linux/slab.h>
@@ -430,4 +432,28 @@ static int qcom_pdc_init(struct device_node *node, struct device_node *parent)
430432
return ret;
431433
}
432434

433-
IRQCHIP_DECLARE(qcom_pdc, "qcom,pdc", qcom_pdc_init);
435+
static int qcom_pdc_probe(struct platform_device *pdev)
436+
{
437+
struct device_node *np = pdev->dev.of_node;
438+
struct device_node *parent = of_irq_find_parent(np);
439+
440+
return qcom_pdc_init(np, parent);
441+
}
442+
443+
static const struct of_device_id qcom_pdc_match_table[] = {
444+
{ .compatible = "qcom,pdc" },
445+
{}
446+
};
447+
MODULE_DEVICE_TABLE(of, qcom_pdc_match_table);
448+
449+
static struct platform_driver qcom_pdc_driver = {
450+
.probe = qcom_pdc_probe,
451+
.driver = {
452+
.name = "qcom-pdc",
453+
.of_match_table = qcom_pdc_match_table,
454+
.suppress_bind_attrs = true,
455+
},
456+
};
457+
module_platform_driver(qcom_pdc_driver);
458+
MODULE_DESCRIPTION("Qualcomm Technologies, Inc. Power Domain Controller");
459+
MODULE_LICENSE("GPL v2");

0 commit comments

Comments
 (0)