summaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpiolib.c
diff options
context:
space:
mode:
authorChristophe RICARD <christophe.ricard@gmail.com>2015-12-23 23:25:34 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-01-01 03:20:25 +0100
commit52044723cd27aed6dad655a3bdf6142a8239ce74 (patch)
treec0a6afa0467086e9f09887618cb7ec92f53132ec /drivers/gpio/gpiolib.c
parent55a93417c27c6ad1022d5f1121004c494735e8fa (diff)
downloadlinux-52044723cd27aed6dad655a3bdf6142a8239ce74.tar.gz
linux-52044723cd27aed6dad655a3bdf6142a8239ce74.tar.bz2
linux-52044723cd27aed6dad655a3bdf6142a8239ce74.zip
ACPI / gpio: Add irq_type when a GPIO is used as an interrupt
When a GPIO is used as an interrupt in ACPI, the irq_type was not available for device driver. Make available polarity and triggering information in acpi_find_gpio by renaming acpi_gpio_info field active_low to polarity and adding triggering field (edge/level). For sanity, in gpiolib.c replace info.active_low by "info.polarity == GPIO_ACTIVE_LOW". Set the irq_type if necessary in acpi_dev_gpio_irq_get. Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/gpio/gpiolib.c')
-rw-r--r--drivers/gpio/gpiolib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 4e4c3083ae56..5d8d7ab96916 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -1879,7 +1879,7 @@ static struct gpio_desc *acpi_find_gpio(struct device *dev, const char *con_id,
return desc;
}
- if (info.active_low)
+ if (info.polarity == GPIO_ACTIVE_LOW)
*flags |= GPIO_ACTIVE_LOW;
return desc;
@@ -2217,7 +2217,7 @@ struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode,
desc = acpi_node_get_gpiod(fwnode, propname, 0, &info);
if (!IS_ERR(desc))
- active_low = info.active_low;
+ active_low = info.polarity == GPIO_ACTIVE_LOW;
}
if (IS_ERR(desc))