0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #include <linux/acpi.h>
0012 #include <linux/init.h>
0013 #include <linux/of_device.h>
0014 #include <linux/of_irq.h>
0015 #include <linux/irqchip.h>
0016 #include <linux/platform_device.h>
0017
0018
0019
0020
0021
0022
0023
0024 static const struct of_device_id
0025 irqchip_of_match_end __used __section("__irqchip_of_table_end");
0026
0027 extern struct of_device_id __irqchip_of_table[];
0028
0029 void __init irqchip_init(void)
0030 {
0031 of_irq_init(__irqchip_of_table);
0032 acpi_probe_device_table(irqchip);
0033 }
0034
0035 int platform_irqchip_probe(struct platform_device *pdev)
0036 {
0037 struct device_node *np = pdev->dev.of_node;
0038 struct device_node *par_np = of_irq_find_parent(np);
0039 of_irq_init_cb_t irq_init_cb = of_device_get_match_data(&pdev->dev);
0040
0041 if (!irq_init_cb)
0042 return -EINVAL;
0043
0044 if (par_np == np)
0045 par_np = NULL;
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055 if (par_np && !irq_find_matching_host(par_np, DOMAIN_BUS_ANY))
0056 return -EPROBE_DEFER;
0057
0058 return irq_init_cb(np, par_np);
0059 }
0060 EXPORT_SYMBOL_GPL(platform_irqchip_probe);