From: Jonathan Cameron <jic23@kernel.org>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: Jonathan Cameron <jic23@cam.ac.uk>, linux-iio@vger.kernel.org
Subject: Re: [PATCH 1/7] staging:iio:ad7291: Use IIO_VAL_FRACTIONAL_LOG2
Date: Fri, 14 Jun 2013 21:50:05 +0100 [thread overview]
Message-ID: <51BB81FD.5020305@kernel.org> (raw)
In-Reply-To: <1371225508-32190-1-git-send-email-lars@metafoo.de>
On 06/14/2013 04:58 PM, Lars-Peter Clausen wrote:
> This is a bit more straight forward and also allows better precession when using
> the an in-kernel consumer.
>
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Applied to the togreg branch of iio.git
> ---
> drivers/staging/iio/adc/ad7291.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/staging/iio/adc/ad7291.c b/drivers/staging/iio/adc/ad7291.c
> index d088c66..a3a3a2f 100644
> --- a/drivers/staging/iio/adc/ad7291.c
> +++ b/drivers/staging/iio/adc/ad7291.c
> @@ -456,7 +456,6 @@ static int ad7291_read_raw(struct iio_dev *indio_dev,
> {
> int ret;
> struct ad7291_chip_info *chip = iio_priv(indio_dev);
> - unsigned int scale_uv;
> u16 regval;
> s16 signval;
>
> @@ -513,10 +512,9 @@ static int ad7291_read_raw(struct iio_dev *indio_dev,
> case IIO_CHAN_INFO_SCALE:
> switch (chan->type) {
> case IIO_VOLTAGE:
> - scale_uv = (chip->int_vref_mv * 1000) >> AD7291_BITS;
> - *val = scale_uv / 1000;
> - *val2 = (scale_uv % 1000) * 1000;
> - return IIO_VAL_INT_PLUS_MICRO;
> + *val = chip->int_vref_mv;
> + *val2 = AD7291_BITS;
> + return IIO_VAL_FRACTIONAL_LOG2;
> case IIO_TEMP:
> /*
> * One LSB of the ADC corresponds to 0.25 deg C.
>
prev parent reply other threads:[~2013-06-15 9:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-14 15:58 [PATCH 1/7] staging:iio:ad7291: Use IIO_VAL_FRACTIONAL_LOG2 Lars-Peter Clausen
2013-06-14 15:58 ` [PATCH 2/7] staging:iio:ad7291: Remove userspace reset Lars-Peter Clausen
2013-06-14 20:51 ` Jonathan Cameron
2013-06-14 15:58 ` [PATCH 3/7] staging:iio:ad7291: Remove unnecessary dev_info() from probe() Lars-Peter Clausen
2013-06-14 15:58 ` [PATCH 4/7] staging:iio:ad7291: Simplify threshold register lookup Lars-Peter Clausen
2013-06-14 15:58 ` [PATCH 5/7] staging:iio:ad7291: Use i2c_smbus_{read,write}_word_swapped instead of open-coding it Lars-Peter Clausen
2013-06-14 15:58 ` [PATCH 6/7] staging:iio:ad7291: Use sign_extend32 " Lars-Peter Clausen
2013-06-14 20:54 ` Jonathan Cameron
2013-06-14 15:58 ` [PATCH 7/7] staging:iio:ad7291: Rework regulator handling Lars-Peter Clausen
2013-06-14 20:55 ` Jonathan Cameron
2013-06-14 20:50 ` Jonathan Cameron [this message]
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=51BB81FD.5020305@kernel.org \
--to=jic23@kernel.org \
--cc=jic23@cam.ac.uk \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
/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