iio: adc: mcp3911: use correct formula for AD conversion
authorMarcus Folkesson <marcus.folkesson@gmail.com>
Fri, 22 Jul 2022 13:07:20 +0000 (15:07 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Sep 2022 10:28:04 +0000 (12:28 +0200)
commit95ac9601feb527d4d134960ac69ffb4b386ba3fb
tree44a4a23a12b0bd85c99e95df8de0015abede4f77
parent6e933a26e6a2e3d40ed9a269ddb4e0e3ed3ecdb5
iio: adc: mcp3911: use correct formula for AD conversion

commit 9e2238e3ae40d371a1130226e0e740aa1601efa6 upstream.

The ADC conversion is actually not rail-to-rail but with a factor 1.5.
Make use of this factor when calculating actual voltage.

Fixes: 3a89b289df5d ("iio: adc: add support for mcp3911")
Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20220722130726.7627-4-marcus.folkesson@gmail.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/adc/mcp3911.c