OSDN Git Service

iio:dac:ad5686: Add AD5310R support
authorStefan Popa <stefan.popa@analog.com>
Thu, 6 Dec 2018 13:38:30 +0000 (15:38 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 8 Dec 2018 15:35:55 +0000 (15:35 +0000)
commit12d323cf6dd558b442fa3f03af3c7703617eed81
treef0d7be619f46dd0883985c10bd256afaa54d1de7
parent5c608d4dd49a4ffbedc85f8a89820173df12b111
iio:dac:ad5686: Add AD5310R support

The AD5310R is a single channel DAC with 10-bit precision, which is
part of the same family as AD5311R, except that it uses the spi interface
instead of i2c. The device has a built-in 2.5V reference which is enabled
by default.

Another important difference is that the SPI write command operation is
16 bits long. The first four bits represent the command, while the
remaining 12 bits are for data. In the control reg, DB9 and DB10 are used
for power-down modes, while DB8 is the REF bit. In order to accommodate
this change, a new regmap type was defined and checked accordingly.

Because AD5310R does not have a readback register, the read_raw operation
will return "Operation is not supported".

Datasheet:
Link: http://www.analog.com/media/en/technical-documentation/data-sheets/AD5310R_5311R.pdf
Signed-off-by: Stefan Popa <stefan.popa@analog.com>
Signed-off-by: Mircea Caprioru <mircea.caprioru@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/dac/ad5686-spi.c
drivers/iio/dac/ad5686.c
drivers/iio/dac/ad5686.h