[PATCH 08/16] ARM: at91: Switch over to gpiolib ->to_irq() and __gpio_to_irq().

Lennert Buytenhek buytenh at wantstofly.org
Tue Dec 14 21:03:38 EST 2010


Signed-off-by: Lennert Buytenhek <buytenh at secretlab.ca>
---
 arch/arm/mach-at91/gpio.c              |    7 +++++++
 arch/arm/mach-at91/include/mach/gpio.h |    6 +-----
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-at91/gpio.c b/arch/arm/mach-at91/gpio.c
index ae4772e..efcfe8b 100644
--- a/arch/arm/mach-at91/gpio.c
+++ b/arch/arm/mach-at91/gpio.c
@@ -44,6 +44,7 @@ static int at91_gpiolib_direction_output(struct gpio_chip *chip,
 					 unsigned offset, int val);
 static int at91_gpiolib_direction_input(struct gpio_chip *chip,
 					unsigned offset);
+static int at91_gpiolib_to_irq(struct gpio_chip *chip, unsigned offset);
 
 #define AT91_GPIO_CHIP(name, base_gpio, nr_gpio)			\
 	{								\
@@ -53,6 +54,7 @@ static int at91_gpiolib_direction_input(struct gpio_chip *chip,
 			.direction_output = at91_gpiolib_direction_output, \
 			.get		  = at91_gpiolib_get,		\
 			.set		  = at91_gpiolib_set,		\
+			.to_irq		  = at91_gpiolib_to_irq,	\
 			.dbg_show	  = at91_gpiolib_dbg_show,	\
 			.base		  = base_gpio,			\
 			.ngpio		  = nr_gpio,			\
@@ -586,6 +588,11 @@ static void at91_gpiolib_set(struct gpio_chip *chip, unsigned offset, int val)
 	__raw_writel(mask, pio + (val ? PIO_SODR : PIO_CODR));
 }
 
+static int at91_gpiolib_to_irq(struct gpio_chip *chip, unsigned offset)
+{
+	return chip->base + offset;
+}
+
 static void at91_gpiolib_dbg_show(struct seq_file *s, struct gpio_chip *chip)
 {
 	int i;
diff --git a/arch/arm/mach-at91/include/mach/gpio.h b/arch/arm/mach-at91/include/mach/gpio.h
index bfdd8ab..1e557f4 100644
--- a/arch/arm/mach-at91/include/mach/gpio.h
+++ b/arch/arm/mach-at91/include/mach/gpio.h
@@ -219,11 +219,7 @@ extern void at91_gpio_resume(void);
 #define gpio_get_value	__gpio_get_value
 #define gpio_set_value	__gpio_set_value
 #define gpio_cansleep	__gpio_cansleep
-
-static inline int gpio_to_irq(unsigned gpio)
-{
-	return gpio;
-}
+#define gpio_to_irq	__gpio_to_irq
 
 static inline int irq_to_gpio(unsigned irq)
 {
-- 
1.7.1




More information about the linux-arm-kernel mailing list