2019-05-28 09:57:06 -07:00
/* SPDX-License-Identifier: GPL-2.0-only */
iio:accel: Add STMicroelectronics accelerometers driver
This patch adds a generic accelerometer driver for STMicroelectronics
accelerometers, currently it supports:
LSM303DLH, LSM303DLHC, LIS3DH, LSM330D, LSM330DL, LSM330DLC,
LIS331DLH, LSM303DL, LSM303DLM, LSM330.
Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-25 23:44:00 +00:00
/*
* STMicroelectronics accelerometers driver
*
* Copyright 2012 - 2013 STMicroelectronics Inc .
*
* Denis Ciocca < denis . ciocca @ st . com >
* v . 1.0 .0
*/
# ifndef ST_ACCEL_H
# define ST_ACCEL_H
# include <linux/types.h>
# include <linux/iio/common/st_sensors.h>
2016-11-24 13:33:44 +08:00
enum st_accel_type {
LSM303DLH ,
LSM303DLHC ,
LIS3DH ,
LSM330D ,
LSM330DL ,
LSM330DLC ,
LIS331DLH ,
LSM303DL ,
LSM303DLM ,
LSM330 ,
LSM303AGR ,
LIS2DH12 ,
LIS3L02DQ ,
LNG2DM ,
2017-07-08 13:00:16 +02:00
H3LIS331DL ,
LIS331DL ,
LIS3LV02DL ,
2017-08-30 13:50:42 +02:00
LIS2DW12 ,
2017-09-17 18:17:11 +02:00
LIS3DHH ,
2019-04-10 17:12:09 -07:00
LIS2DE12 ,
2016-11-24 13:33:44 +08:00
ST_ACCEL_MAX ,
} ;
2017-07-08 13:00:18 +02:00
# define H3LIS331DL_ACCEL_DEV_NAME "h3lis331dl_accel"
2015-03-18 10:52:06 +01:00
# define LIS3LV02DL_ACCEL_DEV_NAME "lis3lv02dl_accel"
iio:accel: Add STMicroelectronics accelerometers driver
This patch adds a generic accelerometer driver for STMicroelectronics
accelerometers, currently it supports:
LSM303DLH, LSM303DLHC, LIS3DH, LSM330D, LSM330DL, LSM330DLC,
LIS331DLH, LSM303DL, LSM303DLM, LSM330.
Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-25 23:44:00 +00:00
# define LSM303DLHC_ACCEL_DEV_NAME "lsm303dlhc_accel"
# define LIS3DH_ACCEL_DEV_NAME "lis3dh"
# define LSM330D_ACCEL_DEV_NAME "lsm330d_accel"
# define LSM330DL_ACCEL_DEV_NAME "lsm330dl_accel"
# define LSM330DLC_ACCEL_DEV_NAME "lsm330dlc_accel"
2015-05-19 15:37:18 +02:00
# define LIS331DL_ACCEL_DEV_NAME "lis331dl_accel"
iio:accel: Add STMicroelectronics accelerometers driver
This patch adds a generic accelerometer driver for STMicroelectronics
accelerometers, currently it supports:
LSM303DLH, LSM303DLHC, LIS3DH, LSM330D, LSM330DL, LSM330DLC,
LIS331DLH, LSM303DL, LSM303DLM, LSM330.
Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-25 23:44:00 +00:00
# define LIS331DLH_ACCEL_DEV_NAME "lis331dlh"
# define LSM303DL_ACCEL_DEV_NAME "lsm303dl_accel"
# define LSM303DLH_ACCEL_DEV_NAME "lsm303dlh_accel"
# define LSM303DLM_ACCEL_DEV_NAME "lsm303dlm_accel"
# define LSM330_ACCEL_DEV_NAME "lsm330_accel"
2015-07-21 10:35:44 +02:00
# define LSM303AGR_ACCEL_DEV_NAME "lsm303agr_accel"
2015-11-12 08:36:49 +01:00
# define LIS2DH12_ACCEL_DEV_NAME "lis2dh12_accel"
2016-05-22 20:39:29 +01:00
# define LIS3L02DQ_ACCEL_DEV_NAME "lis3l02dq"
2016-10-25 23:09:03 +02:00
# define LNG2DM_ACCEL_DEV_NAME "lng2dm"
2017-08-30 13:50:42 +02:00
# define LIS2DW12_ACCEL_DEV_NAME "lis2dw12"
2017-09-17 18:17:11 +02:00
# define LIS3DHH_ACCEL_DEV_NAME "lis3dhh"
2018-11-07 16:45:21 +01:00
# define LIS3DE_ACCEL_DEV_NAME "lis3de"
2019-04-10 17:12:09 -07:00
# define LIS2DE12_ACCEL_DEV_NAME "lis2de12"
iio:accel: Add STMicroelectronics accelerometers driver
This patch adds a generic accelerometer driver for STMicroelectronics
accelerometers, currently it supports:
LSM303DLH, LSM303DLHC, LIS3DH, LSM330D, LSM330DL, LSM330DLC,
LIS331DLH, LSM303DL, LSM303DLM, LSM330.
Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-25 23:44:00 +00:00
2013-06-19 09:28:00 +01:00
/**
* struct st_sensors_platform_data - default accel platform data
* @ drdy_int_pin : default accel DRDY is available on INT1 pin .
*/
2019-12-16 19:38:49 +02:00
static __maybe_unused const struct st_sensors_platform_data default_accel_pdata = {
2013-06-19 09:28:00 +01:00
. drdy_int_pin = 1 ,
} ;
2019-07-18 15:53:44 -07:00
const struct st_sensor_settings * st_accel_get_settings ( const char * name ) ;
2014-10-03 17:35:36 +02:00
int st_accel_common_probe ( struct iio_dev * indio_dev ) ;
iio:accel: Add STMicroelectronics accelerometers driver
This patch adds a generic accelerometer driver for STMicroelectronics
accelerometers, currently it supports:
LSM303DLH, LSM303DLHC, LIS3DH, LSM330D, LSM330DL, LSM330DLC,
LIS331DLH, LSM303DL, LSM303DLM, LSM330.
Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-01-25 23:44:00 +00:00
void st_accel_common_remove ( struct iio_dev * indio_dev ) ;
# ifdef CONFIG_IIO_BUFFER
int st_accel_allocate_ring ( struct iio_dev * indio_dev ) ;
void st_accel_deallocate_ring ( struct iio_dev * indio_dev ) ;
int st_accel_trig_set_state ( struct iio_trigger * trig , bool state ) ;
# define ST_ACCEL_TRIGGER_SET_STATE (&st_accel_trig_set_state)
# else /* CONFIG_IIO_BUFFER */
static inline int st_accel_allocate_ring ( struct iio_dev * indio_dev )
{
return 0 ;
}
static inline void st_accel_deallocate_ring ( struct iio_dev * indio_dev )
{
}
# define ST_ACCEL_TRIGGER_SET_STATE NULL
# endif /* CONFIG_IIO_BUFFER */
# endif /* ST_ACCEL_H */