aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/adc/ad7606_spi.c
AgeCommit message (Collapse)Author
2019-08-25iio: adc: ad7606: Add support for AD7606B ADCStefan Popa
The AD7606B is a 16-bit ADC that supports simultaneous sampling of 8 channels. It is pin compatible to AD7606, but adds extra modes by writing to the register map. The AD7606B can be configured to work in software mode by setting all oversampling pins to high. This mode is selected by default. The oversampling ratio is configured from the OS_MODE register (address 0x08) with the addition of OS=128 and OS=256 that were not available in hardware mode. The device is configured to output data on a single spi channel, but this configuration must be done right after restart. That is why the delay was removed for devices which doesn't require it. Moreover, in software mode, the range gpio has no longer its function. Instead, the scale can be configured individually for each channel from the RANGE_CH registers (address 0x03 to 0x06). Besides the already supported ±10 V and ±5 V ranges, software mode can also accommodate the ±2.5 V range. Signed-off-by: Stefan Popa <stefan.popa@analog.com> Co-developed-by: Beniamin Bia <beniamin.bia@analog.com> Signed-off-by: Beniamin Bia <beniamin.bia@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-07-28iio: adc: ad7606: Add support for software mode for ad7616Beniamin Bia
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>
2019-04-14iio: adc: ad7616: Add support for AD7616 ADCBeniamin Bia
The AD7616 is a 12-bit ADC with 16 channels. The AD7616 can be configured to work in hardware mode by controlling it via gpio pins and read data via spi. No support for software mode yet, but it is a work in progress. This device requires a reset in order to update oversampling, so chip info has got a new attribute to mark this. The current assumption that this driver makes for AD7616, is that it's working in Hardware Mode with Serial, Burst and Sequencer modes activated. To activate them, following pins must be pulled high: -SER/PAR -SEQEN And following must be pulled low: -WR/BURST -DB4/SEQEN Datasheets: Link: https://www.analog.com/media/en/technical-documentation/data-sheets/ad7616.pdf Signed-off-by: Beniamin Bia <beniamin.bia@analog.com> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-01-05staging: iio: adc: ad7606: Move out of stagingStefan Popa
Move ad7606 ADC driver out of staging and into the mainline. Signed-off-by: Stefan Popa <stefan.popa@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>