2019-05-29 00:57:06 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2013-01-26 07:44:00 +08:00
|
|
|
/*
|
|
|
|
* STMicroelectronics magnetometers driver
|
|
|
|
*
|
|
|
|
* Copyright 2012-2013 STMicroelectronics Inc.
|
|
|
|
*
|
|
|
|
* Denis Ciocca <denis.ciocca@st.com>
|
|
|
|
* v. 1.0.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ST_MAGN_H
|
|
|
|
#define ST_MAGN_H
|
|
|
|
|
|
|
|
#include <linux/types.h>
|
|
|
|
#include <linux/iio/common/st_sensors.h>
|
|
|
|
|
2015-04-30 21:15:50 +08:00
|
|
|
#define LSM303DLH_MAGN_DEV_NAME "lsm303dlh_magn"
|
2013-01-26 07:44:00 +08:00
|
|
|
#define LSM303DLHC_MAGN_DEV_NAME "lsm303dlhc_magn"
|
|
|
|
#define LSM303DLM_MAGN_DEV_NAME "lsm303dlm_magn"
|
|
|
|
#define LIS3MDL_MAGN_DEV_NAME "lis3mdl"
|
2015-07-21 16:35:45 +08:00
|
|
|
#define LSM303AGR_MAGN_DEV_NAME "lsm303agr_magn"
|
2017-08-17 01:02:52 +08:00
|
|
|
#define LIS2MDL_MAGN_DEV_NAME "lis2mdl"
|
2018-10-26 10:38:10 +08:00
|
|
|
#define LSM9DS1_MAGN_DEV_NAME "lsm9ds1_magn"
|
2013-01-26 07:44:00 +08:00
|
|
|
|
2019-07-19 06:53:46 +08:00
|
|
|
const struct st_sensor_settings *st_magn_get_settings(const char *name);
|
2014-10-03 23:35:38 +08:00
|
|
|
int st_magn_common_probe(struct iio_dev *indio_dev);
|
2013-01-26 07:44:00 +08:00
|
|
|
void st_magn_common_remove(struct iio_dev *indio_dev);
|
|
|
|
|
|
|
|
#ifdef CONFIG_IIO_BUFFER
|
|
|
|
int st_magn_allocate_ring(struct iio_dev *indio_dev);
|
|
|
|
void st_magn_deallocate_ring(struct iio_dev *indio_dev);
|
2015-07-21 16:35:43 +08:00
|
|
|
int st_magn_trig_set_state(struct iio_trigger *trig, bool state);
|
|
|
|
#define ST_MAGN_TRIGGER_SET_STATE (&st_magn_trig_set_state)
|
2013-01-26 07:44:00 +08:00
|
|
|
#else /* CONFIG_IIO_BUFFER */
|
|
|
|
static inline int st_magn_probe_trigger(struct iio_dev *indio_dev, int irq)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
static inline void st_magn_remove_trigger(struct iio_dev *indio_dev, int irq)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
static inline int st_magn_allocate_ring(struct iio_dev *indio_dev)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
static inline void st_magn_deallocate_ring(struct iio_dev *indio_dev)
|
|
|
|
{
|
|
|
|
}
|
2016-03-30 04:27:27 +08:00
|
|
|
#define ST_MAGN_TRIGGER_SET_STATE NULL
|
2013-01-26 07:44:00 +08:00
|
|
|
#endif /* CONFIG_IIO_BUFFER */
|
|
|
|
|
|
|
|
#endif /* ST_MAGN_H */
|