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 17d6251168SDenis Ciocca #define LSM303DLHC_ACCEL_DEV_NAME "lsm303dlhc_accel" 18d6251168SDenis Ciocca #define LIS3DH_ACCEL_DEV_NAME "lis3dh" 19d6251168SDenis Ciocca #define LSM330D_ACCEL_DEV_NAME "lsm330d_accel" 20d6251168SDenis Ciocca #define LSM330DL_ACCEL_DEV_NAME "lsm330dl_accel" 21d6251168SDenis Ciocca #define LSM330DLC_ACCEL_DEV_NAME "lsm330dlc_accel" 22d6251168SDenis Ciocca #define LIS331DLH_ACCEL_DEV_NAME "lis331dlh" 23d6251168SDenis Ciocca #define LSM303DL_ACCEL_DEV_NAME "lsm303dl_accel" 24d6251168SDenis Ciocca #define LSM303DLH_ACCEL_DEV_NAME "lsm303dlh_accel" 25d6251168SDenis Ciocca #define LSM303DLM_ACCEL_DEV_NAME "lsm303dlm_accel" 26d6251168SDenis Ciocca #define LSM330_ACCEL_DEV_NAME "lsm330_accel" 27d6251168SDenis Ciocca 2823cde4d6SDenis CIOCCA /** 2923cde4d6SDenis CIOCCA * struct st_sensors_platform_data - default accel platform data 3023cde4d6SDenis CIOCCA * @drdy_int_pin: default accel DRDY is available on INT1 pin. 3123cde4d6SDenis CIOCCA */ 3223cde4d6SDenis CIOCCA static const struct st_sensors_platform_data default_accel_pdata = { 3323cde4d6SDenis CIOCCA .drdy_int_pin = 1, 3423cde4d6SDenis CIOCCA }; 3523cde4d6SDenis CIOCCA 3623cde4d6SDenis CIOCCA int st_accel_common_probe(struct iio_dev *indio_dev, 3723cde4d6SDenis CIOCCA struct st_sensors_platform_data *pdata); 38d6251168SDenis Ciocca void st_accel_common_remove(struct iio_dev *indio_dev); 39d6251168SDenis Ciocca 40d6251168SDenis Ciocca #ifdef CONFIG_IIO_BUFFER 41d6251168SDenis Ciocca int st_accel_allocate_ring(struct iio_dev *indio_dev); 42d6251168SDenis Ciocca void st_accel_deallocate_ring(struct iio_dev *indio_dev); 43d6251168SDenis Ciocca int st_accel_trig_set_state(struct iio_trigger *trig, bool state); 44d6251168SDenis Ciocca #define ST_ACCEL_TRIGGER_SET_STATE (&st_accel_trig_set_state) 45d6251168SDenis Ciocca #else /* CONFIG_IIO_BUFFER */ 46d6251168SDenis Ciocca static inline int st_accel_allocate_ring(struct iio_dev *indio_dev) 47d6251168SDenis Ciocca { 48d6251168SDenis Ciocca return 0; 49d6251168SDenis Ciocca } 50d6251168SDenis Ciocca static inline void st_accel_deallocate_ring(struct iio_dev *indio_dev) 51d6251168SDenis Ciocca { 52d6251168SDenis Ciocca } 53d6251168SDenis Ciocca #define ST_ACCEL_TRIGGER_SET_STATE NULL 54d6251168SDenis Ciocca #endif /* CONFIG_IIO_BUFFER */ 55d6251168SDenis Ciocca 56d6251168SDenis Ciocca #endif /* ST_ACCEL_H */ 57