Skip to contentSkip to conversation

twl4030 uses new gpio_to_irq() hooks

PATCH New David Brownell 1 participant 1 message Oct 3, 2008 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 3/3 twl4030 uses new gpio_to_irq() hooks

From: David Brownell <[email protected]>

Make twl4030 GPIO support the new gpio_to_irq() hook

---
 drivers/gpio/twl4030-gpio.c |    7 +++++++
 1 file changed, 7 insertions(+)
drivers/gpio/twl4030-gpio.c +7 -0
@@ -630,6 +630,12 @@ static void twl_set(struct gpio_chip *ch
 	twl4030_set_gpio_dataout(offset, value);
 }
 
+static int twl_to_irq(struct gpio_chip *chip, unsigned offset)
+{
+	/* NOTE: assumes IRQs are set up ... */
+	return twl4030_gpio_irq_base + offset;
+}
+
 static struct gpio_chip twl_gpiochip = {
 	.label			= "twl4030",
 	.owner			= THIS_MODULE,
@@ -639,6 +645,7 @@ static struct gpio_chip twl_gpiochip = {
 	.get			= twl_get,
 	.direction_output	= twl_direction_out,
 	.set			= twl_set,
+	.to_irq			= twl_to_irq,
 	.can_sleep		= 1,
 };