xref: /linux/drivers/iio/magnetometer/st_magn.h (revision 4b132aacb0768ac1e652cf517097ea6f237214b9)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * STMicroelectronics magnetometers driver
4  *
5  * Copyright 2012-2013 STMicroelectronics Inc.
6  *
7  * Denis Ciocca <denis.ciocca@st.com>
8  * v. 1.0.0
9  */
10 
11 #ifndef ST_MAGN_H
12 #define ST_MAGN_H
13 
14 #include <linux/types.h>
15 #include <linux/iio/common/st_sensors.h>
16 
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"
24 #define IIS2MDC_MAGN_DEV_NAME		"iis2mdc"
25 #define LSM303C_MAGN_DEV_NAME		"lsm303c_magn"
26 
27 #ifdef CONFIG_IIO_BUFFER
28 int st_magn_allocate_ring(struct iio_dev *indio_dev);
29 int st_magn_trig_set_state(struct iio_trigger *trig, bool state);
30 #define ST_MAGN_TRIGGER_SET_STATE (&st_magn_trig_set_state)
31 #else /* CONFIG_IIO_BUFFER */
32 static inline int st_magn_allocate_ring(struct iio_dev *indio_dev)
33 {
34 	return 0;
35 }
36 #define ST_MAGN_TRIGGER_SET_STATE NULL
37 #endif /* CONFIG_IIO_BUFFER */
38 
39 #endif /* ST_MAGN_H */
40