st_pressure.h 988 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * STMicroelectronics pressures driver
  3. *
  4. * Copyright 2013 STMicroelectronics Inc.
  5. *
  6. * Denis Ciocca <denis.ciocca@st.com>
  7. * v. 1.0.0
  8. * Licensed under the GPL-2.
  9. */
  10. #ifndef ST_PRESS_H
  11. #define ST_PRESS_H
  12. #include <linux/types.h>
  13. #include <linux/iio/common/st_sensors.h>
  14. #define LPS331AP_PRESS_DEV_NAME "lps331ap"
  15. int st_press_common_probe(struct iio_dev *indio_dev);
  16. void st_press_common_remove(struct iio_dev *indio_dev);
  17. #ifdef CONFIG_IIO_BUFFER
  18. int st_press_allocate_ring(struct iio_dev *indio_dev);
  19. void st_press_deallocate_ring(struct iio_dev *indio_dev);
  20. int st_press_trig_set_state(struct iio_trigger *trig, bool state);
  21. #define ST_PRESS_TRIGGER_SET_STATE (&st_press_trig_set_state)
  22. #else /* CONFIG_IIO_BUFFER */
  23. static inline int st_press_allocate_ring(struct iio_dev *indio_dev)
  24. {
  25. return 0;
  26. }
  27. static inline void st_press_deallocate_ring(struct iio_dev *indio_dev)
  28. {
  29. }
  30. #define ST_PRESS_TRIGGER_SET_STATE NULL
  31. #endif /* CONFIG_IIO_BUFFER */
  32. #endif /* ST_PRESS_H */