gpio.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  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
  4. * for more details.
  5. *
  6. * Copyright (C) 2007 Aurelien Jarno <aurelien@aurel32.net>
  7. */
  8. #ifndef __BCM47XX_GPIO_H
  9. #define __BCM47XX_GPIO_H
  10. #define BCM47XX_EXTIF_GPIO_LINES 5
  11. #define BCM47XX_CHIPCO_GPIO_LINES 16
  12. extern int bcm47xx_gpio_to_irq(unsigned gpio);
  13. extern int bcm47xx_gpio_get_value(unsigned gpio);
  14. extern void bcm47xx_gpio_set_value(unsigned gpio, int value);
  15. extern int bcm47xx_gpio_direction_input(unsigned gpio);
  16. extern int bcm47xx_gpio_direction_output(unsigned gpio, int value);
  17. static inline int gpio_request(unsigned gpio, const char *label)
  18. {
  19. return 0;
  20. }
  21. static inline void gpio_free(unsigned gpio)
  22. {
  23. }
  24. static inline int gpio_to_irq(unsigned gpio)
  25. {
  26. return bcm47xx_gpio_to_irq(gpio);
  27. }
  28. static inline int gpio_get_value(unsigned gpio)
  29. {
  30. return bcm47xx_gpio_get_value(gpio);
  31. }
  32. static inline void gpio_set_value(unsigned gpio, int value)
  33. {
  34. bcm47xx_gpio_set_value(gpio, value);
  35. }
  36. static inline int gpio_direction_input(unsigned gpio)
  37. {
  38. return bcm47xx_gpio_direction_input(gpio);
  39. }
  40. static inline int gpio_direction_output(unsigned gpio, int value)
  41. {
  42. return bcm47xx_gpio_direction_output(gpio, value);
  43. }
  44. /* cansleep wrappers */
  45. #include <asm-generic/gpio.h>
  46. #endif /* __BCM47XX_GPIO_H */