aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2012-09-04 05:10:00 -0400
committerJonathan Cameron <jic23@kernel.org>2012-09-08 05:14:45 -0400
commit2fafbce25063ae2732f2f2d9f853f1d97145eab5 (patch)
tree344fe7ea9647545c1ba2ec4b80493357c8c69ef3
parentce56ade6ae74e604a4b5d6ea5b1d58960fa8e7aa (diff)
iio:ad5446: Add support for the ad5300/ad5310/ad5320
The ad5300/ad5310/ad5320 is a family of single channel DACs with a SPI interface similar to the ad5601/ad5611/ad5621 but use a different shift factor for the data word. While we are at it also reorder the device part numbers in the ad5446 driver Kconfig to be ordered alphabetically. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
-rw-r--r--drivers/iio/dac/Kconfig6
-rw-r--r--drivers/iio/dac/ad5446.c18
2 files changed, 21 insertions, 3 deletions
diff --git a/drivers/iio/dac/Kconfig b/drivers/iio/dac/Kconfig
index 293b61dcc559..7599d62eb142 100644
--- a/drivers/iio/dac/Kconfig
+++ b/drivers/iio/dac/Kconfig
@@ -59,10 +59,10 @@ config AD5446
59 tristate "Analog Devices AD5446 and similar single channel DACs driver" 59 tristate "Analog Devices AD5446 and similar single channel DACs driver"
60 depends on (SPI_MASTER || I2C) 60 depends on (SPI_MASTER || I2C)
61 help 61 help
62 Say yes here to build support for Analog Devices AD5602, AD5612, AD5622, 62 Say yes here to build support for Analog Devices AD5300, AD5310, AD5320,
63 AD5444, AD5446, AD5450, AD5451, AD5452, AD5453, AD5512A, AD5541A, AD5542A, 63 AD5444, AD5446, AD5450, AD5451, AD5452, AD5453, AD5512A, AD5541A, AD5542A,
64 AD5543, AD5553, AD5601, AD5611, AD5620, AD5621, AD5640, AD5660, AD5662 64 AD5543, AD5553, AD5601, AD5602, AD5611, AD5612, AD5620, AD5621, AD5622,
65 DACs. 65 AD5640, AD5660, AD5662 DACs.
66 66
67 To compile this driver as a module, choose M here: the 67 To compile this driver as a module, choose M here: the
68 module will be called ad5446. 68 module will be called ad5446.
diff --git a/drivers/iio/dac/ad5446.c b/drivers/iio/dac/ad5446.c
index 7f11c1c89960..2b0968f717db 100644
--- a/drivers/iio/dac/ad5446.c
+++ b/drivers/iio/dac/ad5446.c
@@ -321,6 +321,9 @@ static int ad5660_write(struct ad5446_state *st, unsigned val)
321 * parts are supported here. 321 * parts are supported here.
322 */ 322 */
323enum ad5446_supported_spi_device_ids { 323enum ad5446_supported_spi_device_ids {
324 ID_AD5300,
325 ID_AD5310,
326 ID_AD5320,
324 ID_AD5444, 327 ID_AD5444,
325 ID_AD5446, 328 ID_AD5446,
326 ID_AD5450, 329 ID_AD5450,
@@ -341,6 +344,18 @@ enum ad5446_supported_spi_device_ids {
341}; 344};
342 345
343static const struct ad5446_chip_info ad5446_spi_chip_info[] = { 346static const struct ad5446_chip_info ad5446_spi_chip_info[] = {
347 [ID_AD5300] = {
348 .channel = AD5446_CHANNEL_POWERDOWN(8, 16, 4),
349 .write = ad5446_write,
350 },
351 [ID_AD5310] = {
352 .channel = AD5446_CHANNEL_POWERDOWN(10, 16, 2),
353 .write = ad5446_write,
354 },
355 [ID_AD5320] = {
356 .channel = AD5446_CHANNEL_POWERDOWN(12, 16, 0),
357 .write = ad5446_write,
358 },
344 [ID_AD5444] = { 359 [ID_AD5444] = {
345 .channel = AD5446_CHANNEL(12, 16, 2), 360 .channel = AD5446_CHANNEL(12, 16, 2),
346 .write = ad5446_write, 361 .write = ad5446_write,
@@ -418,6 +433,9 @@ static const struct ad5446_chip_info ad5446_spi_chip_info[] = {
418}; 433};
419 434
420static const struct spi_device_id ad5446_spi_ids[] = { 435static const struct spi_device_id ad5446_spi_ids[] = {
436 {"ad5300", ID_AD5300},
437 {"ad5310", ID_AD5310},
438 {"ad5320", ID_AD5320},
421 {"ad5444", ID_AD5444}, 439 {"ad5444", ID_AD5444},
422 {"ad5446", ID_AD5446}, 440 {"ad5446", ID_AD5446},
423 {"ad5450", ID_AD5450}, 441 {"ad5450", ID_AD5450},