[patch] gpiodev2 fixes for s3c

From: Kevin O'Connor <kevin_at_koconnor.net>
Date: Sat, 15 Sep 2007 15:42:44 -0400

Fixes for using gpiodev2 on the s3c platform. Similar to changes I
made to PXA.

-Kevin

--- include/asm-arm/arch-s3c2410/gpio.h 9 May 2007 11:16:59 -0000 1.3
+++ include/asm-arm/arch-s3c2410/gpio.h 15 Sep 2007 18:44:33 -0000
@@ -27,6 +27,7 @@
 #include <asm/irq.h>
 #include <asm/hardware.h>
 #include <asm/arch/regs-gpio.h>
+#include <linux/gpiodev2.h> /* GPIO_BASE_INCREMENT */
 
 static inline int gpio_request(unsigned gpio, const char *label)
 {
@@ -40,13 +41,16 @@
 
 static inline int gpio_direction_input(unsigned gpio)
 {
+ if (gpio >= GPIO_BASE_INCREMENT)
+ return -EINVAL;
         s3c2410_gpio_cfgpin(gpio, S3C2410_GPIO_INPUT);
         return 0;
 }
 
 static inline int gpio_direction_output(unsigned gpio, int value)
 {
- s3c2410_gpio_cfgpin(gpio, S3C2410_GPIO_OUTPUT);
+ if (gpio < GPIO_BASE_INCREMENT)
+ s3c2410_gpio_cfgpin(gpio, S3C2410_GPIO_OUTPUT);
         /* REVISIT can we write the value first, to avoid glitching? */
         s3c2410_gpio_setpin(gpio, value);
         return 0;
Received on Sat Sep 15 2007 - 15:42:47 EDT

This archive was generated by hypermail 2.2.0 : Sat Sep 15 2007 - 15:43:01 EDT