diff mbox

[v3,2/2] ACPI / gpio: Add irq_type when a gpio is used as an interrupt

Message ID 1448923673-2582-3-git-send-email-christophe-h.ricard@st.com
State Not Applicable
Headers show

Commit Message

Christophe Ricard Nov. 30, 2015, 10:47 p.m. UTC
When a gpio is used as an interrupt, the irq_type was not available for
device driver. It is not align with devicetree probing.

Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
---
 drivers/gpio/gpiolib-acpi.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Linus Walleij Dec. 10, 2015, 5 p.m. UTC | #1
On Mon, Nov 30, 2015 at 11:47 PM, Christophe Ricard
<christophe.ricard@gmail.com> wrote:

> When a gpio is used as an interrupt, the irq_type was not available for
> device driver. It is not align with devicetree probing.
>
> Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Rafael you can merge this into the ACPI tree.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
index bbcac3a..cff8736 100644
--- a/drivers/gpio/gpiolib-acpi.c
+++ b/drivers/gpio/gpiolib-acpi.c
@@ -416,9 +416,12 @@  static int acpi_find_gpio(struct acpi_resource *ares, void *data)
 		 * GpioIo is used then the only way to set the flag is
 		 * to use _DSD "gpios" property.
 		 */
-		if (lookup->info.gpioint)
+		if (lookup->info.gpioint) {
 			lookup->info.active_low =
 				agpio->polarity == ACPI_ACTIVE_LOW;
+			irq_set_irq_type(gpiod_to_irq(lookup->desc),
+					 acpi_get_irq_type(agpio->triggering, agpio->polarity));
+		}
 	}
 
 	return 1;