st_magn.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. struct st_sensors_platform_data *pdata);
  19. void st_magn_common_remove(struct iio_dev *indio_dev);
  20. #ifdef CONFIG_IIO_BUFFER
  21. int st_magn_allocate_ring(struct iio_dev *indio_dev);
  22. void st_magn_deallocate_ring(struct iio_dev *indio_dev);
  23. #else /* CONFIG_IIO_BUFFER */
  24. static inline int st_magn_probe_trigger(struct iio_dev *indio_dev, int irq)
  25. {
  26. return 0;
  27. }
  28. static inline void st_magn_remove_trigger(struct iio_dev *indio_dev, int irq)
  29. {
  30. return;
  31. }
  32. static inline int st_magn_allocate_ring(struct iio_dev *indio_dev)
  33. {
  34. return 0;
  35. }
  36. static inline void st_magn_deallocate_ring(struct iio_dev *indio_dev)
  37. {
  38. }
  39. #endif /* CONFIG_IIO_BUFFER */
  40. #endif /* ST_MAGN_H */