iio: adc: ad7606: Add support for software mode for ad7616
authorBeniamin Bia <beniamin.bia@analog.com>
Thu, 18 Jul 2019 06:27:33 +0000 (09:27 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 28 Jul 2019 07:56:08 +0000 (08:56 +0100)
commitf2a22e1e172f7dc486325216ec0890f301cb09e2
treece256a21de021847a717f8bd0b342bc0d8eca7e9
parentc5d93137af93c228392d133b3b00a0edae80dd40
iio: adc: ad7606: Add support for software mode for ad7616

Support for ad7616 running in software was added. In order
to activate the software mode, HW_RNGSEL pins must be pulled low.
Oversampling and input ranges are now configured in corresponding
registers. Ad7616 has multiple scale options when it is configured
in software mode.
Also, in order to support multiple devices in software mode, the spi
calculation of registers address must be generic. Because
the length of address and bit which specifies the read/write operation is
different for every device, calculation of address was made generic.

Signed-off-by: Beniamin Bia <beniamin.bia@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ad7606.c
drivers/iio/adc/ad7606.h
drivers/iio/adc/ad7606_spi.c