1872e79adSDenis Ciocca /* 2872e79adSDenis Ciocca * STMicroelectronics magnetometers driver 3872e79adSDenis Ciocca * 4872e79adSDenis Ciocca * Copyright 2012-2013 STMicroelectronics Inc. 5872e79adSDenis Ciocca * 6872e79adSDenis Ciocca * Denis Ciocca <denis.ciocca@st.com> 7872e79adSDenis Ciocca * v. 1.0.0 8872e79adSDenis Ciocca * Licensed under the GPL-2. 9872e79adSDenis Ciocca */ 10872e79adSDenis Ciocca 11872e79adSDenis Ciocca #ifndef ST_MAGN_H 12872e79adSDenis Ciocca #define ST_MAGN_H 13872e79adSDenis Ciocca 14872e79adSDenis Ciocca #include <linux/types.h> 15872e79adSDenis Ciocca #include <linux/iio/common/st_sensors.h> 16872e79adSDenis Ciocca 171038a687SLinus Walleij #define LSM303DLH_MAGN_DEV_NAME "lsm303dlh_magn" 18872e79adSDenis Ciocca #define LSM303DLHC_MAGN_DEV_NAME "lsm303dlhc_magn" 19872e79adSDenis Ciocca #define LSM303DLM_MAGN_DEV_NAME "lsm303dlm_magn" 20872e79adSDenis Ciocca #define LIS3MDL_MAGN_DEV_NAME "lis3mdl" 21872e79adSDenis Ciocca 222109eb4cSDenis CIOCCA int st_magn_common_probe(struct iio_dev *indio_dev); 23872e79adSDenis Ciocca void st_magn_common_remove(struct iio_dev *indio_dev); 24872e79adSDenis Ciocca 25872e79adSDenis Ciocca #ifdef CONFIG_IIO_BUFFER 26872e79adSDenis Ciocca int st_magn_allocate_ring(struct iio_dev *indio_dev); 27872e79adSDenis Ciocca void st_magn_deallocate_ring(struct iio_dev *indio_dev); 28*74f5683fSGiuseppe Barba int st_magn_trig_set_state(struct iio_trigger *trig, bool state); 29*74f5683fSGiuseppe Barba #define ST_MAGN_TRIGGER_SET_STATE (&st_magn_trig_set_state) 30872e79adSDenis Ciocca #else /* CONFIG_IIO_BUFFER */ 31872e79adSDenis Ciocca static inline int st_magn_probe_trigger(struct iio_dev *indio_dev, int irq) 32872e79adSDenis Ciocca { 33872e79adSDenis Ciocca return 0; 34872e79adSDenis Ciocca } 35872e79adSDenis Ciocca static inline void st_magn_remove_trigger(struct iio_dev *indio_dev, int irq) 36872e79adSDenis Ciocca { 37872e79adSDenis Ciocca return; 38872e79adSDenis Ciocca } 39872e79adSDenis Ciocca static inline int st_magn_allocate_ring(struct iio_dev *indio_dev) 40872e79adSDenis Ciocca { 41872e79adSDenis Ciocca return 0; 42872e79adSDenis Ciocca } 43872e79adSDenis Ciocca static inline void st_magn_deallocate_ring(struct iio_dev *indio_dev) 44872e79adSDenis Ciocca { 45872e79adSDenis Ciocca } 46872e79adSDenis Ciocca #endif /* CONFIG_IIO_BUFFER */ 47872e79adSDenis Ciocca 48872e79adSDenis Ciocca #endif /* ST_MAGN_H */ 49