gpio.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Generic GPIO API implementation for x86.
  3. *
  4. * Derived from the generic GPIO API for powerpc:
  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_I386_GPIO_H
  16. #define _ASM_I386_GPIO_H
  17. #ifdef CONFIG_X86_RDC321X
  18. #include <gpio.h>
  19. #else /* CONFIG_X86_RDC321X */
  20. #include <asm-generic/gpio.h>
  21. #ifdef CONFIG_GPIOLIB
  22. /*
  23. * Just call gpiolib.
  24. */
  25. static inline int gpio_get_value(unsigned int gpio)
  26. {
  27. return __gpio_get_value(gpio);
  28. }
  29. static inline void gpio_set_value(unsigned int gpio, int value)
  30. {
  31. __gpio_set_value(gpio, value);
  32. }
  33. static inline int gpio_cansleep(unsigned int gpio)
  34. {
  35. return __gpio_cansleep(gpio);
  36. }
  37. /*
  38. * Not implemented, yet.
  39. */
  40. static inline int gpio_to_irq(unsigned int gpio)
  41. {
  42. return -ENOSYS;
  43. }
  44. static inline int irq_to_gpio(unsigned int irq)
  45. {
  46. return -EINVAL;
  47. }
  48. #endif /* CONFIG_GPIOLIB */
  49. #endif /* CONFIG_X86_RDC321X */
  50. #endif /* ASM_X86__GPIO_H */