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,
device-drivers-devel@blackfin.uclinux.org, drivers@analog.com
Subject: Re: [PATCH v2 09/11] staging:iio:dac:ad5446: Return cached value for 'raw' attribute
Date: Tue, 24 Apr 2012 17:56:39 +0100 [thread overview]
Message-ID: <4F96DB47.30800@kernel.org> (raw)
In-Reply-To: <1335286181-20474-9-git-send-email-lars@metafoo.de>
On 04/24/2012 05:49 PM, Lars-Peter Clausen wrote:
> We can not read back the value from the device, but we cache the value anyway so
> we might as well return the cached value instead of an error.
>
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
> ---
> drivers/staging/iio/dac/ad5446.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/staging/iio/dac/ad5446.c b/drivers/staging/iio/dac/ad5446.c
> index 731cd05..9dc67c8 100644
> --- a/drivers/staging/iio/dac/ad5446.c
> +++ b/drivers/staging/iio/dac/ad5446.c
> @@ -229,6 +229,9 @@ static int ad5446_read_raw(struct iio_dev *indio_dev,
> unsigned long scale_uv;
>
> switch (m) {
> + case IIO_CHAN_INFO_RAW:
> + *val = st->cached_val;
> + return IIO_VAL_INT;
> case IIO_CHAN_INFO_SCALE:
> scale_uv = (st->vref_mv * 1000) >> chan->scan_type.realbits;
> *val = scale_uv / 1000;
next prev parent reply other threads:[~2012-04-24 16:56 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-24 16:49 [PATCH v2 01/11] staging:iio:dac:ad5446: Do not exit powerdown when writing a sample Lars-Peter Clausen
2012-04-24 16:49 ` [PATCH v2 02/11] staging:iio:dac:ad5446: Remove duplicated write sample functions Lars-Peter Clausen
2012-04-24 16:49 ` [PATCH v2 03/11] staging:iio:dac:ad5446: Fix 24bit transfers Lars-Peter Clausen
2012-04-24 16:55 ` Jonathan Cameron
2012-04-24 16:49 ` [PATCH v2 04/11] staging:iio:dac:ad5446: Remove unused struct field Lars-Peter Clausen
2012-04-24 16:49 ` [PATCH v2 05/11] staging:iio:dac:ad5446: Do not check for individual chip ids in probe Lars-Peter Clausen
2012-04-24 16:49 ` [PATCH v2 06/11] staging:iio:dac:ad5446: Remove duplicated chip_info entries Lars-Peter Clausen
2012-04-24 16:49 ` [PATCH v2 07/11] staging:iio:dac:ad5446: Convert to extended channel attributes Lars-Peter Clausen
2012-04-24 16:49 ` [PATCH v2 08/11] staging:iio:dac:ad5446: Consolidate store_sample and store_pwr_down functions Lars-Peter Clausen
2012-04-24 16:56 ` Jonathan Cameron
2012-04-24 16:49 ` [PATCH v2 09/11] staging:iio:dac:ad5446: Return cached value for 'raw' attribute Lars-Peter Clausen
2012-04-24 16:56 ` Jonathan Cameron [this message]
2012-04-24 16:49 ` [PATCH v2 10/11] staging:iio:dac:ad5446: Add support for the AD5662 Lars-Peter Clausen
2012-04-24 16:57 ` Jonathan Cameron
2012-04-24 16:49 ` [PATCH v2 11/11] staging:iio:dac:ad5446: Update Kconfig entry Lars-Peter Clausen
2012-04-24 16:58 ` Jonathan Cameron
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=4F96DB47.30800@kernel.org \
--to=jic23@kernel.org \
--cc=device-drivers-devel@blackfin.uclinux.org \
--cc=drivers@analog.com \
--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;
as well as URLs for NNTP newsgroup(s).