[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171122222526.20021-50-alexander.levin@verizon.com>
Date: Wed, 22 Nov 2017 22:25:48 +0000
From: alexander.levin@...izon.com
To: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"stable@...r.kernel.org" <stable@...r.kernel.org>
Cc: Ladislav Michl <ladis@...ux-mips.org>,
Daniel Baluta <daniel.baluta@...il.com>,
Jonathan Cameron <jic23@...nel.org>,
"Jonathan Cameron" <Jonathan.Cameron@...wei.com>,
alexander.levin@...izon.com
Subject: [PATCH AUTOSEL for 4.14 50/51] iio: adc: ti-ads1015: add 10% to
conversion wait time
From: Ladislav Michl <ladis@...ux-mips.org>
[ Upstream commit fe895ac88b9fbdf2026f0bfd56c82747bb9d7c48 ]
As user's guide "ADS1015EVM, ADS1115EVM, ADS1015EVM-PDK, ADS1115EVM-PDK
User Guide (Rev. B)" (http://www.ti.com/lit/ug/sbau157b/sbau157b.pdf)
states at page 16:
"Note that both the ADS1115 and ADS1015 have internal clocks with a ±10%
accuracy. If performing FFT tests, frequencies may appear to be incorrect
as a result of this tolerance range.", add those 10% to converion wait
time.
Cc: Daniel Baluta <daniel.baluta@...il.com>
Cc: Jonathan Cameron <jic23@...nel.org>
Signed-off-by: Ladislav Michl <ladis@...ux-mips.org>
Reviewed-by: Akinobu Mita <akinobu.mita@...il.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@...wei.com>
Signed-off-by: Sasha Levin <alexander.levin@...izon.com>
---
drivers/iio/adc/ti-ads1015.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/iio/adc/ti-ads1015.c b/drivers/iio/adc/ti-ads1015.c
index e0dc20488335..9ac2fb032df6 100644
--- a/drivers/iio/adc/ti-ads1015.c
+++ b/drivers/iio/adc/ti-ads1015.c
@@ -369,6 +369,7 @@ int ads1015_get_adc_result(struct ads1015_data *data, int chan, int *val)
conv_time = DIV_ROUND_UP(USEC_PER_SEC, data->data_rate[dr_old]);
conv_time += DIV_ROUND_UP(USEC_PER_SEC, data->data_rate[dr]);
+ conv_time += conv_time / 10; /* 10% internal clock inaccuracy */
usleep_range(conv_time, conv_time + 1);
data->conv_invalid = false;
}
--
2.11.0
Powered by blists - more mailing lists