diff options
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/Kconfig | 3 | ||||
-rw-r--r-- | drivers/misc/ad525x_dpot-i2c.c | 3 | ||||
-rw-r--r-- | drivers/misc/ad525x_dpot.c | 28 | ||||
-rw-r--r-- | drivers/misc/ad525x_dpot.h | 6 |
4 files changed, 26 insertions, 14 deletions
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig index 90c3415dc90a..233886d00861 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig | |||
@@ -23,7 +23,8 @@ config AD525X_DPOT | |||
23 | AD5204, AD5206, AD5207, AD5231, AD5232, AD5233, AD5235, | 23 | AD5204, AD5206, AD5207, AD5231, AD5232, AD5233, AD5235, |
24 | AD5260, AD5262, AD5263, AD5290, AD5291, AD5292, AD5293, | 24 | AD5260, AD5262, AD5263, AD5290, AD5291, AD5292, AD5293, |
25 | AD7376, AD8400, AD8402, AD8403, ADN2850, AD5241, AD5242, | 25 | AD7376, AD8400, AD8402, AD8403, ADN2850, AD5241, AD5242, |
26 | AD5243, AD5245, AD5246, AD5247, AD5248 | 26 | AD5243, AD5245, AD5246, AD5247, AD5248, AD5280, AD5282, |
27 | ADN2860 | ||
27 | digital potentiometer chips. | 28 | digital potentiometer chips. |
28 | 29 | ||
29 | See Documentation/misc-devices/ad525x_dpot.txt for the | 30 | See Documentation/misc-devices/ad525x_dpot.txt for the |
diff --git a/drivers/misc/ad525x_dpot-i2c.c b/drivers/misc/ad525x_dpot-i2c.c index 0dfad4e70f74..abba18efdde3 100644 --- a/drivers/misc/ad525x_dpot-i2c.c +++ b/drivers/misc/ad525x_dpot-i2c.c | |||
@@ -94,6 +94,9 @@ static const struct i2c_device_id ad_dpot_id[] = { | |||
94 | {"ad5246", AD5246_ID}, | 94 | {"ad5246", AD5246_ID}, |
95 | {"ad5247", AD5247_ID}, | 95 | {"ad5247", AD5247_ID}, |
96 | {"ad5248", AD5248_ID}, | 96 | {"ad5248", AD5248_ID}, |
97 | {"ad5280", AD5280_ID}, | ||
98 | {"ad5282", AD5282_ID}, | ||
99 | {"adn2860", ADN2860_ID}, | ||
97 | {} | 100 | {} |
98 | }; | 101 | }; |
99 | MODULE_DEVICE_TABLE(i2c, ad_dpot_id); | 102 | MODULE_DEVICE_TABLE(i2c, ad_dpot_id); |
diff --git a/drivers/misc/ad525x_dpot.c b/drivers/misc/ad525x_dpot.c index 35a4c4b343d4..255ba4b5e355 100644 --- a/drivers/misc/ad525x_dpot.c +++ b/drivers/misc/ad525x_dpot.c | |||
@@ -44,6 +44,9 @@ | |||
44 | * AD5243 2 256 2.5, 10, 50, 100 | 44 | * AD5243 2 256 2.5, 10, 50, 100 |
45 | * AD5248 2 256 2.5, 10, 50, 100 | 45 | * AD5248 2 256 2.5, 10, 50, 100 |
46 | * AD5242 2 256 20, 50, 200 | 46 | * AD5242 2 256 20, 50, 200 |
47 | * AD5280 1 256 20, 50, 200 | ||
48 | * AD5282 2 256 20, 50, 200 | ||
49 | * ADN2860 3 512 25, 250 | ||
47 | * | 50 | * |
48 | * See Documentation/misc-devices/ad525x_dpot.txt for more info. | 51 | * See Documentation/misc-devices/ad525x_dpot.txt for more info. |
49 | * | 52 | * |
@@ -154,6 +157,8 @@ static s32 dpot_read_i2c(struct dpot_data *dpot, u8 reg) | |||
154 | case DPOT_UID(AD5242_ID): | 157 | case DPOT_UID(AD5242_ID): |
155 | case DPOT_UID(AD5243_ID): | 158 | case DPOT_UID(AD5243_ID): |
156 | case DPOT_UID(AD5248_ID): | 159 | case DPOT_UID(AD5248_ID): |
160 | case DPOT_UID(AD5280_ID): | ||
161 | case DPOT_UID(AD5282_ID): | ||
157 | ctrl = ((reg & DPOT_RDAC_MASK) == DPOT_RDAC0) ? | 162 | ctrl = ((reg & DPOT_RDAC_MASK) == DPOT_RDAC0) ? |
158 | 0 : DPOT_AD5291_RDAC_AB; | 163 | 0 : DPOT_AD5291_RDAC_AB; |
159 | return dpot_read_r8d8(dpot, ctrl); | 164 | return dpot_read_r8d8(dpot, ctrl); |
@@ -250,21 +255,22 @@ static s32 dpot_write_i2c(struct dpot_data *dpot, u8 reg, u16 value) | |||
250 | case DPOT_UID(AD5242_ID): | 255 | case DPOT_UID(AD5242_ID): |
251 | case DPOT_UID(AD5243_ID): | 256 | case DPOT_UID(AD5243_ID): |
252 | case DPOT_UID(AD5248_ID): | 257 | case DPOT_UID(AD5248_ID): |
253 | ctrl = ((reg & DPOT_RDAC_MASK) == DPOT_RDAC0) ? 0 : DPOT_AD5291_RDAC_AB; | 258 | case DPOT_UID(AD5280_ID): |
259 | case DPOT_UID(AD5282_ID): | ||
260 | ctrl = ((reg & DPOT_RDAC_MASK) == DPOT_RDAC0) ? | ||
261 | 0 : DPOT_AD5291_RDAC_AB; | ||
254 | return dpot_write_r8d8(dpot, ctrl, value); | 262 | return dpot_write_r8d8(dpot, ctrl, value); |
255 | break; | 263 | break; |
256 | |||
257 | |||
258 | default: | 264 | default: |
259 | if (reg & DPOT_ADDR_CMD) | 265 | if (reg & DPOT_ADDR_CMD) |
260 | return dpot_write_d8(dpot, reg); | 266 | return dpot_write_d8(dpot, reg); |
261 | 267 | ||
262 | if (dpot->max_pos > 256) | 268 | if (dpot->max_pos > 256) |
263 | return dpot_write_r8d16(dpot, (reg & 0xF8) | | 269 | return dpot_write_r8d16(dpot, (reg & 0xF8) | |
264 | ((reg & 0x7) << 1), value); | 270 | ((reg & 0x7) << 1), value); |
265 | else | 271 | else |
266 | /* All other registers require instruction + data bytes */ | 272 | /* All other registers require instruction + data bytes */ |
267 | return dpot_write_r8d8(dpot, reg, value); | 273 | return dpot_write_r8d8(dpot, reg, value); |
268 | } | 274 | } |
269 | } | 275 | } |
270 | 276 | ||
diff --git a/drivers/misc/ad525x_dpot.h b/drivers/misc/ad525x_dpot.h index 849c5d0782b2..d789a95cbe09 100644 --- a/drivers/misc/ad525x_dpot.h +++ b/drivers/misc/ad525x_dpot.h | |||
@@ -112,8 +112,10 @@ enum dpot_devid { | |||
112 | AD5246_ID = DPOT_CONF(F_RDACS_RW, BRDAC0, 7, 37), | 112 | AD5246_ID = DPOT_CONF(F_RDACS_RW, BRDAC0, 7, 37), |
113 | AD5247_ID = DPOT_CONF(F_RDACS_RW, BRDAC0, 7, 38), | 113 | AD5247_ID = DPOT_CONF(F_RDACS_RW, BRDAC0, 7, 38), |
114 | AD5248_ID = DPOT_CONF(F_RDACS_RW, BRDAC0 | BRDAC1, 8, 39), | 114 | AD5248_ID = DPOT_CONF(F_RDACS_RW, BRDAC0 | BRDAC1, 8, 39), |
115 | 115 | AD5280_ID = DPOT_CONF(F_RDACS_RW, BRDAC0, 8, 40), | |
116 | 116 | AD5282_ID = DPOT_CONF(F_RDACS_RW, BRDAC0 | BRDAC1, 8, 41), | |
117 | ADN2860_ID = DPOT_CONF(F_RDACS_RW_TOL | F_CMD_INC, | ||
118 | BRDAC0 | BRDAC1 | BRDAC2, 9, 42), | ||
117 | }; | 119 | }; |
118 | 120 | ||
119 | #define DPOT_RDAC0 0 | 121 | #define DPOT_RDAC0 0 |