Thomas Petazzoni | f6e916b | 2012-11-20 23:00:52 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2012 Thomas Petazzoni |
| 3 | * |
| 4 | * Thomas Petazzoni <thomas.petazzoni@free-electrons.com> |
| 5 | * |
| 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. |
| 9 | */ |
| 10 | |
| 11 | #ifndef _LINUX_IRQCHIP_H |
| 12 | #define _LINUX_IRQCHIP_H |
| 13 | |
Marc Zyngier | 46e589a | 2015-09-28 15:49:13 +0100 | [diff] [blame] | 14 | #include <linux/acpi.h> |
Joel Porquet | 91e20b5 | 2015-07-02 15:32:00 -0400 | [diff] [blame] | 15 | #include <linux/of.h> |
| 16 | |
| 17 | /* |
| 18 | * This macro must be used by the different irqchip drivers to declare |
| 19 | * the association between their DT compatible string and their |
| 20 | * initialization function. |
| 21 | * |
| 22 | * @name: name that must be unique accross all IRQCHIP_DECLARE of the |
| 23 | * same file. |
| 24 | * @compstr: compatible string of the irqchip driver |
| 25 | * @fn: initialization function |
| 26 | */ |
| 27 | #define IRQCHIP_DECLARE(name, compat, fn) OF_DECLARE_2(irqchip, name, compat, fn) |
| 28 | |
Marc Zyngier | 46e589a | 2015-09-28 15:49:13 +0100 | [diff] [blame] | 29 | /* |
| 30 | * This macro must be used by the different irqchip drivers to declare |
| 31 | * the association between their version and their initialization function. |
| 32 | * |
| 33 | * @name: name that must be unique accross all IRQCHIP_ACPI_DECLARE of the |
| 34 | * same file. |
| 35 | * @subtable: Subtable to be identified in MADT |
| 36 | * @validate: Function to be called on that subtable to check its validity. |
| 37 | * Can be NULL. |
| 38 | * @data: data to be checked by the validate function. |
| 39 | * @fn: initialization function |
| 40 | */ |
| 41 | #define IRQCHIP_ACPI_DECLARE(name, subtable, validate, data, fn) \ |
| 42 | ACPI_DECLARE_PROBE_ENTRY(irqchip, name, ACPI_SIG_MADT, \ |
| 43 | subtable, validate, data, fn) |
| 44 | |
Bastian Hecht | 0d7c121 | 2013-05-08 15:20:04 +0200 | [diff] [blame] | 45 | #ifdef CONFIG_IRQCHIP |
Thomas Petazzoni | f6e916b | 2012-11-20 23:00:52 +0100 | [diff] [blame] | 46 | void irqchip_init(void); |
Bastian Hecht | 0d7c121 | 2013-05-08 15:20:04 +0200 | [diff] [blame] | 47 | #else |
| 48 | static inline void irqchip_init(void) {} |
| 49 | #endif |
Thomas Petazzoni | f6e916b | 2012-11-20 23:00:52 +0100 | [diff] [blame] | 50 | |
| 51 | #endif |