blob: f8dfdb6905632b3e23d2074eb8f0d993f5447ed9 [file] [log] [blame]
Denis Cioccad6251162013-01-25 23:44:00 +00001/*
2 * STMicroelectronics accelerometers driver
3 *
4 * Copyright 2012-2013 STMicroelectronics Inc.
5 *
6 * Denis Ciocca <denis.ciocca@st.com>
7 * v. 1.0.0
8 * Licensed under the GPL-2.
9 */
10
11#ifndef ST_ACCEL_H
12#define ST_ACCEL_H
13
14#include <linux/types.h>
15#include <linux/iio/common/st_sensors.h>
16
Tiberiu Breana1e52fef2016-03-09 14:06:14 +020017#define H3LIS331DL_DRIVER_NAME "h3lis331dl_accel"
Linus Walleij3acddf72015-03-18 10:52:06 +010018#define LIS3LV02DL_ACCEL_DEV_NAME "lis3lv02dl_accel"
Denis Cioccad6251162013-01-25 23:44:00 +000019#define LSM303DLHC_ACCEL_DEV_NAME "lsm303dlhc_accel"
20#define LIS3DH_ACCEL_DEV_NAME "lis3dh"
21#define LSM330D_ACCEL_DEV_NAME "lsm330d_accel"
22#define LSM330DL_ACCEL_DEV_NAME "lsm330dl_accel"
23#define LSM330DLC_ACCEL_DEV_NAME "lsm330dlc_accel"
Linus Walleijbbf5f032015-05-19 15:37:18 +020024#define LIS331DL_ACCEL_DEV_NAME "lis331dl_accel"
Denis Cioccad6251162013-01-25 23:44:00 +000025#define LIS331DLH_ACCEL_DEV_NAME "lis331dlh"
26#define LSM303DL_ACCEL_DEV_NAME "lsm303dl_accel"
27#define LSM303DLH_ACCEL_DEV_NAME "lsm303dlh_accel"
28#define LSM303DLM_ACCEL_DEV_NAME "lsm303dlm_accel"
29#define LSM330_ACCEL_DEV_NAME "lsm330_accel"
Giuseppe Barbaddc05fa2015-07-21 10:35:44 +020030#define LSM303AGR_ACCEL_DEV_NAME "lsm303agr_accel"
Giuseppe Barba34dc5782015-11-12 08:36:49 +010031#define LIS2DH12_ACCEL_DEV_NAME "lis2dh12_accel"
Jonathan Cameron4e68cfb2016-05-22 20:39:29 +010032#define LIS3L02DQ_ACCEL_DEV_NAME "lis3l02dq"
Denis Cioccad6251162013-01-25 23:44:00 +000033
Denis CIOCCA23cde4d2013-06-19 09:28:00 +010034/**
35* struct st_sensors_platform_data - default accel platform data
36* @drdy_int_pin: default accel DRDY is available on INT1 pin.
37*/
38static const struct st_sensors_platform_data default_accel_pdata = {
39 .drdy_int_pin = 1,
40};
41
Denis CIOCCAb6e6bda62014-10-03 17:35:36 +020042int st_accel_common_probe(struct iio_dev *indio_dev);
Denis Cioccad6251162013-01-25 23:44:00 +000043void st_accel_common_remove(struct iio_dev *indio_dev);
44
45#ifdef CONFIG_IIO_BUFFER
46int st_accel_allocate_ring(struct iio_dev *indio_dev);
47void st_accel_deallocate_ring(struct iio_dev *indio_dev);
48int st_accel_trig_set_state(struct iio_trigger *trig, bool state);
49#define ST_ACCEL_TRIGGER_SET_STATE (&st_accel_trig_set_state)
50#else /* CONFIG_IIO_BUFFER */
51static inline int st_accel_allocate_ring(struct iio_dev *indio_dev)
52{
53 return 0;
54}
55static inline void st_accel_deallocate_ring(struct iio_dev *indio_dev)
56{
57}
58#define ST_ACCEL_TRIGGER_SET_STATE NULL
59#endif /* CONFIG_IIO_BUFFER */
60
61#endif /* ST_ACCEL_H */