st_magn.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * STMicroelectronics magnetometers 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_MAGN_H
  11. #define ST_MAGN_H
  12. #include <linux/types.h>
  13. #include <linux/iio/common/st_sensors.h>
  14. #define LSM303DLH_MAGN_DEV_NAME "lsm303dlh_magn"
  15. #define LSM303DLHC_MAGN_DEV_NAME "lsm303dlhc_magn"
  16. #define LSM303DLM_MAGN_DEV_NAME "lsm303dlm_magn"
  17. #define LIS3MDL_MAGN_DEV_NAME "lis3mdl"
  18. #define LSM303AGR_MAGN_DEV_NAME "lsm303agr_magn"
  19. int st_magn_common_probe(struct iio_dev *indio_dev);
  20. void st_magn_common_remove(struct iio_dev *indio_dev);
  21. #ifdef CONFIG_IIO_BUFFER
  22. int st_magn_allocate_ring(struct iio_dev *indio_dev);
  23. void st_magn_deallocate_ring(struct iio_dev *indio_dev);
  24. int st_magn_trig_set_state(struct iio_trigger *trig, bool state);
  25. #define ST_MAGN_TRIGGER_SET_STATE (&st_magn_trig_set_state)
  26. #else /* CONFIG_IIO_BUFFER */
  27. static inline int st_magn_probe_trigger(struct iio_dev *indio_dev, int irq)
  28. {
  29. return 0;
  30. }
  31. static inline void st_magn_remove_trigger(struct iio_dev *indio_dev, int irq)
  32. {
  33. return;
  34. }
  35. static inline int st_magn_allocate_ring(struct iio_dev *indio_dev)
  36. {
  37. return 0;
  38. }
  39. static inline void st_magn_deallocate_ring(struct iio_dev *indio_dev)
  40. {
  41. }
  42. #define ST_MAGN_TRIGGER_SET_STATE NULL
  43. #endif /* CONFIG_IIO_BUFFER */
  44. #endif /* ST_MAGN_H */