gpio.h 851 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* SPDX-License-Identifier: GPL-2.0
  2. *
  3. * include/asm-sh/gpio.h
  4. *
  5. * Generic GPIO API and pinmux table support for SuperH.
  6. *
  7. * Copyright (c) 2008 Magnus Damm
  8. */
  9. #ifndef __ASM_SH_GPIO_H
  10. #define __ASM_SH_GPIO_H
  11. #include <linux/kernel.h>
  12. #include <linux/errno.h>
  13. #if defined(CONFIG_CPU_SH3)
  14. #include <cpu/gpio.h>
  15. #endif
  16. #include <asm-generic/gpio.h>
  17. #ifdef CONFIG_GPIOLIB
  18. static inline int gpio_get_value(unsigned gpio)
  19. {
  20. return __gpio_get_value(gpio);
  21. }
  22. static inline void gpio_set_value(unsigned gpio, int value)
  23. {
  24. __gpio_set_value(gpio, value);
  25. }
  26. static inline int gpio_cansleep(unsigned gpio)
  27. {
  28. return __gpio_cansleep(gpio);
  29. }
  30. static inline int gpio_to_irq(unsigned gpio)
  31. {
  32. return __gpio_to_irq(gpio);
  33. }
  34. static inline int irq_to_gpio(unsigned int irq)
  35. {
  36. return -ENOSYS;
  37. }
  38. #endif /* CONFIG_GPIOLIB */
  39. #endif /* __ASM_SH_GPIO_H */