]> git.baikalelectronics.ru Git - kernel.git/commit
iio: adc: ti-ads8344: properly byte swap value
authorAlexandre Belloni <alexandre.belloni@bootlin.com>
Thu, 16 Apr 2020 20:54:27 +0000 (22:54 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 19 Apr 2020 16:50:02 +0000 (17:50 +0100)
commit4dad72d63bee36288d33bafa26fc9a69fc0de4ea
treed5fdf54eac7f63a6bbc973a4b504269f726d22e7
parentd867dbafbde702eef0ab1ddc9977bc8bfc1b70a1
iio: adc: ti-ads8344: properly byte swap value

The first received byte is the MSB, followed by the LSB so the value needs
to be byte swapped.

Also, the ADC actually has a delay of one clock on the SPI bus. Read three
bytes to get the last bit.

Fixes: f904e179a4d2 ("iio: adc: Add driver for the TI ADS8344 A/DC chips")
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ti-ads8344.c