1d6251168SDenis Ciocca /* 2d6251168SDenis Ciocca * STMicroelectronics accelerometers driver 3d6251168SDenis Ciocca * 4d6251168SDenis Ciocca * Copyright 2012-2013 STMicroelectronics Inc. 5d6251168SDenis Ciocca * 6d6251168SDenis Ciocca * Denis Ciocca <denis.ciocca@st.com> 7d6251168SDenis Ciocca * v. 1.0.0 8d6251168SDenis Ciocca * Licensed under the GPL-2. 9d6251168SDenis Ciocca */ 10d6251168SDenis Ciocca 11d6251168SDenis Ciocca #ifndef ST_ACCEL_H 12d6251168SDenis Ciocca #define ST_ACCEL_H 13d6251168SDenis Ciocca 14d6251168SDenis Ciocca #include <linux/types.h> 15d6251168SDenis Ciocca #include <linux/iio/common/st_sensors.h> 16d6251168SDenis Ciocca 171e52fefcSTiberiu Breana #define H3LIS331DL_DRIVER_NAME "h3lis331dl_accel" 183acddf74SLinus Walleij #define LIS3LV02DL_ACCEL_DEV_NAME "lis3lv02dl_accel" 19d6251168SDenis Ciocca #define LSM303DLHC_ACCEL_DEV_NAME "lsm303dlhc_accel" 20d6251168SDenis Ciocca #define LIS3DH_ACCEL_DEV_NAME "lis3dh" 21d6251168SDenis Ciocca #define LSM330D_ACCEL_DEV_NAME "lsm330d_accel" 22d6251168SDenis Ciocca #define LSM330DL_ACCEL_DEV_NAME "lsm330dl_accel" 23d6251168SDenis Ciocca #define LSM330DLC_ACCEL_DEV_NAME "lsm330dlc_accel" 24bbf5f037SLinus Walleij #define LIS331DL_ACCEL_DEV_NAME "lis331dl_accel" 25d6251168SDenis Ciocca #define LIS331DLH_ACCEL_DEV_NAME "lis331dlh" 26d6251168SDenis Ciocca #define LSM303DL_ACCEL_DEV_NAME "lsm303dl_accel" 27d6251168SDenis Ciocca #define LSM303DLH_ACCEL_DEV_NAME "lsm303dlh_accel" 28d6251168SDenis Ciocca #define LSM303DLM_ACCEL_DEV_NAME "lsm303dlm_accel" 29d6251168SDenis Ciocca #define LSM330_ACCEL_DEV_NAME "lsm330_accel" 30ddc05fa2SGiuseppe Barba #define LSM303AGR_ACCEL_DEV_NAME "lsm303agr_accel" 3134dc578dSGiuseppe Barba #define LIS2DH12_ACCEL_DEV_NAME "lis2dh12_accel" 32d6251168SDenis Ciocca 3323cde4d6SDenis CIOCCA /** 3423cde4d6SDenis CIOCCA * struct st_sensors_platform_data - default accel platform data 3523cde4d6SDenis CIOCCA * @drdy_int_pin: default accel DRDY is available on INT1 pin. 3623cde4d6SDenis CIOCCA */ 3723cde4d6SDenis CIOCCA static const struct st_sensors_platform_data default_accel_pdata = { 3823cde4d6SDenis CIOCCA .drdy_int_pin = 1, 3923cde4d6SDenis CIOCCA }; 4023cde4d6SDenis CIOCCA 41b6e6bda6SDenis CIOCCA int st_accel_common_probe(struct iio_dev *indio_dev); 42d6251168SDenis Ciocca void st_accel_common_remove(struct iio_dev *indio_dev); 43d6251168SDenis Ciocca 44d6251168SDenis Ciocca #ifdef CONFIG_IIO_BUFFER 45d6251168SDenis Ciocca int st_accel_allocate_ring(struct iio_dev *indio_dev); 46d6251168SDenis Ciocca void st_accel_deallocate_ring(struct iio_dev *indio_dev); 47d6251168SDenis Ciocca int st_accel_trig_set_state(struct iio_trigger *trig, bool state); 48d6251168SDenis Ciocca #define ST_ACCEL_TRIGGER_SET_STATE (&st_accel_trig_set_state) 49d6251168SDenis Ciocca #else /* CONFIG_IIO_BUFFER */ 50d6251168SDenis Ciocca static inline int st_accel_allocate_ring(struct iio_dev *indio_dev) 51d6251168SDenis Ciocca { 52d6251168SDenis Ciocca return 0; 53d6251168SDenis Ciocca } 54d6251168SDenis Ciocca static inline void st_accel_deallocate_ring(struct iio_dev *indio_dev) 55d6251168SDenis Ciocca { 56d6251168SDenis Ciocca } 57d6251168SDenis Ciocca #define ST_ACCEL_TRIGGER_SET_STATE NULL 58d6251168SDenis Ciocca #endif /* CONFIG_IIO_BUFFER */ 59d6251168SDenis Ciocca 60d6251168SDenis Ciocca #endif /* ST_ACCEL_H */ 61