]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
iio: adc: ti-ads1015: fix scale information for ADS1115
authorAkinobu Mita <akinobu.mita@gmail.com>
Thu, 20 Jul 2017 15:24:18 +0000 (00:24 +0900)
committerSeth Forshee <seth.forshee@canonical.com>
Sun, 10 Sep 2017 23:08:43 +0000 (18:08 -0500)
commite99c690151e48b3de09431d29a3ab09104ffc9ac
treef19e474a183f22288f65efe94f6b0a586bf6e24b
parenta8da3223f75c4be676273ed22ca6725d632bf32a
iio: adc: ti-ads1015: fix scale information for ADS1115

BugLink: http://bugs.launchpad.net/bugs/1716284
commit 8d0e8e795623bd6229cf48bb7777a1c456c370ed upstream.

The ti-ads1015 driver supports ADS1015 and ADS1115 devices.  The same
scale information is used for both devices in this driver, however they
have actually different values and the ADS1115's one is not correct.

These devices have the same full-scale input voltage range for each PGA
selection.  So instead of adding another hardcoded scale information,
compute a correct scale on demand from each device's resolution.

Cc: Daniel Baluta <daniel.baluta@gmail.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
drivers/iio/adc/ti-ads1015.c