diff options
author | Michael Hennerich <michael.hennerich@analog.com> | 2010-05-24 17:33:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-25 11:07:04 -0400 |
commit | 59592d0ccc0000d74ea5fc2a59e3ec0c9ef1fb13 (patch) | |
tree | 7a871ad14dfd9e438684787332663fba6f4db7ed /drivers/misc/ad525x_dpot.h | |
parent | c74cba610c9559e72377fd9725a3d329581aa256 (diff) |
ad525x_dpot: add support for one time programmable pots
New parts supported:
AD5170, AD5171, AD5172, AD5173, AD5273
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/misc/ad525x_dpot.h')
-rw-r--r-- | drivers/misc/ad525x_dpot.h | 42 |
1 files changed, 28 insertions, 14 deletions
diff --git a/drivers/misc/ad525x_dpot.h b/drivers/misc/ad525x_dpot.h index d789a95cbe09..78b89fd2e2fd 100644 --- a/drivers/misc/ad525x_dpot.h +++ b/drivers/misc/ad525x_dpot.h | |||
@@ -15,17 +15,18 @@ | |||
15 | (((features) << 18) | (((wipers) & 0xFF) << 10) | \ | 15 | (((features) << 18) | (((wipers) & 0xFF) << 10) | \ |
16 | ((max_pos & 0xF) << 6) | (uid & 0x3F)) | 16 | ((max_pos & 0xF) << 6) | (uid & 0x3F)) |
17 | 17 | ||
18 | #define DPOT_UID(conf) (conf & 0x3F) | 18 | #define DPOT_UID(conf) (conf & 0x3F) |
19 | #define DPOT_MAX_POS(conf) ((conf >> 6) & 0xF) | 19 | #define DPOT_MAX_POS(conf) ((conf >> 6) & 0xF) |
20 | #define DPOT_WIPERS(conf) ((conf >> 10) & 0xFF) | 20 | #define DPOT_WIPERS(conf) ((conf >> 10) & 0xFF) |
21 | #define DPOT_FEAT(conf) (conf >> 18) | 21 | #define DPOT_FEAT(conf) (conf >> 18) |
22 | 22 | ||
23 | #define BRDAC0 (1 << 0) | 23 | #define BRDAC0 (1 << 0) |
24 | #define BRDAC1 (1 << 1) | 24 | #define BRDAC1 (1 << 1) |
25 | #define BRDAC2 (1 << 2) | 25 | #define BRDAC2 (1 << 2) |
26 | #define BRDAC3 (1 << 3) | 26 | #define BRDAC3 (1 << 3) |
27 | #define BRDAC4 (1 << 4) | 27 | #define BRDAC4 (1 << 4) |
28 | #define BRDAC5 (1 << 5) | 28 | #define BRDAC5 (1 << 5) |
29 | #define MAX_RDACS 6 | ||
29 | 30 | ||
30 | #define F_CMD_INC (1 << 0) /* Features INC/DEC ALL, 6dB */ | 31 | #define F_CMD_INC (1 << 0) /* Features INC/DEC ALL, 6dB */ |
31 | #define F_CMD_EEP (1 << 1) /* Features EEPROM */ | 32 | #define F_CMD_EEP (1 << 1) /* Features EEPROM */ |
@@ -116,6 +117,11 @@ enum dpot_devid { | |||
116 | AD5282_ID = DPOT_CONF(F_RDACS_RW, BRDAC0 | BRDAC1, 8, 41), | 117 | AD5282_ID = DPOT_CONF(F_RDACS_RW, BRDAC0 | BRDAC1, 8, 41), |
117 | ADN2860_ID = DPOT_CONF(F_RDACS_RW_TOL | F_CMD_INC, | 118 | ADN2860_ID = DPOT_CONF(F_RDACS_RW_TOL | F_CMD_INC, |
118 | BRDAC0 | BRDAC1 | BRDAC2, 9, 42), | 119 | BRDAC0 | BRDAC1 | BRDAC2, 9, 42), |
120 | AD5273_ID = DPOT_CONF(F_RDACS_RW | F_CMD_OTP, BRDAC0, 6, 43), | ||
121 | AD5171_ID = DPOT_CONF(F_RDACS_RW | F_CMD_OTP, BRDAC0, 6, 44), | ||
122 | AD5170_ID = DPOT_CONF(F_RDACS_RW | F_CMD_OTP, BRDAC0, 8, 45), | ||
123 | AD5172_ID = DPOT_CONF(F_RDACS_RW | F_CMD_OTP, BRDAC0 | BRDAC1, 8, 46), | ||
124 | AD5173_ID = DPOT_CONF(F_RDACS_RW | F_CMD_OTP, BRDAC0 | BRDAC1, 8, 47), | ||
119 | }; | 125 | }; |
120 | 126 | ||
121 | #define DPOT_RDAC0 0 | 127 | #define DPOT_RDAC0 0 |
@@ -136,9 +142,11 @@ enum dpot_devid { | |||
136 | #define DPOT_TOL_RDAC5 (DPOT_REG_TOL | DPOT_RDAC5) | 142 | #define DPOT_TOL_RDAC5 (DPOT_REG_TOL | DPOT_RDAC5) |
137 | 143 | ||
138 | /* RDAC-to-EEPROM Interface Commands */ | 144 | /* RDAC-to-EEPROM Interface Commands */ |
139 | #define DPOT_ADDR_RDAC (0x00 << 5) | 145 | #define DPOT_ADDR_RDAC (0x0 << 5) |
140 | #define DPOT_ADDR_EEPROM (0x01 << 5) | 146 | #define DPOT_ADDR_EEPROM (0x1 << 5) |
141 | #define DPOT_ADDR_CMD (0x80) | 147 | #define DPOT_ADDR_OTP (0x1 << 6) |
148 | #define DPOT_ADDR_CMD (0x1 << 7) | ||
149 | #define DPOT_ADDR_OTP_EN (0x1 << 9) | ||
142 | 150 | ||
143 | #define DPOT_DEC_ALL_6DB (DPOT_ADDR_CMD | (0x4 << 3)) | 151 | #define DPOT_DEC_ALL_6DB (DPOT_ADDR_CMD | (0x4 << 3)) |
144 | #define DPOT_INC_ALL_6DB (DPOT_ADDR_CMD | (0x9 << 3)) | 152 | #define DPOT_INC_ALL_6DB (DPOT_ADDR_CMD | (0x9 << 3)) |
@@ -161,6 +169,12 @@ enum dpot_devid { | |||
161 | /* AD524x use special commands */ | 169 | /* AD524x use special commands */ |
162 | #define DPOT_AD5291_RDAC_AB 0x80 | 170 | #define DPOT_AD5291_RDAC_AB 0x80 |
163 | 171 | ||
172 | #define DPOT_AD5273_FUSE 0x80 | ||
173 | #define DPOT_AD5270_2_3_FUSE 0x20 | ||
174 | #define DPOT_AD5270_2_3_OW 0x08 | ||
175 | #define DPOT_AD5272_3_A0 0x08 | ||
176 | #define DPOT_AD5270_2FUSE 0x80 | ||
177 | |||
164 | struct dpot_data; | 178 | struct dpot_data; |
165 | 179 | ||
166 | struct ad_dpot_bus_ops { | 180 | struct ad_dpot_bus_ops { |