aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/ad525x_dpot.h
diff options
context:
space:
mode:
authorMichael Hennerich <michael.hennerich@analog.com>2010-05-24 17:33:15 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-25 11:07:04 -0400
commite3ae68476ce0636554b5d95a33777f80ba407dc0 (patch)
tree3aa1fbefa2d573e1830914fe899f79caf90157d8 /drivers/misc/ad525x_dpot.h
parent6c536e4ce8edd61fdc4ab68e19ae164a54fc958f (diff)
ad525x_dpot: add support for AD524x pots
New parts supported: AD5241, AD5242, AD5243, AD5245, AD5246, AD5247, AD5248 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.h27
1 files changed, 20 insertions, 7 deletions
diff --git a/drivers/misc/ad525x_dpot.h b/drivers/misc/ad525x_dpot.h
index 99b388e12f5f..849c5d0782b2 100644
--- a/drivers/misc/ad525x_dpot.h
+++ b/drivers/misc/ad525x_dpot.h
@@ -29,13 +29,14 @@
29 29
30#define F_CMD_INC (1 << 0) /* Features INC/DEC ALL, 6dB */ 30#define F_CMD_INC (1 << 0) /* Features INC/DEC ALL, 6dB */
31#define F_CMD_EEP (1 << 1) /* Features EEPROM */ 31#define F_CMD_EEP (1 << 1) /* Features EEPROM */
32#define F_CMD_TOL (1 << 2) /* RDACS are Read/Write + Tolerance REG */ 32#define F_CMD_OTP (1 << 2) /* Features OTP */
33#define F_RDACS_RW (1 << 3) /* RDACS are Read/Write + Tolerance REG */ 33#define F_CMD_TOL (1 << 3) /* RDACS feature Tolerance REG */
34#define F_RDACS_WONLY (1 << 4) /* RDACS are Write only */ 34#define F_RDACS_RW (1 << 4) /* RDACS are Read/Write */
35#define F_AD_APPDATA (1 << 5) /* RDAC Address append to data */ 35#define F_RDACS_WONLY (1 << 5) /* RDACS are Write only */
36#define F_SPI_8BIT (1 << 6) /* All SPI XFERS are 8-bit */ 36#define F_AD_APPDATA (1 << 6) /* RDAC Address append to data */
37#define F_SPI_16BIT (1 << 7) /* All SPI XFERS are 16-bit */ 37#define F_SPI_8BIT (1 << 7) /* All SPI XFERS are 8-bit */
38#define F_SPI_24BIT (1 << 8) /* All SPI XFERS are 24-bit */ 38#define F_SPI_16BIT (1 << 8) /* All SPI XFERS are 16-bit */
39#define F_SPI_24BIT (1 << 9) /* All SPI XFERS are 24-bit */
39 40
40#define F_RDACS_RW_TOL (F_RDACS_RW | F_CMD_EEP | F_CMD_TOL) 41#define F_RDACS_RW_TOL (F_RDACS_RW | F_CMD_EEP | F_CMD_TOL)
41#define F_RDACS_RW_EEP (F_RDACS_RW | F_CMD_EEP) 42#define F_RDACS_RW_EEP (F_RDACS_RW | F_CMD_EEP)
@@ -104,6 +105,15 @@ enum dpot_devid {
104 BRDAC0 | BRDAC1 | BRDAC2, 8, 31), 105 BRDAC0 | BRDAC1 | BRDAC2, 8, 31),
105 ADN2850_ID = DPOT_CONF(F_RDACS_RW_EEP | F_CMD_INC | F_SPI_24BIT, 106 ADN2850_ID = DPOT_CONF(F_RDACS_RW_EEP | F_CMD_INC | F_SPI_24BIT,
106 BRDAC0 | BRDAC1, 10, 32), 107 BRDAC0 | BRDAC1, 10, 32),
108 AD5241_ID = DPOT_CONF(F_RDACS_RW, BRDAC0, 8, 33),
109 AD5242_ID = DPOT_CONF(F_RDACS_RW, BRDAC0 | BRDAC1, 8, 34),
110 AD5243_ID = DPOT_CONF(F_RDACS_RW, BRDAC0 | BRDAC1, 8, 35),
111 AD5245_ID = DPOT_CONF(F_RDACS_RW, BRDAC0, 8, 36),
112 AD5246_ID = DPOT_CONF(F_RDACS_RW, BRDAC0, 7, 37),
113 AD5247_ID = DPOT_CONF(F_RDACS_RW, BRDAC0, 7, 38),
114 AD5248_ID = DPOT_CONF(F_RDACS_RW, BRDAC0 | BRDAC1, 8, 39),
115
116
107}; 117};
108 118
109#define DPOT_RDAC0 0 119#define DPOT_RDAC0 0
@@ -146,6 +156,9 @@ enum dpot_devid {
146#define DPOT_AD5291_RDAC 0x01 156#define DPOT_AD5291_RDAC 0x01
147#define DPOT_AD5291_READ_RDAC 0x02 157#define DPOT_AD5291_READ_RDAC 0x02
148 158
159/* AD524x use special commands */
160#define DPOT_AD5291_RDAC_AB 0x80
161
149struct dpot_data; 162struct dpot_data;
150 163
151struct ad_dpot_bus_ops { 164struct ad_dpot_bus_ops {