gpio.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 <linux/sh_pfc.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. WARN_ON(1);
  37. return -ENOSYS;
  38. }
  39. static inline int irq_to_gpio(unsigned int irq)
  40. {
  41. WARN_ON(1);
  42. return -EINVAL;
  43. }
  44. #endif /* CONFIG_GPIOLIB */
  45. #endif /* __ASM_SH_GPIO_H */