st_gyro.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * STMicroelectronics gyroscopes driver
  3. *
  4. * Copyright 2012-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_GYRO_H
  11. #define ST_GYRO_H
  12. #include <linux/types.h>
  13. #include <linux/iio/common/st_sensors.h>
  14. #define L3G4200D_GYRO_DEV_NAME "l3g4200d"
  15. #define LSM330D_GYRO_DEV_NAME "lsm330d_gyro"
  16. #define LSM330DL_GYRO_DEV_NAME "lsm330dl_gyro"
  17. #define LSM330DLC_GYRO_DEV_NAME "lsm330dlc_gyro"
  18. #define L3GD20_GYRO_DEV_NAME "l3gd20"
  19. #define L3GD20H_GYRO_DEV_NAME "l3gd20h"
  20. #define L3G4IS_GYRO_DEV_NAME "l3g4is_ui"
  21. #define LSM330_GYRO_DEV_NAME "lsm330_gyro"
  22. int st_gyro_common_probe(struct iio_dev *indio_dev);
  23. void st_gyro_common_remove(struct iio_dev *indio_dev);
  24. #ifdef CONFIG_IIO_BUFFER
  25. int st_gyro_allocate_ring(struct iio_dev *indio_dev);
  26. void st_gyro_deallocate_ring(struct iio_dev *indio_dev);
  27. int st_gyro_trig_set_state(struct iio_trigger *trig, bool state);
  28. #define ST_GYRO_TRIGGER_SET_STATE (&st_gyro_trig_set_state)
  29. #else /* CONFIG_IIO_BUFFER */
  30. static inline int st_gyro_allocate_ring(struct iio_dev *indio_dev)
  31. {
  32. return 0;
  33. }
  34. static inline void st_gyro_deallocate_ring(struct iio_dev *indio_dev)
  35. {
  36. }
  37. #define ST_GYRO_TRIGGER_SET_STATE NULL
  38. #endif /* CONFIG_IIO_BUFFER */
  39. #endif /* ST_GYRO_H */