All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eva Rachel Retuya <eraretuya@gmail.com>
To: linux-iio@vger.kernel.org, outreachy-kernel@googlegroups.com
Cc: lars@metafoo.de, Michael.Hennerich@analog.com, jic23@kernel.org,
	knaack.h@gmx.de, pmeerw@pmeerw.net, gregkh@linuxfoundation.org,
	Eva Rachel Retuya <eraretuya@gmail.com>
Subject: [PATCH v3 2/2] staging: iio: ad7606: fix improper setting of oversampling pins
Date: Sat,  8 Oct 2016 14:50:05 +0800	[thread overview]
Message-ID: <9018314d134e3e33f892ad78969e11bf5ffa0950.1475907512.git.eraretuya@gmail.com> (raw)
In-Reply-To: <cover.1475907512.git.eraretuya@gmail.com>
In-Reply-To: <cover.1475907512.git.eraretuya@gmail.com>

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")
---
 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 437c7d0..2042225 100644
--- a/drivers/staging/iio/adc/ad7606_core.c
+++ b/drivers/staging/iio/adc/ad7606_core.c
@@ -183,7 +183,7 @@ static int ad7606_write_raw(struct iio_dev *indio_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 = val;
 		mutex_unlock(&indio_dev->mlock);
 		return 0;
-- 
2.7.4



  parent reply	other threads:[~2016-10-08  6:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-08  6:50 [PATCH v3 0/2] staging: iio: ad7606: oversampling_ratio clean-up Eva Rachel Retuya
2016-10-08  6:50 ` [PATCH v3 1/2] staging: iio: ad7606: implement IIO_CHAN_INFO_OVERSAMPLING_RATIO Eva Rachel Retuya
2016-10-08  6:50 ` Eva Rachel Retuya [this message]
2016-10-08 12:21   ` [PATCH v3 2/2] staging: iio: ad7606: fix improper setting of oversampling pins Lars-Peter Clausen
2016-10-12 12:42     ` [Outreachy kernel] " Greg KH
2016-10-12 13:03       ` Eva Rachel Retuya

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9018314d134e3e33f892ad78969e11bf5ffa0950.1475907512.git.eraretuya@gmail.com \
    --to=eraretuya@gmail.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=outreachy-kernel@googlegroups.com \
    --cc=pmeerw@pmeerw.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.