blob: 89c34b20067122f732073df0b3234dfab2a7fa48 [file] [log] [blame]
Thomas Petazzonif6e916b2012-11-20 23:00:52 +01001/*
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 Zyngier46e589a2015-09-28 15:49:13 +010014#include <linux/acpi.h>
Joel Porquet91e20b52015-07-02 15:32:00 -040015#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 Zyngier46e589a2015-09-28 15:49:13 +010029/*
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 Hecht0d7c1212013-05-08 15:20:04 +020045#ifdef CONFIG_IRQCHIP
Thomas Petazzonif6e916b2012-11-20 23:00:52 +010046void irqchip_init(void);
Bastian Hecht0d7c1212013-05-08 15:20:04 +020047#else
48static inline void irqchip_init(void) {}
49#endif
Thomas Petazzonif6e916b2012-11-20 23:00:52 +010050
51#endif