MIPS: Au1000: convert to using gpiolib
This patch converts the GPIO board code to use gpiolib. Signed-off-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
This commit is contained in:

committed by
Ralf Baechle

parent
12e22e8e60
commit
47c969ee54
@@ -5,65 +5,29 @@
|
||||
|
||||
#define AU1XXX_GPIO_BASE 200
|
||||
|
||||
struct au1x00_gpio2 {
|
||||
u32 dir;
|
||||
u32 reserved;
|
||||
u32 output;
|
||||
u32 pinstate;
|
||||
u32 inten;
|
||||
u32 enable;
|
||||
};
|
||||
/* GPIO bank 1 offsets */
|
||||
#define AU1000_GPIO1_TRI_OUT 0x0100
|
||||
#define AU1000_GPIO1_OUT 0x0108
|
||||
#define AU1000_GPIO1_ST 0x0110
|
||||
#define AU1000_GPIO1_CLR 0x010C
|
||||
|
||||
extern int au1xxx_gpio_get_value(unsigned gpio);
|
||||
extern void au1xxx_gpio_set_value(unsigned gpio, int value);
|
||||
extern int au1xxx_gpio_direction_input(unsigned gpio);
|
||||
extern int au1xxx_gpio_direction_output(unsigned gpio, int value);
|
||||
/* GPIO bank 2 offsets */
|
||||
#define AU1000_GPIO2_DIR 0x00
|
||||
#define AU1000_GPIO2_RSVD 0x04
|
||||
#define AU1000_GPIO2_OUT 0x08
|
||||
#define AU1000_GPIO2_ST 0x0C
|
||||
#define AU1000_GPIO2_INT 0x10
|
||||
#define AU1000_GPIO2_EN 0x14
|
||||
|
||||
#define GPIO2_OUT_EN_MASK 0x00010000
|
||||
|
||||
/* Wrappers for the arch-neutral GPIO API */
|
||||
#define gpio_to_irq(gpio) NULL
|
||||
|
||||
static inline int gpio_request(unsigned gpio, const char *label)
|
||||
{
|
||||
/* Not yet implemented */
|
||||
return 0;
|
||||
}
|
||||
#define gpio_get_value __gpio_get_value
|
||||
#define gpio_set_value __gpio_set_value
|
||||
|
||||
static inline void gpio_free(unsigned gpio)
|
||||
{
|
||||
/* Not yet implemented */
|
||||
}
|
||||
#define gpio_cansleep __gpio_cansleep
|
||||
|
||||
static inline int gpio_direction_input(unsigned gpio)
|
||||
{
|
||||
return au1xxx_gpio_direction_input(gpio);
|
||||
}
|
||||
|
||||
static inline int gpio_direction_output(unsigned gpio, int value)
|
||||
{
|
||||
return au1xxx_gpio_direction_output(gpio, value);
|
||||
}
|
||||
|
||||
static inline int gpio_get_value(unsigned gpio)
|
||||
{
|
||||
return au1xxx_gpio_get_value(gpio);
|
||||
}
|
||||
|
||||
static inline void gpio_set_value(unsigned gpio, int value)
|
||||
{
|
||||
au1xxx_gpio_set_value(gpio, value);
|
||||
}
|
||||
|
||||
static inline int gpio_to_irq(unsigned gpio)
|
||||
{
|
||||
return gpio;
|
||||
}
|
||||
|
||||
static inline int irq_to_gpio(unsigned irq)
|
||||
{
|
||||
return irq;
|
||||
}
|
||||
|
||||
/* For cansleep */
|
||||
#include <asm-generic/gpio.h>
|
||||
|
||||
#endif /* _AU1XXX_GPIO_H_ */
|
||||
|
Reference in New Issue
Block a user