gpio.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * Generic GPIO API implementation for Alpha.
  3. *
  4. * A stright copy of that for PowerPC which was:
  5. *
  6. * Copyright (c) 2007-2008 MontaVista Software, Inc.
  7. *
  8. * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License as published by
  12. * the Free Software Foundation; either version 2 of the License, or
  13. * (at your option) any later version.
  14. */
  15. #ifndef _ASM_ALPHA_GPIO_H
  16. #define _ASM_ALPHA_GPIO_H
  17. #include <linux/errno.h>
  18. #include <asm-generic/gpio.h>
  19. #ifdef CONFIG_GPIOLIB
  20. /*
  21. * We don't (yet) implement inlined/rapid versions for on-chip gpios.
  22. * Just call gpiolib.
  23. */
  24. static inline int gpio_get_value(unsigned int gpio)
  25. {
  26. return __gpio_get_value(gpio);
  27. }
  28. static inline void gpio_set_value(unsigned int gpio, int value)
  29. {
  30. __gpio_set_value(gpio, value);
  31. }
  32. static inline int gpio_cansleep(unsigned int gpio)
  33. {
  34. return __gpio_cansleep(gpio);
  35. }
  36. static inline int gpio_to_irq(unsigned int gpio)
  37. {
  38. return __gpio_to_irq(gpio);
  39. }
  40. static inline int irq_to_gpio(unsigned int irq)
  41. {
  42. return -EINVAL;
  43. }
  44. #endif /* CONFIG_GPIOLIB */
  45. #endif /* _ASM_ALPHA_GPIO_H */