hc
2023-12-09 958e46acc8e900e8569dd467c1af9b8d2d019394
kernel/include/linux/irqchip.h
....@@ -12,25 +12,49 @@
1212 #define _LINUX_IRQCHIP_H
1313
1414 #include <linux/acpi.h>
15
+#include <linux/module.h>
1516 #include <linux/of.h>
17
+#include <linux/platform_device.h>
1618
1719 /*
1820 * This macro must be used by the different irqchip drivers to declare
1921 * the association between their DT compatible string and their
2022 * initialization function.
2123 *
22
- * @name: name that must be unique accross all IRQCHIP_DECLARE of the
24
+ * @name: name that must be unique across all IRQCHIP_DECLARE of the
2325 * same file.
2426 * @compstr: compatible string of the irqchip driver
2527 * @fn: initialization function
2628 */
2729 #define IRQCHIP_DECLARE(name, compat, fn) OF_DECLARE_2(irqchip, name, compat, fn)
2830
31
+extern int platform_irqchip_probe(struct platform_device *pdev);
32
+
33
+#define IRQCHIP_PLATFORM_DRIVER_BEGIN(drv_name) \
34
+static const struct of_device_id drv_name##_irqchip_match_table[] = {
35
+
36
+#define IRQCHIP_MATCH(compat, fn) { .compatible = compat, .data = fn },
37
+
38
+#define IRQCHIP_PLATFORM_DRIVER_END(drv_name) \
39
+ {}, \
40
+}; \
41
+MODULE_DEVICE_TABLE(of, drv_name##_irqchip_match_table); \
42
+static struct platform_driver drv_name##_driver = { \
43
+ .probe = platform_irqchip_probe, \
44
+ .driver = { \
45
+ .name = #drv_name, \
46
+ .owner = THIS_MODULE, \
47
+ .of_match_table = drv_name##_irqchip_match_table, \
48
+ .suppress_bind_attrs = true, \
49
+ }, \
50
+}; \
51
+builtin_platform_driver(drv_name##_driver)
52
+
2953 /*
3054 * This macro must be used by the different irqchip drivers to declare
3155 * the association between their version and their initialization function.
3256 *
33
- * @name: name that must be unique accross all IRQCHIP_ACPI_DECLARE of the
57
+ * @name: name that must be unique across all IRQCHIP_ACPI_DECLARE of the
3458 * same file.
3559 * @subtable: Subtable to be identified in MADT
3660 * @validate: Function to be called on that subtable to check its validity.
....@@ -39,8 +63,9 @@
3963 * @fn: initialization function
4064 */
4165 #define IRQCHIP_ACPI_DECLARE(name, subtable, validate, data, fn) \
42
- ACPI_DECLARE_PROBE_ENTRY(irqchip, name, ACPI_SIG_MADT, \
43
- subtable, validate, data, fn)
66
+ ACPI_DECLARE_SUBTABLE_PROBE_ENTRY(irqchip, name, \
67
+ ACPI_SIG_MADT, subtable, \
68
+ validate, data, fn)
4469
4570 #ifdef CONFIG_IRQCHIP
4671 void irqchip_init(void);