Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[linux-2.6/libata-dev.git] / drivers / iio / gyro / st_gyro.h
blob3ad9907bb154d759f398928efb6a8f1a3570a33e
1 /*
2 * STMicroelectronics gyroscopes driver
4 * Copyright 2012-2013 STMicroelectronics Inc.
6 * Denis Ciocca <denis.ciocca@st.com>
7 * v. 1.0.0
8 * Licensed under the GPL-2.
9 */
11 #ifndef ST_GYRO_H
12 #define ST_GYRO_H
14 #include <linux/types.h>
15 #include <linux/iio/common/st_sensors.h>
17 #define L3G4200D_GYRO_DEV_NAME "l3g4200d"
18 #define LSM330D_GYRO_DEV_NAME "lsm330d_gyro"
19 #define LSM330DL_GYRO_DEV_NAME "lsm330dl_gyro"
20 #define LSM330DLC_GYRO_DEV_NAME "lsm330dlc_gyro"
21 #define L3GD20_GYRO_DEV_NAME "l3gd20"
22 #define L3GD20H_GYRO_DEV_NAME "l3gd20h"
23 #define L3G4IS_GYRO_DEV_NAME "l3g4is_ui"
24 #define LSM330_GYRO_DEV_NAME "lsm330_gyro"
26 int st_gyro_common_probe(struct iio_dev *indio_dev);
27 void st_gyro_common_remove(struct iio_dev *indio_dev);
29 #ifdef CONFIG_IIO_BUFFER
30 int st_gyro_allocate_ring(struct iio_dev *indio_dev);
31 void st_gyro_deallocate_ring(struct iio_dev *indio_dev);
32 int st_gyro_trig_set_state(struct iio_trigger *trig, bool state);
33 #define ST_GYRO_TRIGGER_SET_STATE (&st_gyro_trig_set_state)
34 #else /* CONFIG_IIO_BUFFER */
35 static inline int st_gyro_allocate_ring(struct iio_dev *indio_dev)
37 return 0;
39 static inline void st_gyro_deallocate_ring(struct iio_dev *indio_dev)
42 #define ST_GYRO_TRIGGER_SET_STATE NULL
43 #endif /* CONFIG_IIO_BUFFER */
45 #endif /* ST_GYRO_H */