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>
This commit is contained in:

committed by
Rafael J. Wysocki

parent
752cad760b
commit
e29482e848
19
include/linux/acpi_gpio.h
Normal file
19
include/linux/acpi_gpio.h
Normal file
@@ -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_ */
|
Reference in New Issue
Block a user