Commit 9e128ced authored by Angelo Compagnucci's avatar Angelo Compagnucci Committed by Jonathan Cameron

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: default avatarAngelo Compagnucci <angelo.compagnucci@gmail.com>
Cc: Stable@vger.kernel.org
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 03305e53
...@@ -58,20 +58,11 @@ ...@@ -58,20 +58,11 @@
.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .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] = { static const int mcp3422_scales[4][4] = {
{ 1000000, 250000, 62500, 15625 }, { 1000000, 500000, 250000, 125000 },
{ 500000 , 125000, 31250, 7812 }, { 250000 , 125000, 62500 , 31250 },
{ 250000 , 62500 , 15625, 3906 }, { 62500 , 31250 , 15625 , 7812 },
{ 125000 , 31250 , 7812 , 1953 } }; { 15625 , 7812 , 3906 , 1953 } };
/* Constant msleep times for data acquisitions */ /* Constant msleep times for data acquisitions */
static const int mcp3422_read_times[4] = { static const int mcp3422_read_times[4] = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment