ARM: pxa: rename NR_BUILTIN_GPIO

NR_BUILTIN_GPIO is both defined in arch-pxa and arch-mmp. Now replace it
with PXA_NR_BUILTIN_GPIO and MMP_NR_BUILTIN_GPIO.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
This commit is contained in:
Haojian Zhuang
2011-11-08 14:15:59 +08:00
parent 478e223cc3
commit 1a8d5fab16
17 changed files with 23 additions and 58 deletions

View File

@@ -1,30 +0,0 @@
#ifndef __PLAT_GPIO_H
#define __PLAT_GPIO_H
#define __ARM_GPIOLIB_COMPLEX
/* The individual machine provides register offsets and NR_BUILTIN_GPIO */
#include <mach/gpio-pxa.h>
static inline int gpio_get_value(unsigned gpio)
{
if (__builtin_constant_p(gpio) && (gpio < NR_BUILTIN_GPIO))
return GPLR(gpio) & GPIO_bit(gpio);
else
return __gpio_get_value(gpio);
}
static inline void gpio_set_value(unsigned gpio, int value)
{
if (__builtin_constant_p(gpio) && (gpio < NR_BUILTIN_GPIO)) {
if (value)
GPSR(gpio) = GPIO_bit(gpio);
else
GPCR(gpio) = GPIO_bit(gpio);
} else
__gpio_set_value(gpio, value);
}
#define gpio_cansleep __gpio_cansleep
#endif /* __PLAT_GPIO_H */