st_pressure.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. enum st_press_type {
  15. LPS001WP,
  16. LPS25H,
  17. LPS331AP,
  18. LPS22HB,
  19. LPS33HW,
  20. LPS35HW,
  21. ST_PRESS_MAX,
  22. };
  23. #define LPS001WP_PRESS_DEV_NAME "lps001wp"
  24. #define LPS25H_PRESS_DEV_NAME "lps25h"
  25. #define LPS331AP_PRESS_DEV_NAME "lps331ap"
  26. #define LPS22HB_PRESS_DEV_NAME "lps22hb"
  27. #define LPS33HW_PRESS_DEV_NAME "lps33hw"
  28. #define LPS35HW_PRESS_DEV_NAME "lps35hw"
  29. /**
  30. * struct st_sensors_platform_data - default press platform data
  31. * @drdy_int_pin: default press DRDY is available on INT1 pin.
  32. */
  33. static const struct st_sensors_platform_data default_press_pdata = {
  34. .drdy_int_pin = 1,
  35. };
  36. int st_press_common_probe(struct iio_dev *indio_dev);
  37. void st_press_common_remove(struct iio_dev *indio_dev);
  38. #ifdef CONFIG_IIO_BUFFER
  39. int st_press_allocate_ring(struct iio_dev *indio_dev);
  40. void st_press_deallocate_ring(struct iio_dev *indio_dev);
  41. int st_press_trig_set_state(struct iio_trigger *trig, bool state);
  42. #define ST_PRESS_TRIGGER_SET_STATE (&st_press_trig_set_state)
  43. #else /* CONFIG_IIO_BUFFER */
  44. static inline int st_press_allocate_ring(struct iio_dev *indio_dev)
  45. {
  46. return 0;
  47. }
  48. static inline void st_press_deallocate_ring(struct iio_dev *indio_dev)
  49. {
  50. }
  51. #define ST_PRESS_TRIGGER_SET_STATE NULL
  52. #endif /* CONFIG_IIO_BUFFER */
  53. #endif /* ST_PRESS_H */