Skip to content

Commit 9e128ce

Browse files
angelocjic23
authored andcommitted
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>
1 parent 03305e5 commit 9e128ce

1 file changed

Lines changed: 4 additions & 13 deletions

File tree

‎drivers/iio/adc/mcp3422.c‎

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,11 @@
5858
.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SAMP_FREQ), \
5959
}
6060

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-
7061
static const int mcp3422_scales[4][4] = {
71-
{ 1000000, 250000, 62500, 15625 },
72-
{ 500000 , 125000, 31250, 7812 },
73-
{ 250000 , 62500 , 15625, 3906 },
74-
{ 125000 , 31250 , 7812 , 1953 } };
62+
{ 1000000, 500000, 250000, 125000 },
63+
{ 250000 , 125000, 62500 , 31250 },
64+
{ 62500 , 31250 , 15625 , 7812 },
65+
{ 15625 , 7812 , 3906 , 1953 } };
7566

7667
/* Constant msleep times for data acquisitions */
7768
static const int mcp3422_read_times[4] = {

0 commit comments

Comments
 (0)