summaryrefslogtreecommitdiff
path: root/include/linux/acpi_gpio.h
diff options
context:
space:
mode:
authorMathias Nyman <mathias.nyman@linux.intel.com>2012-11-30 15:37:36 +0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2012-11-30 15:37:36 +0400
commite29482e8487954c87dc7b4fdbc53574bf1d4cce2 (patch)
tree23b226e6ed38ad37a26a38b12662869195e0fb6a /include/linux/acpi_gpio.h
parent752cad760b19e85926341880dc317a99f400eacc (diff)
downloadlinux-e29482e8487954c87dc7b4fdbc53574bf1d4cce2.tar.xz
gpio / ACPI: add ACPI support
Add support for translating ACPI GPIO pin numbers to Linux GPIO API pins. Needs a gpio controller driver with the acpi handler hook set. Drivers can use acpi_get_gpio() to translate ACPI5 GpioIO and GpioInt resources to Linux GPIO's. Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Acked-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/linux/acpi_gpio.h')
-rw-r--r--include/linux/acpi_gpio.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/acpi_gpio.h b/include/linux/acpi_gpio.h
new file mode 100644
index 000000000000..91615a389b65
--- /dev/null
+++ b/include/linux/acpi_gpio.h
@@ -0,0 +1,19 @@
+#ifndef _LINUX_ACPI_GPIO_H_
+#define _LINUX_ACPI_GPIO_H_
+
+#include <linux/errno.h>
+
+#ifdef CONFIG_GPIO_ACPI
+
+int acpi_get_gpio(char *path, int pin);
+
+#else /* CONFIG_GPIO_ACPI */
+
+static inline int acpi_get_gpio(char *path, int pin)
+{
+ return -ENODEV;
+}
+
+#endif /* CONFIG_GPIO_ACPI */
+
+#endif /* _LINUX_ACPI_GPIO_H_ */