Add the rt linux 4.1.3-rt3 as base
[kvmfornfv.git] / kernel / drivers / staging / iio / accel / adis16209.h
1 #ifndef SPI_ADIS16209_H_
2 #define SPI_ADIS16209_H_
3
4 #define ADIS16209_STARTUP_DELAY 220 /* ms */
5
6 /* Flash memory write count */
7 #define ADIS16209_FLASH_CNT      0x00
8 /* Output, power supply */
9 #define ADIS16209_SUPPLY_OUT     0x02
10 /* Output, x-axis accelerometer */
11 #define ADIS16209_XACCL_OUT      0x04
12 /* Output, y-axis accelerometer */
13 #define ADIS16209_YACCL_OUT      0x06
14 /* Output, auxiliary ADC input */
15 #define ADIS16209_AUX_ADC        0x08
16 /* Output, temperature */
17 #define ADIS16209_TEMP_OUT       0x0A
18 /* Output, x-axis inclination */
19 #define ADIS16209_XINCL_OUT      0x0C
20 /* Output, y-axis inclination */
21 #define ADIS16209_YINCL_OUT      0x0E
22 /* Output, +/-180 vertical rotational position */
23 #define ADIS16209_ROT_OUT        0x10
24 /* Calibration, x-axis acceleration offset null */
25 #define ADIS16209_XACCL_NULL     0x12
26 /* Calibration, y-axis acceleration offset null */
27 #define ADIS16209_YACCL_NULL     0x14
28 /* Calibration, x-axis inclination offset null */
29 #define ADIS16209_XINCL_NULL     0x16
30 /* Calibration, y-axis inclination offset null */
31 #define ADIS16209_YINCL_NULL     0x18
32 /* Calibration, vertical rotation offset null */
33 #define ADIS16209_ROT_NULL       0x1A
34 /* Alarm 1 amplitude threshold */
35 #define ADIS16209_ALM_MAG1       0x20
36 /* Alarm 2 amplitude threshold */
37 #define ADIS16209_ALM_MAG2       0x22
38 /* Alarm 1, sample period */
39 #define ADIS16209_ALM_SMPL1      0x24
40 /* Alarm 2, sample period */
41 #define ADIS16209_ALM_SMPL2      0x26
42 /* Alarm control */
43 #define ADIS16209_ALM_CTRL       0x28
44 /* Auxiliary DAC data */
45 #define ADIS16209_AUX_DAC        0x30
46 /* General-purpose digital input/output control */
47 #define ADIS16209_GPIO_CTRL      0x32
48 /* Miscellaneous control */
49 #define ADIS16209_MSC_CTRL       0x34
50 /* Internal sample period (rate) control */
51 #define ADIS16209_SMPL_PRD       0x36
52 /* Operation, filter configuration */
53 #define ADIS16209_AVG_CNT        0x38
54 /* Operation, sleep mode control */
55 #define ADIS16209_SLP_CNT        0x3A
56 /* Diagnostics, system status register */
57 #define ADIS16209_DIAG_STAT      0x3C
58 /* Operation, system command register */
59 #define ADIS16209_GLOB_CMD       0x3E
60
61 /* MSC_CTRL */
62 /* Self-test at power-on: 1 = disabled, 0 = enabled */
63 #define ADIS16209_MSC_CTRL_PWRUP_SELF_TEST      BIT(10)
64 /* Self-test enable */
65 #define ADIS16209_MSC_CTRL_SELF_TEST_EN         BIT(8)
66 /* Data-ready enable: 1 = enabled, 0 = disabled */
67 #define ADIS16209_MSC_CTRL_DATA_RDY_EN          BIT(2)
68 /* Data-ready polarity: 1 = active high, 0 = active low */
69 #define ADIS16209_MSC_CTRL_ACTIVE_HIGH          BIT(1)
70 /* Data-ready line selection: 1 = DIO2, 0 = DIO1 */
71 #define ADIS16209_MSC_CTRL_DATA_RDY_DIO2        BIT(0)
72
73 /* DIAG_STAT */
74 /* Alarm 2 status: 1 = alarm active, 0 = alarm inactive */
75 #define ADIS16209_DIAG_STAT_ALARM2        BIT(9)
76 /* Alarm 1 status: 1 = alarm active, 0 = alarm inactive */
77 #define ADIS16209_DIAG_STAT_ALARM1        BIT(8)
78 /* Self-test diagnostic error flag: 1 = error condition, 0 = normal operation */
79 #define ADIS16209_DIAG_STAT_SELFTEST_FAIL_BIT   5
80 /* SPI communications failure */
81 #define ADIS16209_DIAG_STAT_SPI_FAIL_BIT        3
82 /* Flash update failure */
83 #define ADIS16209_DIAG_STAT_FLASH_UPT_BIT       2
84 /* Power supply above 3.625 V */
85 #define ADIS16209_DIAG_STAT_POWER_HIGH_BIT      1
86 /* Power supply below 3.15 V */
87 #define ADIS16209_DIAG_STAT_POWER_LOW_BIT       0
88
89 /* GLOB_CMD */
90 #define ADIS16209_GLOB_CMD_SW_RESET     BIT(7)
91 #define ADIS16209_GLOB_CMD_CLEAR_STAT   BIT(4)
92 #define ADIS16209_GLOB_CMD_FACTORY_CAL  BIT(1)
93
94 #define ADIS16209_ERROR_ACTIVE          BIT(14)
95
96 #define ADIS16209_SCAN_SUPPLY   0
97 #define ADIS16209_SCAN_ACC_X    1
98 #define ADIS16209_SCAN_ACC_Y    2
99 #define ADIS16209_SCAN_AUX_ADC  3
100 #define ADIS16209_SCAN_TEMP     4
101 #define ADIS16209_SCAN_INCLI_X  5
102 #define ADIS16209_SCAN_INCLI_Y  6
103 #define ADIS16209_SCAN_ROT      7
104
105 #endif /* SPI_ADIS16209_H_ */