diff options
author | Angelo Compagnucci <angelo.compagnucci@gmail.com> | 2015-02-04 09:14:26 -0500 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2015-02-04 11:30:22 -0500 |
commit | 9e128ced3851d2802b6db870f6b2e93f449ce013 (patch) | |
tree | 29c354c79e624b609f96900c31f3991880be68d9 /drivers/iio | |
parent | 03305e535cd5cdc1079b32909bf4b2dd67d46f7f (diff) |
iio:adc:mcp3422 Fix incorrect scales table
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>
Cc: Stable@vger.kernel.org
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio')
-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 51672256072b..b96c636470ef 100644 --- a/drivers/iio/adc/mcp3422.c +++ b/drivers/iio/adc/mcp3422.c | |||
@@ -58,20 +58,11 @@ | |||
58 | .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SAMP_FREQ), \ | 58 | .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SAMP_FREQ), \ |
59 | } | 59 | } |
60 | 60 | ||
61 | /* LSB is in nV to eliminate floating point */ | ||
62 | static const u32 rates_to_lsb[] = {1000000, 250000, 62500, 15625}; | ||
63 | |||
64 | /* | ||
65 | * scales calculated as: | ||
66 | * rates_to_lsb[sample_rate] / (1 << pga); | ||
67 | * pga is 1 for 0, 2 | ||
68 | */ | ||
69 | |||
70 | static const int mcp3422_scales[4][4] = { | 61 | static const int mcp3422_scales[4][4] = { |
71 | { 1000000, 250000, 62500, 15625 }, | 62 | { 1000000, 500000, 250000, 125000 }, |
72 | { 500000 , 125000, 31250, 7812 }, | 63 | { 250000 , 125000, 62500 , 31250 }, |
73 | { 250000 , 62500 , 15625, 3906 }, | 64 | { 62500 , 31250 , 15625 , 7812 }, |
74 | { 125000 , 31250 , 7812 , 1953 } }; | 65 | { 15625 , 7812 , 3906 , 1953 } }; |
75 | 66 | ||
76 | /* Constant msleep times for data acquisitions */ | 67 | /* Constant msleep times for data acquisitions */ |
77 | static const int mcp3422_read_times[4] = { | 68 | static const int mcp3422_read_times[4] = { |