gpio.h 1017 B

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