Denis Ciocca | d625116 | 2013-01-25 23:44:00 +0000 | [diff] [blame] | 1 | /* |
| 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 Breana | 1e52fef | 2016-03-09 14:06:14 +0200 | [diff] [blame] | 17 | #define H3LIS331DL_DRIVER_NAME "h3lis331dl_accel" |
Linus Walleij | 3acddf7 | 2015-03-18 10:52:06 +0100 | [diff] [blame] | 18 | #define LIS3LV02DL_ACCEL_DEV_NAME "lis3lv02dl_accel" |
Denis Ciocca | d625116 | 2013-01-25 23:44:00 +0000 | [diff] [blame] | 19 | #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 Walleij | bbf5f03 | 2015-05-19 15:37:18 +0200 | [diff] [blame] | 24 | #define LIS331DL_ACCEL_DEV_NAME "lis331dl_accel" |
Denis Ciocca | d625116 | 2013-01-25 23:44:00 +0000 | [diff] [blame] | 25 | #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 Barba | ddc05fa | 2015-07-21 10:35:44 +0200 | [diff] [blame] | 30 | #define LSM303AGR_ACCEL_DEV_NAME "lsm303agr_accel" |
Giuseppe Barba | 34dc578 | 2015-11-12 08:36:49 +0100 | [diff] [blame] | 31 | #define LIS2DH12_ACCEL_DEV_NAME "lis2dh12_accel" |
Jonathan Cameron | 4e68cfb | 2016-05-22 20:39:29 +0100 | [diff] [blame] | 32 | #define LIS3L02DQ_ACCEL_DEV_NAME "lis3l02dq" |
Lorenzo Bianconi | dcdb0a7 | 2016-10-25 23:09:03 +0200 | [diff] [blame] | 33 | #define LNG2DM_ACCEL_DEV_NAME "lng2dm" |
Denis Ciocca | d625116 | 2013-01-25 23:44:00 +0000 | [diff] [blame] | 34 | |
Denis CIOCCA | 23cde4d | 2013-06-19 09:28:00 +0100 | [diff] [blame] | 35 | /** |
| 36 | * struct st_sensors_platform_data - default accel platform data |
| 37 | * @drdy_int_pin: default accel DRDY is available on INT1 pin. |
| 38 | */ |
| 39 | static const struct st_sensors_platform_data default_accel_pdata = { |
| 40 | .drdy_int_pin = 1, |
| 41 | }; |
| 42 | |
Denis CIOCCA | b6e6bda6 | 2014-10-03 17:35:36 +0200 | [diff] [blame] | 43 | int st_accel_common_probe(struct iio_dev *indio_dev); |
Denis Ciocca | d625116 | 2013-01-25 23:44:00 +0000 | [diff] [blame] | 44 | void st_accel_common_remove(struct iio_dev *indio_dev); |
| 45 | |
| 46 | #ifdef CONFIG_IIO_BUFFER |
| 47 | int st_accel_allocate_ring(struct iio_dev *indio_dev); |
| 48 | void st_accel_deallocate_ring(struct iio_dev *indio_dev); |
| 49 | int st_accel_trig_set_state(struct iio_trigger *trig, bool state); |
| 50 | #define ST_ACCEL_TRIGGER_SET_STATE (&st_accel_trig_set_state) |
| 51 | #else /* CONFIG_IIO_BUFFER */ |
| 52 | static inline int st_accel_allocate_ring(struct iio_dev *indio_dev) |
| 53 | { |
| 54 | return 0; |
| 55 | } |
| 56 | static inline void st_accel_deallocate_ring(struct iio_dev *indio_dev) |
| 57 | { |
| 58 | } |
| 59 | #define ST_ACCEL_TRIGGER_SET_STATE NULL |
| 60 | #endif /* CONFIG_IIO_BUFFER */ |
| 61 | |
| 62 | #endif /* ST_ACCEL_H */ |