gpio.h 521 B

12345678910111213141516171819202122232425
  1. #ifndef _ASM_GENERIC_GPIO_H
  2. #define _ASM_GENERIC_GPIO_H
  3. /* platforms that don't directly support access to GPIOs through I2C, SPI,
  4. * or other blocking infrastructure can use these wrappers.
  5. */
  6. static inline int gpio_cansleep(unsigned gpio)
  7. {
  8. return 0;
  9. }
  10. static inline int gpio_get_value_cansleep(unsigned gpio)
  11. {
  12. might_sleep();
  13. return gpio_get_value(gpio);
  14. }
  15. static inline void gpio_set_value_cansleep(unsigned gpio, int value)
  16. {
  17. might_sleep();
  18. gpio_set_value(gpio, value);
  19. }
  20. #endif /* _ASM_GENERIC_GPIO_H */