xref: /linux/drivers/iio/magnetometer/st_magn.h (revision 9a87ffc99ec8eb8d35eed7c4f816d75f5cc9662e)
1fda8d26eSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */
2872e79adSDenis Ciocca /*
3872e79adSDenis Ciocca  * STMicroelectronics magnetometers driver
4872e79adSDenis Ciocca  *
5872e79adSDenis Ciocca  * Copyright 2012-2013 STMicroelectronics Inc.
6872e79adSDenis Ciocca  *
7872e79adSDenis Ciocca  * Denis Ciocca <denis.ciocca@st.com>
8872e79adSDenis Ciocca  * v. 1.0.0
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"
211e9676a8SGiuseppe Barba #define LSM303AGR_MAGN_DEV_NAME		"lsm303agr_magn"
22d0b7fea5SLorenzo Bianconi #define LIS2MDL_MAGN_DEV_NAME		"lis2mdl"
230d92aa2cSMartin Kelly #define LSM9DS1_MAGN_DEV_NAME		"lsm9ds1_magn"
24c71cfe55SLI Qingwu #define IIS2MDC_MAGN_DEV_NAME		"iis2mdc"
25*721a2a7eSStephan Gerhold #define LSM303C_MAGN_DEV_NAME		"lsm303c_magn"
26872e79adSDenis Ciocca 
27872e79adSDenis Ciocca #ifdef CONFIG_IIO_BUFFER
28872e79adSDenis Ciocca int st_magn_allocate_ring(struct iio_dev *indio_dev);
2974f5683fSGiuseppe Barba int st_magn_trig_set_state(struct iio_trigger *trig, bool state);
3074f5683fSGiuseppe Barba #define ST_MAGN_TRIGGER_SET_STATE (&st_magn_trig_set_state)
31872e79adSDenis Ciocca #else /* CONFIG_IIO_BUFFER */
st_magn_allocate_ring(struct iio_dev * indio_dev)32872e79adSDenis Ciocca static inline int st_magn_allocate_ring(struct iio_dev *indio_dev)
33872e79adSDenis Ciocca {
34872e79adSDenis Ciocca 	return 0;
35872e79adSDenis Ciocca }
369b090a98SArnd Bergmann #define ST_MAGN_TRIGGER_SET_STATE NULL
37872e79adSDenis Ciocca #endif /* CONFIG_IIO_BUFFER */
38872e79adSDenis Ciocca 
39872e79adSDenis Ciocca #endif /* ST_MAGN_H */
40