From: Marek Vasut <marex@denx.de>
To: linux-iio@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org, Marek Vasut <marex@denx.de>,
Jonathan Cameron <jic23@kernel.org>,
Juergen Beisert <jbe@pengutronix.de>,
Lars-Peter Clausen <lars@metafoo.de>, Wolfgang Denk <wd@denx.de>
Subject: [PATCH 1/3] IIO: Add 4-byte unsigned reads into generic-buffer example
Date: Fri, 3 Aug 2012 17:28:39 +0200 [thread overview]
Message-ID: <1344007721-11595-2-git-send-email-marex@denx.de> (raw)
In-Reply-To: <1344007721-11595-1-git-send-email-marex@denx.de>
Add unsigned 32bit-wide reads into the generic-buffer.c
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Jonathan Cameron <jic23@kernel.org>
Cc: Juergen Beisert <jbe@pengutronix.de>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Wolfgang Denk <wd@denx.de>
---
drivers/staging/iio/Documentation/generic_buffer.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/staging/iio/Documentation/generic_buffer.c b/drivers/staging/iio/Documentation/generic_buffer.c
index 827e92d..40d0eca 100644
--- a/drivers/staging/iio/Documentation/generic_buffer.c
+++ b/drivers/staging/iio/Documentation/generic_buffer.c
@@ -104,6 +104,16 @@ void process_scan(char *data,
print2byte(*(uint16_t *)(data + channels[k].location),
&channels[k]);
break;
+ case 4:
+ if (!channels[k].is_signed) {
+ uint32_t val = *(uint32_t *)
+ (data + channels[k].location);
+ printf("%05f ", ((float)val +
+ channels[k].offset)*
+ channels[k].scale);
+
+ }
+ break;
case 8:
if (channels[k].is_signed) {
int64_t val = *(int64_t *)
--
1.7.10.4
next prev parent reply other threads:[~2012-08-03 15:28 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-03 15:28 [PATCH 0/3] i.MX28 LRADC driver Marek Vasut
2012-08-03 15:28 ` Marek Vasut [this message]
2012-08-03 15:28 ` [PATCH 2/3 V2] IIO: Add basic MXS " Marek Vasut
2012-08-06 2:37 ` Shawn Guo
2012-08-06 3:53 ` Marek Vasut
2012-08-06 8:49 ` Lars-Peter Clausen
2012-08-11 23:11 ` Marek Vasut
2012-08-12 9:27 ` Lars-Peter Clausen
2012-08-03 15:28 ` [PATCH 3/3] IIO: arm: Add LRADC to i.MX28 dts Marek Vasut
2012-08-06 2:39 ` Shawn Guo
2012-08-12 14:23 ` [PATCH 0/3] i.MX28 LRADC driver Marek Vasut
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=1344007721-11595-2-git-send-email-marex@denx.de \
--to=marex@denx.de \
--cc=jbe@pengutronix.de \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=wd@denx.de \
/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).