X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/b887a6d197170b719028f31085876d8deaed35b6..fd472b607b89337bf1a6caa3d8ce5c380686eb0c:/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/gpio.h diff --git a/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/gpio.h b/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/gpio.h index e8a0836a3..f68ee1685 100644 --- a/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/gpio.h +++ b/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/gpio.h @@ -1,5 +1,5 @@ /* - * Ralink RT288x GPIO API definitions + * Ralink SoC GPIO API support * * Copyright (C) 2008-2009 Gabor Juhos * Copyright (C) 2008 Imre Kaloz @@ -10,43 +10,15 @@ * */ -#ifndef __ASM_MACH_RT288X_GPIO_H -#define __ASM_MACH_RT288X_GPIO_H +#ifndef __ASM_MACH_RALINK_GPIO_H +#define __ASM_MACH_RALINK_GPIO_H -#define ARCH_NR_GPIOS 64 +#define ARCH_NR_GPIOS 128 #include -#include - -extern void __rt288x_gpio_set_value(unsigned gpio, int value); -extern int __rt288x_gpio_get_value(unsigned gpio); - -static inline int gpio_to_irq(unsigned gpio) -{ - return RT288X_GPIO_IRQ(gpio); -} - -static inline int irq_to_gpio(unsigned irq) -{ - return irq - RT288X_GPIO_IRQ_BASE; -} - -static inline int gpio_get_value(unsigned gpio) -{ - if (gpio < RT288X_GPIO_COUNT) - return __rt288x_gpio_get_value(gpio); - - return __gpio_get_value(gpio); -} - -static inline void gpio_set_value(unsigned gpio, int value) -{ - if (gpio < RT288X_GPIO_COUNT) - __rt288x_gpio_set_value(gpio, value); - else - __gpio_set_value(gpio, value); -} - +#define gpio_get_value __gpio_get_value +#define gpio_set_value __gpio_set_value #define gpio_cansleep __gpio_cansleep +#define gpio_to_irq __gpio_to_irq -#endif /* __ASM_MACH_RT288X_GPIO_H */ +#endif /* __ASM_MACH_RALINK_GPIO_H */