WIP FPC-III support
[linux/fpc-iii.git] / drivers / iio / magnetometer / st_magn.h
blob204b285725c8aaf6e60db6c92e14a4a4adf6e04f
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * STMicroelectronics magnetometers driver
5 * Copyright 2012-2013 STMicroelectronics Inc.
7 * Denis Ciocca <denis.ciocca@st.com>
8 * v. 1.0.0
9 */
11 #ifndef ST_MAGN_H
12 #define ST_MAGN_H
14 #include <linux/types.h>
15 #include <linux/iio/common/st_sensors.h>
17 #define LSM303DLH_MAGN_DEV_NAME "lsm303dlh_magn"
18 #define LSM303DLHC_MAGN_DEV_NAME "lsm303dlhc_magn"
19 #define LSM303DLM_MAGN_DEV_NAME "lsm303dlm_magn"
20 #define LIS3MDL_MAGN_DEV_NAME "lis3mdl"
21 #define LSM303AGR_MAGN_DEV_NAME "lsm303agr_magn"
22 #define LIS2MDL_MAGN_DEV_NAME "lis2mdl"
23 #define LSM9DS1_MAGN_DEV_NAME "lsm9ds1_magn"
25 const struct st_sensor_settings *st_magn_get_settings(const char *name);
26 int st_magn_common_probe(struct iio_dev *indio_dev);
27 void st_magn_common_remove(struct iio_dev *indio_dev);
29 #ifdef CONFIG_IIO_BUFFER
30 int st_magn_allocate_ring(struct iio_dev *indio_dev);
31 void st_magn_deallocate_ring(struct iio_dev *indio_dev);
32 int st_magn_trig_set_state(struct iio_trigger *trig, bool state);
33 #define ST_MAGN_TRIGGER_SET_STATE (&st_magn_trig_set_state)
34 #else /* CONFIG_IIO_BUFFER */
35 static inline int st_magn_probe_trigger(struct iio_dev *indio_dev, int irq)
37 return 0;
39 static inline void st_magn_remove_trigger(struct iio_dev *indio_dev, int irq)
41 return;
43 static inline int st_magn_allocate_ring(struct iio_dev *indio_dev)
45 return 0;
47 static inline void st_magn_deallocate_ring(struct iio_dev *indio_dev)
50 #define ST_MAGN_TRIGGER_SET_STATE NULL
51 #endif /* CONFIG_IIO_BUFFER */
53 #endif /* ST_MAGN_H */