gpio.h 1.1 KB

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