1
2
3
4
5
6
7
8
9
10
11#ifndef _LINUX_IRQCHIP_H
12#define _LINUX_IRQCHIP_H
13
14#include <linux/acpi.h>
15#include <linux/module.h>
16#include <linux/of.h>
17#include <linux/platform_device.h>
18
19
20
21
22
23
24
25
26
27
28
29#define IRQCHIP_DECLARE(name, compat, fn) OF_DECLARE_2(irqchip, name, compat, fn)
30
31extern int platform_irqchip_probe(struct platform_device *pdev);
32
33#define IRQCHIP_PLATFORM_DRIVER_BEGIN(drv_name) \
34static 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}; \
41MODULE_DEVICE_TABLE(of, drv_name##_irqchip_match_table); \
42static 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}; \
51builtin_platform_driver(drv_name##_driver)
52
53
54
55
56
57
58
59
60
61
62
63
64
65#define IRQCHIP_ACPI_DECLARE(name, subtable, validate, data, fn) \
66 ACPI_DECLARE_SUBTABLE_PROBE_ENTRY(irqchip, name, \
67 ACPI_SIG_MADT, subtable, \
68 validate, data, fn)
69
70#ifdef CONFIG_IRQCHIP
71void irqchip_init(void);
72#else
73static inline void irqchip_init(void) {}
74#endif
75
76#endif
77