From 9fe17ed4a204e008b50e7e22014082391b236014 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=BB=84=E6=B6=9B?= Date: Mon, 2 Jul 2012 20:41:37 +0800 Subject: [PATCH] rk: plat: add gpio.h --- arch/arm/mach-rk30/include/mach/gpio.h | 43 ++------------------------ arch/arm/plat-rk/include/plat/gpio.h | 43 ++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 41 deletions(-) create mode 100644 arch/arm/plat-rk/include/plat/gpio.h diff --git a/arch/arm/mach-rk30/include/mach/gpio.h b/arch/arm/mach-rk30/include/mach/gpio.h index 8fcf3234c2c6..29463c9346e0 100755 --- a/arch/arm/mach-rk30/include/mach/gpio.h +++ b/arch/arm/mach-rk30/include/mach/gpio.h @@ -4,34 +4,6 @@ #include #include -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 + #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 -#include /* 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 index 000000000000..384f4719cc07 --- /dev/null +++ b/arch/arm/plat-rk/include/plat/gpio.h @@ -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 +#include /* cansleep wrappers */ + +#define gpio_get_value __gpio_get_value +#define gpio_set_value __gpio_set_value +#define gpio_cansleep __gpio_cansleep + +#endif /* __ASSEMBLY__ */ + +#endif -- 2.34.1