Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

Commit

Permalink
iio:adc:mcp3422 Fix incorrect scales table
Browse files Browse the repository at this point in the history
commit 9e128ce 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: Sasha Levin <sasha.levin@oracle.com>
  • Loading branch information
angeloc authored and sashalevin committed Mar 14, 2015
1 parent 328499b commit 2c76bd8
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions drivers/iio/adc/mcp3422.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,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] = {
Expand Down

0 comments on commit 2c76bd8

Please sign in to comment.