summaryrefslogtreecommitdiffstats
path: root/drivers/iio/adc
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-02-28 07:15:09 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-02-28 07:15:09 -0800
commitd582cb792647dfc82345e53cff15b6ab87e2540f (patch)
treea9a1a3ccfee9cba5d069780b10ae9a4069b932b1 /drivers/iio/adc
parentc517d838eb7d07bbe9507871fab3931deccff539 (diff)
parente01becbad300712a28f29b666e685536f45e83bc (diff)
downloadop-kernel-dev-d582cb792647dfc82345e53cff15b6ab87e2540f.zip
op-kernel-dev-d582cb792647dfc82345e53cff15b6ab87e2540f.tar.gz
Merge tag 'iio-fixes-for-4.0a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus
Jonathan writes: First round of fixes for IIO in the 4.0 cycle. Note a followup set dependent on patches in the recent merge windows will follow shortly. * dht11 - fix a read off the end of an array, add some locking to prevent the read function being interrupted and make sure gpio/irq lines are not enabled for irqs during output. * iadc - timeout should be in jiffies not msecs * mpu6050 - avoid a null id from ACPI emumeration being dereferenced. * mxs-lradc - fix up some interaction issues between the touchscreen driver and iio driver. Mostly about making sure that the adc driver only affects channels that are not being used for the touchscreen. * ad2s1200 - sign extension fix for a result of c type promotion. * adis16400 - sign extension fix for a result of c type promotion. * mcp3422 - scale table was transposed. * ad5686 - use _optional regulator get to avoid a dummy reg being allocate which would cause the driver to fail to initialize. * gp2ap020a00f - select REGMAP_I2C * si7020 - revert an incorrect cleanup up and then fix the issue that made that cleanup seem like a good idea.
Diffstat (limited to 'drivers/iio/adc')
-rw-r--r--drivers/iio/adc/mcp3422.c17
-rw-r--r--drivers/iio/adc/qcom-spmi-iadc.c3
2 files changed, 6 insertions, 14 deletions
diff --git a/drivers/iio/adc/mcp3422.c b/drivers/iio/adc/mcp3422.c
index 5167225..b96c636 100644
--- a/drivers/iio/adc/mcp3422.c
+++ b/drivers/iio/adc/mcp3422.c
@@ -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] = {
diff --git a/drivers/iio/adc/qcom-spmi-iadc.c b/drivers/iio/adc/qcom-spmi-iadc.c
index b9666f2..fabd24e 100644
--- a/drivers/iio/adc/qcom-spmi-iadc.c
+++ b/drivers/iio/adc/qcom-spmi-iadc.c
@@ -296,7 +296,8 @@ static int iadc_do_conversion(struct iadc_chip *iadc, int chan, u16 *data)
if (iadc->poll_eoc) {
ret = iadc_poll_wait_eoc(iadc, wait);
} else {
- ret = wait_for_completion_timeout(&iadc->complete, wait);
+ ret = wait_for_completion_timeout(&iadc->complete,
+ usecs_to_jiffies(wait));
if (!ret)
ret = -ETIMEDOUT;
else
OpenPOWER on IntegriCloud