st_accel.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * STMicroelectronics accelerometers 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_ACCEL_H
  11. #define ST_ACCEL_H
  12. #include <linux/types.h>
  13. #include <linux/iio/common/st_sensors.h>
  14. #define LIS3LV02DL_ACCEL_DEV_NAME "lis3lv02dl_accel"
  15. #define LSM303DLHC_ACCEL_DEV_NAME "lsm303dlhc_accel"
  16. #define LIS3DH_ACCEL_DEV_NAME "lis3dh"
  17. #define LSM330D_ACCEL_DEV_NAME "lsm330d_accel"
  18. #define LSM330DL_ACCEL_DEV_NAME "lsm330dl_accel"
  19. #define LSM330DLC_ACCEL_DEV_NAME "lsm330dlc_accel"
  20. #define LIS331DL_ACCEL_DEV_NAME "lis331dl_accel"
  21. #define LIS331DLH_ACCEL_DEV_NAME "lis331dlh"
  22. #define LSM303DL_ACCEL_DEV_NAME "lsm303dl_accel"
  23. #define LSM303DLH_ACCEL_DEV_NAME "lsm303dlh_accel"
  24. #define LSM303DLM_ACCEL_DEV_NAME "lsm303dlm_accel"
  25. #define LSM330_ACCEL_DEV_NAME "lsm330_accel"
  26. #define LSM303AGR_ACCEL_DEV_NAME "lsm303agr_accel"
  27. /**
  28. * struct st_sensors_platform_data - default accel platform data
  29. * @drdy_int_pin: default accel DRDY is available on INT1 pin.
  30. */
  31. static const struct st_sensors_platform_data default_accel_pdata = {
  32. .drdy_int_pin = 1,
  33. };
  34. int st_accel_common_probe(struct iio_dev *indio_dev);
  35. void st_accel_common_remove(struct iio_dev *indio_dev);
  36. #ifdef CONFIG_IIO_BUFFER
  37. int st_accel_allocate_ring(struct iio_dev *indio_dev);
  38. void st_accel_deallocate_ring(struct iio_dev *indio_dev);
  39. int st_accel_trig_set_state(struct iio_trigger *trig, bool state);
  40. #define ST_ACCEL_TRIGGER_SET_STATE (&st_accel_trig_set_state)
  41. #else /* CONFIG_IIO_BUFFER */
  42. static inline int st_accel_allocate_ring(struct iio_dev *indio_dev)
  43. {
  44. return 0;
  45. }
  46. static inline void st_accel_deallocate_ring(struct iio_dev *indio_dev)
  47. {
  48. }
  49. #define ST_ACCEL_TRIGGER_SET_STATE NULL
  50. #endif /* CONFIG_IIO_BUFFER */
  51. #endif /* ST_ACCEL_H */