gpio.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. static inline int gpio_to_irq(unsigned int gpio)
  35. {
  36. return __gpio_to_irq(gpio);
  37. }
  38. static inline int irq_to_gpio(unsigned int irq)
  39. {
  40. return -EINVAL;
  41. }
  42. #endif /* CONFIG_GPIOLIB */
  43. #endif /* __ASM_POWERPC_GPIO_H */