]> git.karo-electronics.de Git - karo-tx-linux.git/blob - drivers/staging/iio/gyro/adis16080.h
staging/easycap: add first level indentation to easycap_ioctl.c
[karo-tx-linux.git] / drivers / staging / iio / gyro / adis16080.h
1 #ifndef SPI_ADIS16080_H_
2 #define SPI_ADIS16080_H_
3
4 /* Output data format setting. 0: Twos complement. 1: Offset binary. */
5 #define ADIS16080_DIN_CODE   4
6 #define ADIS16080_DIN_GYRO   (0 << 10) /* Gyroscope output */
7 #define ADIS16080_DIN_TEMP   (1 << 10) /* Temperature output */
8 #define ADIS16080_DIN_AIN1   (2 << 10)
9 #define ADIS16080_DIN_AIN2   (3 << 10)
10
11 /*
12  * 1: Write contents on DIN to control register.
13  * 0: No changes to control register.
14  */
15
16 #define ADIS16080_DIN_WRITE  (1 << 15)
17
18 #define ADIS16080_MAX_TX     2
19 #define ADIS16080_MAX_RX     2
20
21 /**
22  * struct adis16080_state - device instance specific data
23  * @us:                 actual spi_device to write data
24  * @indio_dev:          industrial I/O device structure
25  * @tx:                 transmit buffer
26  * @rx:                 recieve buffer
27  * @buf_lock:           mutex to protect tx and rx
28  **/
29 struct adis16080_state {
30         struct spi_device               *us;
31         struct iio_dev                  *indio_dev;
32         u8                              *tx;
33         u8                              *rx;
34         struct mutex                    buf_lock;
35 };
36 #endif /* SPI_ADIS16080_H_ */