home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / src / linux-headers-2.6.28-15 / arch / x86 / include / asm / mach-rdc321x / gpio.h next >
Encoding:
C/C++ Source or Header  |  2008-12-24  |  1.3 KB  |  61 lines

  1. #ifndef _ASM_X86_MACH_RDC321X_GPIO_H
  2. #define _ASM_X86_MACH_RDC321X_GPIO_H
  3.  
  4. #include <linux/kernel.h>
  5.  
  6. extern int rdc_gpio_get_value(unsigned gpio);
  7. extern void rdc_gpio_set_value(unsigned gpio, int value);
  8. extern int rdc_gpio_direction_input(unsigned gpio);
  9. extern int rdc_gpio_direction_output(unsigned gpio, int value);
  10. extern int rdc_gpio_request(unsigned gpio, const char *label);
  11. extern void rdc_gpio_free(unsigned gpio);
  12. extern void __init rdc321x_gpio_setup(void);
  13.  
  14. /* Wrappers for the arch-neutral GPIO API */
  15.  
  16. static inline int gpio_request(unsigned gpio, const char *label)
  17. {
  18.     return rdc_gpio_request(gpio, label);
  19. }
  20.  
  21. static inline void gpio_free(unsigned gpio)
  22. {
  23.     might_sleep();
  24.     rdc_gpio_free(gpio);
  25. }
  26.  
  27. static inline int gpio_direction_input(unsigned gpio)
  28. {
  29.     return rdc_gpio_direction_input(gpio);
  30. }
  31.  
  32. static inline int gpio_direction_output(unsigned gpio, int value)
  33. {
  34.     return rdc_gpio_direction_output(gpio, value);
  35. }
  36.  
  37. static inline int gpio_get_value(unsigned gpio)
  38. {
  39.     return rdc_gpio_get_value(gpio);
  40. }
  41.  
  42. static inline void gpio_set_value(unsigned gpio, int value)
  43. {
  44.     rdc_gpio_set_value(gpio, value);
  45. }
  46.  
  47. static inline int gpio_to_irq(unsigned gpio)
  48. {
  49.     return gpio;
  50. }
  51.  
  52. static inline int irq_to_gpio(unsigned irq)
  53. {
  54.     return irq;
  55. }
  56.  
  57. /* For cansleep */
  58. #include <asm-generic/gpio.h>
  59.  
  60. #endif /* _ASM_X86_MACH_RDC321X_GPIO_H */
  61.