irqchip.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. #ifndef _LINUX_IRQCHIP_H
  11. #define _LINUX_IRQCHIP_H
  12. #include <linux/acpi.h>
  13. #include <linux/of.h>
  14. /*
  15. * This macro must be used by the different irqchip drivers to declare
  16. * the association between their DT compatible string and their
  17. * initialization function.
  18. *
  19. * @name: name that must be unique accross all IRQCHIP_DECLARE of the
  20. * same file.
  21. * @compstr: compatible string of the irqchip driver
  22. * @fn: initialization function
  23. */
  24. #define IRQCHIP_DECLARE(name, compat, fn) OF_DECLARE_2(irqchip, name, compat, fn)
  25. /*
  26. * This macro must be used by the different irqchip drivers to declare
  27. * the association between their version and their initialization function.
  28. *
  29. * @name: name that must be unique accross all IRQCHIP_ACPI_DECLARE of the
  30. * same file.
  31. * @subtable: Subtable to be identified in MADT
  32. * @validate: Function to be called on that subtable to check its validity.
  33. * Can be NULL.
  34. * @data: data to be checked by the validate function.
  35. * @fn: initialization function
  36. */
  37. #define IRQCHIP_ACPI_DECLARE(name, subtable, validate, data, fn) \
  38. ACPI_DECLARE_PROBE_ENTRY(irqchip, name, ACPI_SIG_MADT, \
  39. subtable, validate, data, fn)
  40. #ifdef CONFIG_IRQCHIP
  41. void irqchip_init(void);
  42. #else
  43. static inline void irqchip_init(void) {}
  44. #endif
  45. #endif