diff options
author | Angelo Compagnucci <angelo.compagnucci@gmail.com> | 2015-02-04 15:14:26 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-03-18 13:31:26 +0100 |
commit | be8a8e08a9ad0b04627b0cefec706a37e675061c (patch) | |
tree | 8a9a5f3ed5876d10321b8b1de2be8d1a3c765230 | |
parent | 21c8e9929c8bd70b317dbc3340d69ddd68f9e1bd (diff) | |
download | lwn-be8a8e08a9ad0b04627b0cefec706a37e675061c.tar.gz lwn-be8a8e08a9ad0b04627b0cefec706a37e675061c.zip |
iio:adc:mcp3422 Fix incorrect scales table
commit 9e128ced3851d2802b6db870f6b2e93f449ce013 upstream.
This patch fixes uncorrect order of mcp3422_scales table, the values
was erroneously transposed.
It removes also an unused array and a wrong comment.
Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/iio/adc/mcp3422.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/drivers/iio/adc/mcp3422.c b/drivers/iio/adc/mcp3422.c index 47dcb34ff44c..3a615f3b5d80 100644 --- a/drivers/iio/adc/mcp3422.c +++ b/drivers/iio/adc/mcp3422.c @@ -57,20 +57,11 @@ .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SAMP_FREQ), \ } -/* LSB is in nV to eliminate floating point */ -static const u32 rates_to_lsb[] = {1000000, 250000, 62500, 15625}; - -/* - * scales calculated as: - * rates_to_lsb[sample_rate] / (1 << pga); - * pga is 1 for 0, 2 - */ - static const int mcp3422_scales[4][4] = { - { 1000000, 250000, 62500, 15625 }, - { 500000 , 125000, 31250, 7812 }, - { 250000 , 62500 , 15625, 3906 }, - { 125000 , 31250 , 7812 , 1953 } }; + { 1000000, 500000, 250000, 125000 }, + { 250000 , 125000, 62500 , 31250 }, + { 62500 , 31250 , 15625 , 7812 }, + { 15625 , 7812 , 3906 , 1953 } }; /* Constant msleep times for data acquisitions */ static const int mcp3422_read_times[4] = { |