summaryrefslogtreecommitdiffstats
path: root/include/linux/acpi.h
diff options
context:
space:
mode:
authorMarcin Wojtas2018-01-18 13:31:40 +0100
committerDavid S. Miller2018-01-22 16:57:04 +0100
commit7c6c57f2ab2c5113844fe187a7c45c4bd76dc671 (patch)
tree41132234dab217c94395fed1f1d628ee4a6d6e73 /include/linux/acpi.h
parentdevice property: Introduce fwnode_get_phy_mode() (diff)
downloadkernel-qcow2-linux-7c6c57f2ab2c5113844fe187a7c45c4bd76dc671.tar.gz
kernel-qcow2-linux-7c6c57f2ab2c5113844fe187a7c45c4bd76dc671.tar.xz
kernel-qcow2-linux-7c6c57f2ab2c5113844fe187a7c45c4bd76dc671.zip
device property: Introduce fwnode_irq_get()
Until now there were two very similar functions allowing to get Linux IRQ number from ACPI handle (acpi_irq_get()) and OF node (of_irq_get()). The first one appeared to be used only as a subroutine of platform_irq_get(), which (in the generic code) limited IRQ obtaining from _CRS method only to nodes associated to kernel's struct platform_device. This patch introduces a new helper routine - fwnode_irq_get(), which allows to get the IRQ number directly from the fwnode to be used as common for OF/ACPI worlds. It is usable not only for the parents fwnodes, but also for the child nodes comprising their own _CRS methods with interrupts description. In order to be able o satisfy compilation with !CONFIG_ACPI and also simplify the new code, introduce a helper macro (ACPI_HANDLE_FWNODE), with which it is possible to reach an ACPI handle directly from its fwnode. Signed-off-by: Marcin Wojtas <mw@semihalf.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/acpi.h')
-rw-r--r--include/linux/acpi.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index dc1ebfeeb5ec..f05b9b6cd43f 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -56,6 +56,8 @@ static inline acpi_handle acpi_device_handle(struct acpi_device *adev)
#define ACPI_COMPANION_SET(dev, adev) set_primary_fwnode(dev, (adev) ? \
acpi_fwnode_handle(adev) : NULL)
#define ACPI_HANDLE(dev) acpi_device_handle(ACPI_COMPANION(dev))
+#define ACPI_HANDLE_FWNODE(fwnode) \
+ acpi_device_handle(to_acpi_device_node(fwnode))
static inline struct fwnode_handle *acpi_alloc_fwnode_static(void)
{
@@ -626,6 +628,7 @@ int acpi_arch_timer_mem_init(struct arch_timer_mem *timer_mem, int *timer_count)
#define ACPI_COMPANION(dev) (NULL)
#define ACPI_COMPANION_SET(dev, adev) do { } while (0)
#define ACPI_HANDLE(dev) (NULL)
+#define ACPI_HANDLE_FWNODE(fwnode) (NULL)
#define ACPI_DEVICE_CLASS(_cls, _msk) .cls = (0), .cls_msk = (0),
struct fwnode_handle;