From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de ([195.135.220.15]:48277 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751116AbdAUHl5 (ORCPT ); Sat, 21 Jan 2017 02:41:57 -0500 From: Jiri Slaby To: stable@vger.kernel.org Cc: Eva Rachel Retuya , Jonathan Cameron , Jiri Slaby Subject: [patch added to 3.12-stable] staging: iio: ad7606: fix improper setting of oversampling pins Date: Sat, 21 Jan 2017 08:40:47 +0100 Message-Id: <20170121074102.25260-50-jslaby@suse.cz> In-Reply-To: <20170121074102.25260-1-jslaby@suse.cz> References: <20170121074102.25260-1-jslaby@suse.cz> Sender: stable-owner@vger.kernel.org List-ID: From: Eva Rachel Retuya This patch has been added to the 3.12 stable tree. If you have any objections, please let us know. =============== 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 Fixes: b9618c0 ("staging: IIO: ADC: New driver for AD7606/AD7606-6/AD7606-4") Acked-by: Lars-Peter Clausen Signed-off-by: Jonathan Cameron Signed-off-by: Jiri Slaby --- drivers/staging/iio/adc/ad7606_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/iio/adc/ad7606_core.c b/drivers/staging/iio/adc/ad7606_core.c index 72868ceda360..740a8eab262a 100644 --- a/drivers/staging/iio/adc/ad7606_core.c +++ b/drivers/staging/iio/adc/ad7606_core.c @@ -189,7 +189,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); -- 2.11.0