rk: plat: add gpio.h
author黄涛 <huangtao@rock-chips.com>
Mon, 2 Jul 2012 12:41:37 +0000 (20:41 +0800)
committer黄涛 <huangtao@rock-chips.com>
Mon, 2 Jul 2012 12:41:37 +0000 (20:41 +0800)
arch/arm/mach-rk30/include/mach/gpio.h
arch/arm/plat-rk/include/plat/gpio.h [new file with mode: 0644]

index 8fcf3234c2c6326c4eb4e2d135e291f0ecec524e..29463c9346e0be30fb078df44f7233799cabcf8a 100755 (executable)
@@ -4,34 +4,6 @@
 #include <mach/irqs.h>
 #include <linux/init.h>
 
-typedef enum eGPIOPinLevel
-{
-       GPIO_LOW=0,
-       GPIO_HIGH
-}eGPIOPinLevel_t;
-
-typedef enum eGPIOPinDirection
-{
-       GPIO_IN=0,
-       GPIO_OUT
-}eGPIOPinDirection_t;
-
-typedef enum GPIOPullType {
-       PullDisable = 0,
-       PullEnable,
-       GPIONormal,  //PullEnable, please do not use it
-       GPIOPullUp,     //PullEnable, please do not use it
-       GPIOPullDown,//PullEnable, please do not use it
-       GPIONOInit,//PullEnable, please do not use it
-}eGPIOPullType_t;
-
-typedef enum GPIOIntType {
-       GPIOLevelLow=0,
-       GPIOLevelHigh,   
-       GPIOEdgelFalling,
-       GPIOEdgelRising
-}eGPIOIntType_t;
-
 //¶¨ÒåGPIOÏà¹Ø¼Ä´æÆ÷Æ«ÒƵØÖ·
 #define        GPIO_SWPORT_DR          0x00
 #define        GPIO_SWPORT_DDR         0x04
@@ -428,21 +400,10 @@ typedef enum GPIOIntType {
 #define        WM831X_P12 (WM831X_GPIO_EXPANDER_BASE  + 1*NUM_GROUP + 3)
 #endif                                           
 
+#include <plat/gpio.h>
+
 #ifndef __ASSEMBLY__                                         
 extern void __init rk30_gpio_init(void);
-/*-------------------------------------------------------------------------*/
-
-/* wrappers for "new style" GPIO calls. the old RK2818-specfic ones should
- * eventually be removed (along with this errno.h inclusion), and the
- * gpio request/free calls should probably be implemented.
- */
-
-#include <asm/errno.h>
-#include <asm-generic/gpio.h>          /* cansleep wrappers */
-
-#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)
 {
diff --git a/arch/arm/plat-rk/include/plat/gpio.h b/arch/arm/plat-rk/include/plat/gpio.h
new file mode 100644 (file)
index 0000000..384f471
--- /dev/null
@@ -0,0 +1,43 @@
+#ifndef __PLAT_GPIO_H
+#define __PLAT_GPIO_H
+
+typedef enum eGPIOPinLevel
+{
+       GPIO_LOW=0,
+       GPIO_HIGH
+}eGPIOPinLevel_t;
+
+typedef enum eGPIOPinDirection
+{
+       GPIO_IN=0,
+       GPIO_OUT
+}eGPIOPinDirection_t;
+
+typedef enum GPIOPullType {
+       PullDisable = 0,
+       PullEnable,
+       GPIONormal,  //PullEnable, please do not use it
+       GPIOPullUp,     //PullEnable, please do not use it
+       GPIOPullDown,//PullEnable, please do not use it
+       GPIONOInit,//PullEnable, please do not use it
+}eGPIOPullType_t;
+
+typedef enum GPIOIntType {
+       GPIOLevelLow=0,
+       GPIOLevelHigh,   
+       GPIOEdgelFalling,
+       GPIOEdgelRising
+}eGPIOIntType_t;
+
+#ifndef __ASSEMBLY__                                         
+
+#include <asm/errno.h>
+#include <asm-generic/gpio.h>          /* cansleep wrappers */
+
+#define gpio_get_value __gpio_get_value
+#define gpio_set_value __gpio_set_value
+#define gpio_cansleep  __gpio_cansleep
+
+#endif /* __ASSEMBLY__ */
+
+#endif