summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorEva Rachel Retuya <eraretuya@gmail.com>2016-10-09 00:05:39 +0800
committerBen Hutchings <ben@decadent.org.uk>2017-03-16 02:26:15 +0000
commit6389caf7f6fe96f500adcc729251f0e0c9aafefc (patch)
treeb97bea4e4846410b60bda585440ac5b33f747ece /drivers
parentcfd0c7f4abfa175df6dfa40fc7083e22f982891e (diff)
downloadlinux-stable-6389caf7f6fe96f500adcc729251f0e0c9aafefc.tar.gz
linux-stable-6389caf7f6fe96f500adcc729251f0e0c9aafefc.tar.bz2
linux-stable-6389caf7f6fe96f500adcc729251f0e0c9aafefc.zip
staging: iio: ad7606: fix improper setting of oversampling pins
commit b321a38d2407c7e425c54bc09be909a34e49f740 upstream. The oversampling ratio is controlled using the oversampling pins, OS [2:0] with OS2 being the MSB control bit, and OS0 the LSB control bit. The gpio connected to the OS2 pin is not being set correctly, only OS0 and OS1 pins are being set. Fix the typo to allow proper control of the oversampling pins. Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com> Fixes: b9618c0 ("staging: IIO: ADC: New driver for AD7606/AD7606-6/AD7606-4") Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/iio/adc/ad7606_core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/iio/adc/ad7606_core.c b/drivers/staging/iio/adc/ad7606_core.c
index f0f05f195d2c..d4598ef48543 100644
--- a/drivers/staging/iio/adc/ad7606_core.c
+++ b/drivers/staging/iio/adc/ad7606_core.c
@@ -186,7 +186,7 @@ static ssize_t ad7606_store_oversampling_ratio(struct device *dev,
mutex_lock(&indio_dev->mlock);
gpio_set_value(st->pdata->gpio_os0, (ret >> 0) & 1);
gpio_set_value(st->pdata->gpio_os1, (ret >> 1) & 1);
- gpio_set_value(st->pdata->gpio_os1, (ret >> 2) & 1);
+ gpio_set_value(st->pdata->gpio_os2, (ret >> 2) & 1);
st->oversampling = lval;
mutex_unlock(&indio_dev->mlock);