st_magn.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 LSM303DLHC_MAGN_DEV_NAME "lsm303dlhc_magn"
  15. #define LSM303DLM_MAGN_DEV_NAME "lsm303dlm_magn"
  16. #define LIS3MDL_MAGN_DEV_NAME "lis3mdl"
  17. int st_magn_common_probe(struct iio_dev *indio_dev);
  18. void st_magn_common_remove(struct iio_dev *indio_dev);
  19. #ifdef CONFIG_IIO_BUFFER
  20. int st_magn_allocate_ring(struct iio_dev *indio_dev);
  21. void st_magn_deallocate_ring(struct iio_dev *indio_dev);
  22. #else /* CONFIG_IIO_BUFFER */
  23. static inline int st_magn_probe_trigger(struct iio_dev *indio_dev, int irq)
  24. {
  25. return 0;
  26. }
  27. static inline void st_magn_remove_trigger(struct iio_dev *indio_dev, int irq)
  28. {
  29. return;
  30. }
  31. static inline int st_magn_allocate_ring(struct iio_dev *indio_dev)
  32. {
  33. return 0;
  34. }
  35. static inline void st_magn_deallocate_ring(struct iio_dev *indio_dev)
  36. {
  37. }
  38. #endif /* CONFIG_IIO_BUFFER */
  39. #endif /* ST_MAGN_H */