gpio.h 910 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Generic GPIO API and pinmux table support
  3. *
  4. * Copyright (c) 2008 Magnus Damm
  5. *
  6. * This file is subject to the terms and conditions of the GNU General Public
  7. * License. See the file "COPYING" in the main directory of this archive
  8. * for more details.
  9. */
  10. #ifndef __ASM_ARCH_GPIO_H
  11. #define __ASM_ARCH_GPIO_H
  12. #include <linux/kernel.h>
  13. #include <linux/errno.h>
  14. #define ARCH_NR_GPIOS 1024
  15. #include <linux/sh_pfc.h>
  16. #ifdef CONFIG_GPIOLIB
  17. static inline int gpio_get_value(unsigned gpio)
  18. {
  19. return __gpio_get_value(gpio);
  20. }
  21. static inline void gpio_set_value(unsigned gpio, int value)
  22. {
  23. __gpio_set_value(gpio, value);
  24. }
  25. static inline int gpio_cansleep(unsigned gpio)
  26. {
  27. return __gpio_cansleep(gpio);
  28. }
  29. static inline int gpio_to_irq(unsigned gpio)
  30. {
  31. return -ENOSYS;
  32. }
  33. static inline int irq_to_gpio(unsigned int irq)
  34. {
  35. return -EINVAL;
  36. }
  37. #endif /* CONFIG_GPIOLIB */
  38. #endif /* __ASM_ARCH_GPIO_H */