st_pressure.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * STMicroelectronics pressures driver
  4. *
  5. * Copyright 2013 STMicroelectronics Inc.
  6. *
  7. * Denis Ciocca <[email protected]>
  8. * v. 1.0.0
  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. LPS22HH,
  22. LPS22DF,
  23. ST_PRESS_MAX,
  24. };
  25. #define LPS001WP_PRESS_DEV_NAME "lps001wp"
  26. #define LPS25H_PRESS_DEV_NAME "lps25h"
  27. #define LPS331AP_PRESS_DEV_NAME "lps331ap"
  28. #define LPS22HB_PRESS_DEV_NAME "lps22hb"
  29. #define LPS33HW_PRESS_DEV_NAME "lps33hw"
  30. #define LPS35HW_PRESS_DEV_NAME "lps35hw"
  31. #define LPS22HH_PRESS_DEV_NAME "lps22hh"
  32. #define LPS22DF_PRESS_DEV_NAME "lps22df"
  33. /**
  34. * struct st_sensors_platform_data - default press platform data
  35. * @drdy_int_pin: default press DRDY is available on INT1 pin.
  36. */
  37. static __maybe_unused const struct st_sensors_platform_data default_press_pdata = {
  38. .drdy_int_pin = 1,
  39. };
  40. #ifdef CONFIG_IIO_BUFFER
  41. int st_press_allocate_ring(struct iio_dev *indio_dev);
  42. int st_press_trig_set_state(struct iio_trigger *trig, bool state);
  43. #define ST_PRESS_TRIGGER_SET_STATE (&st_press_trig_set_state)
  44. #else /* CONFIG_IIO_BUFFER */
  45. static inline int st_press_allocate_ring(struct iio_dev *indio_dev)
  46. {
  47. return 0;
  48. }
  49. #define ST_PRESS_TRIGGER_SET_STATE NULL
  50. #endif /* CONFIG_IIO_BUFFER */
  51. #endif /* ST_PRESS_H */