7 #ifndef _GPIO_AU1300_H_
8 #define _GPIO_AU1300_H_
10 #include <asm/addrspace.h>
21 #define AU1300_GPIO_BASE 0
22 #define AU1300_GPIO_NUM 75
23 #define AU1300_GPIO_MAX (AU1300_GPIO_BASE + AU1300_GPIO_NUM - 1)
25 #define AU1300_GPIC_ADDR \
26 (void __iomem *)KSEG1ADDR(AU1300_GPIC_PHYS_ADDR)
28 static inline int au1300_gpio_get_value(
unsigned int gpio)
39 static inline int au1300_gpio_direction_input(
unsigned int gpio)
54 static inline int au1300_gpio_set_value(
unsigned int gpio,
int v)
70 static inline int au1300_gpio_direction_output(
unsigned int gpio,
int v)
73 return au1300_gpio_set_value(gpio, v);
76 static inline int au1300_gpio_to_irq(
unsigned int gpio)
81 static inline int au1300_irq_to_gpio(
unsigned int irq)
86 static inline int au1300_gpio_is_valid(
unsigned int gpio)
90 switch (alchemy_get_cputype()) {
100 static inline int au1300_gpio_cansleep(
unsigned int gpio)
106 static inline int au1300_gpio_getinitlvl(
unsigned int gpio)
113 else if (gpio > 31) {
119 return (v >> gpio) & 1;
148 #ifndef CONFIG_GPIOLIB
150 #ifdef CONFIG_ALCHEMY_GPIOINT_AU1300
152 #ifndef CONFIG_ALCHEMY_GPIO_INDIRECT
156 return au1300_gpio_direction_input(gpio);
161 return au1300_gpio_direction_output(gpio, v);
166 return au1300_gpio_get_value(gpio);
171 au1300_gpio_set_value(gpio, v);
184 static inline int gpio_is_valid(
unsigned int gpio)
186 return au1300_gpio_is_valid(gpio);
191 return au1300_gpio_cansleep(gpio);
196 return au1300_gpio_to_irq(gpio);
201 return au1300_irq_to_gpio(irq);
220 static inline void gpio_free(
unsigned gpio)
233 static inline void gpio_unexport(
unsigned gpio)
237 static inline int gpio_export(
unsigned gpio,
bool direction_may_change)
242 static inline int gpio_sysfs_set_active_low(
unsigned gpio,
int value)
247 static inline int gpio_export_link(
struct device *
dev,
const char *
name,