]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
staging:iio:ad7606: fix voltage scales
authorAlexandru Ardelean <alexandru.ardelean@analog.com>
Thu, 13 Sep 2018 08:44:09 +0000 (11:44 +0300)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:58:45 +0000 (19:58 -0600)
commit85449cc6f63472b2e93f5dc90edd9ad77a368f71
tree3e90a925ec798818f03684d93dd197bb1ac6e5cb
parent1b02fd95ea19f2a0ce155b6212d0f7afce978125
staging:iio:ad7606: fix voltage scales

BugLink: https://bugs.launchpad.net/bugs/1836802
[ Upstream commit 4ee033301c898dd0835d035d0e0eb768a3d35da1 ]

Fixes commit 17be2a2905a6ec9aa27cd59521495e2f490d2af0 ("staging: iio:
ad7606: replace range/range_available with corresponding scale").

The AD7606 devices don't have a 2.5V voltage range, they have 5V & 10V
voltage range, which is selectable via the `gpio_range` descriptor.

The scales also seem to have been miscomputed, because when they were
applied to the raw values, the results differ from the expected values.
After checking the ADC transfer function in the datasheet, these were
re-computed.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/staging/iio/adc/ad7606.c