Go to the documentation of this file.
12 #include <linux/types.h>
14 #define DPOT_CONF(features, wipers, max_pos, uid) \
15 (((features) << 18) | (((wipers) & 0xFF) << 10) | \
16 ((max_pos & 0xF) << 6) | (uid & 0x3F))
18 #define DPOT_UID(conf) (conf & 0x3F)
19 #define DPOT_MAX_POS(conf) ((conf >> 6) & 0xF)
20 #define DPOT_WIPERS(conf) ((conf >> 10) & 0xFF)
21 #define DPOT_FEAT(conf) (conf >> 18)
23 #define BRDAC0 (1 << 0)
24 #define BRDAC1 (1 << 1)
25 #define BRDAC2 (1 << 2)
26 #define BRDAC3 (1 << 3)
27 #define BRDAC4 (1 << 4)
28 #define BRDAC5 (1 << 5)
31 #define F_CMD_INC (1 << 0)
32 #define F_CMD_EEP (1 << 1)
33 #define F_CMD_OTP (1 << 2)
34 #define F_CMD_TOL (1 << 3)
35 #define F_RDACS_RW (1 << 4)
36 #define F_RDACS_WONLY (1 << 5)
37 #define F_AD_APPDATA (1 << 6)
38 #define F_SPI_8BIT (1 << 7)
39 #define F_SPI_16BIT (1 << 8)
40 #define F_SPI_24BIT (1 << 9)
42 #define F_RDACS_RW_TOL (F_RDACS_RW | F_CMD_EEP | F_CMD_TOL)
43 #define F_RDACS_RW_EEP (F_RDACS_RW | F_CMD_EEP)
44 #define F_SPI (F_SPI_8BIT | F_SPI_16BIT | F_SPI_24BIT)
142 #define DPOT_RDAC_MASK 0x1F
144 #define DPOT_REG_TOL 0x18
145 #define DPOT_TOL_RDAC0 (DPOT_REG_TOL | DPOT_RDAC0)
146 #define DPOT_TOL_RDAC1 (DPOT_REG_TOL | DPOT_RDAC1)
147 #define DPOT_TOL_RDAC2 (DPOT_REG_TOL | DPOT_RDAC2)
148 #define DPOT_TOL_RDAC3 (DPOT_REG_TOL | DPOT_RDAC3)
149 #define DPOT_TOL_RDAC4 (DPOT_REG_TOL | DPOT_RDAC4)
150 #define DPOT_TOL_RDAC5 (DPOT_REG_TOL | DPOT_RDAC5)
153 #define DPOT_ADDR_RDAC (0x0 << 5)
154 #define DPOT_ADDR_EEPROM (0x1 << 5)
155 #define DPOT_ADDR_OTP (0x1 << 6)
156 #define DPOT_ADDR_CMD (0x1 << 7)
157 #define DPOT_ADDR_OTP_EN (0x1 << 9)
159 #define DPOT_DEC_ALL_6DB (DPOT_ADDR_CMD | (0x4 << 3))
160 #define DPOT_INC_ALL_6DB (DPOT_ADDR_CMD | (0x9 << 3))
161 #define DPOT_DEC_ALL (DPOT_ADDR_CMD | (0x6 << 3))
162 #define DPOT_INC_ALL (DPOT_ADDR_CMD | (0xB << 3))
164 #define DPOT_SPI_RDAC 0xB0
165 #define DPOT_SPI_EEPROM 0x30
166 #define DPOT_SPI_READ_RDAC 0xA0
167 #define DPOT_SPI_READ_EEPROM 0x90
168 #define DPOT_SPI_DEC_ALL_6DB 0x50
169 #define DPOT_SPI_INC_ALL_6DB 0xD0
170 #define DPOT_SPI_DEC_ALL 0x70
171 #define DPOT_SPI_INC_ALL 0xF0
174 #define DPOT_AD5291_RDAC 0x01
175 #define DPOT_AD5291_READ_RDAC 0x02
176 #define DPOT_AD5291_STORE_XTPM 0x03
177 #define DPOT_AD5291_CTRLREG 0x06
178 #define DPOT_AD5291_UNLOCK_CMD 0x03
181 #define DPOT_AD5270_1_2_4_RDAC 0x01
182 #define DPOT_AD5270_1_2_4_READ_RDAC 0x02
183 #define DPOT_AD5270_1_2_4_STORE_XTPM 0x03
184 #define DPOT_AD5270_1_2_4_CTRLREG 0x07
185 #define DPOT_AD5270_1_2_4_UNLOCK_CMD 0x03
187 #define DPOT_AD5282_RDAC_AB 0x80
189 #define DPOT_AD5273_FUSE 0x80
190 #define DPOT_AD5170_2_3_FUSE 0x20
191 #define DPOT_AD5170_2_3_OW 0x08
192 #define DPOT_AD5172_3_A0 0x08
193 #define DPOT_AD5170_2FUSE 0x80