Linux IIO development
 help / color / mirror / Atom feed
From: Marc Titinger <mtitinger@baylibre.com>
To: jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net
Cc: afd@ti.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH-vs-togreg 2/2] iio: ina2xx-adc: fix scale for VShunt
Date: Fri, 11 Mar 2016 15:52:30 +0100	[thread overview]
Message-ID: <1457707950-17593-2-git-send-email-marc.titinger@baylibre.com> (raw)
In-Reply-To: <1457707950-17593-1-git-send-email-marc.titinger@baylibre.com>

The scale would result in uV instead of expected mV.
Mostly cosmetic, since the value of 'Power' was computed OK.

Signed-off-by: Marc Titinger <marc.titinger@baylibre.com>
---
 drivers/iio/adc/ina2xx-adc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/adc/ina2xx-adc.c b/drivers/iio/adc/ina2xx-adc.c
index e5ac120..6ada336 100644
--- a/drivers/iio/adc/ina2xx-adc.c
+++ b/drivers/iio/adc/ina2xx-adc.c
@@ -185,9 +185,9 @@ static int ina2xx_read_raw(struct iio_dev *indio_dev,
 	case IIO_CHAN_INFO_SCALE:
 		switch (chan->address) {
 		case INA2XX_SHUNT_VOLTAGE:
-			/* processed (mV) = raw*1000/shunt_div */
+			/* processed (mV) = raw/shunt_div */
 			*val2 = chip->config->shunt_div;
-			*val = 1000;
+			*val = 1;
 			return IIO_VAL_FRACTIONAL;
 
 		case INA2XX_BUS_VOLTAGE:
-- 
2.5.0


  reply	other threads:[~2016-03-11 14:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-11 14:52 [PATCH-vs-togreg 1/2] iio: ina2xx-adc: update the CALIB. register when RShunt changes Marc Titinger
2016-03-11 14:52 ` Marc Titinger [this message]
2016-03-11 15:04 ` Andrew F. Davis
2016-03-11 15:26   ` Marc Titinger
2016-03-11 16:01 ` kbuild test robot
2016-03-12  9:19 ` Jonathan Cameron
2016-03-14  9:24   ` Marc Titinger

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=1457707950-17593-2-git-send-email-marc.titinger@baylibre.com \
    --to=mtitinger@baylibre.com \
    --cc=afd@ti.com \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox