2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
6 * Copyright (C) 2007 Aurelien Jarno <aurelien@aurel32.net>
9 #ifndef __BCM47XX_GPIO_H
10 #define __BCM47XX_GPIO_H
12 #define BCM47XX_EXTIF_GPIO_LINES 5
13 #define BCM47XX_CHIPCO_GPIO_LINES 16
15 extern int bcm47xx_gpio_to_irq(unsigned gpio
);
16 extern int bcm47xx_gpio_get_value(unsigned gpio
);
17 extern void bcm47xx_gpio_set_value(unsigned gpio
, int value
);
18 extern int bcm47xx_gpio_direction_input(unsigned gpio
);
19 extern int bcm47xx_gpio_direction_output(unsigned gpio
, int value
);
21 static inline int gpio_request(unsigned gpio
, const char *label
)
26 static inline void gpio_free(unsigned gpio
)
30 static inline int gpio_to_irq(unsigned gpio
)
32 return bcm47xx_gpio_to_irq(gpio
);
35 static inline int gpio_get_value(unsigned gpio
)
37 return bcm47xx_gpio_get_value(gpio
);
40 static inline void gpio_set_value(unsigned gpio
, int value
)
42 bcm47xx_gpio_set_value(gpio
, value
);
45 static inline int gpio_direction_input(unsigned gpio
)
47 return bcm47xx_gpio_direction_input(gpio
);
50 static inline int gpio_direction_output(unsigned gpio
, int value
)
52 return bcm47xx_gpio_direction_output(gpio
, value
);
56 /* cansleep wrappers */
57 #include <asm-generic/gpio.h>
59 #endif /* __BCM47XX_GPIO_H */