2 * Copyright (C) 2012 Thomas Petazzoni
4 * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
11 #ifndef _LINUX_IRQCHIP_H
12 #define _LINUX_IRQCHIP_H
14 #include <linux/acpi.h>
16 #include <linux/platform_device.h>
19 * This macro must be used by the different irqchip drivers to declare
20 * the association between their DT compatible string and their
21 * initialization function.
23 * @name: name that must be unique across all IRQCHIP_DECLARE of the
25 * @compstr: compatible string of the irqchip driver
26 * @fn: initialization function
28 #define IRQCHIP_DECLARE(name, compat, fn) OF_DECLARE_2(irqchip, name, compat, fn)
30 extern int platform_irqchip_probe(struct platform_device *pdev);
32 #define IRQCHIP_PLATFORM_DRIVER_BEGIN(drv_name) \
33 static const struct of_device_id drv_name##_irqchip_match_table[] = {
35 #define IRQCHIP_MATCH(compat, fn) { .compatible = compat, .data = fn },
37 #define IRQCHIP_PLATFORM_DRIVER_END(drv_name) \
40 MODULE_DEVICE_TABLE(of, drv_name##_irqchip_match_table); \
41 static struct platform_driver drv_name##_driver = { \
42 .probe = platform_irqchip_probe, \
45 .owner = THIS_MODULE, \
46 .of_match_table = drv_name##_irqchip_match_table, \
47 .suppress_bind_attrs = true, \
50 builtin_platform_driver(drv_name##_driver)
53 * This macro must be used by the different irqchip drivers to declare
54 * the association between their version and their initialization function.
56 * @name: name that must be unique across all IRQCHIP_ACPI_DECLARE of the
58 * @subtable: Subtable to be identified in MADT
59 * @validate: Function to be called on that subtable to check its validity.
61 * @data: data to be checked by the validate function.
62 * @fn: initialization function
64 #define IRQCHIP_ACPI_DECLARE(name, subtable, validate, data, fn) \
65 ACPI_DECLARE_SUBTABLE_PROBE_ENTRY(irqchip, name, \
66 ACPI_SIG_MADT, subtable, \
70 void irqchip_init(void);
72 static inline void irqchip_init(void) {}