linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Meerwald <pmeerw@pmeerw.net>
To: linux-iio@vger.kernel.org
Cc: Peter Meerwald <pmeerw@pmeerw.net>
Subject: [PATCH 1/3] iio: add IIO_ST macros specifying endianness, IIO_ST_CPU and IIO_ST_BE
Date: Sun, 30 Sep 2012 12:05:43 +0200	[thread overview]
Message-ID: <1348999545-19099-1-git-send-email-pmeerw@pmeerw.net> (raw)

add IIO_ST_BE (for big endian); we can make use of in a subsequent
patch (max1363 driver and ad_sigma_delta.h)

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
---
 include/linux/iio/iio.h |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
index c0ae76a..a5b6a03 100644
--- a/include/linux/iio/iio.h
+++ b/include/linux/iio/iio.h
@@ -278,8 +278,14 @@ static inline bool iio_channel_has_info(const struct iio_chan_spec *chan,
 	return chan->info_mask & IIO_CHAN_INFO_BITS(type);
 }
 
-#define IIO_ST(si, rb, sb, sh)						\
-	{ .sign = si, .realbits = rb, .storagebits = sb, .shift = sh }
+#define IIO_ST_CPU(si, rb, sb, sh)					\
+	{ .sign = si, .realbits = rb, .storagebits = sb, .shift = sh,	\
+	  .endianness = IIO_CPU }
+#define IIO_ST_BE(si, rb, sb, sh)					\
+	{ .sign = si, .realbits = rb, .storagebits = sb, .shift = sh,	\
+	  .endianness = IIO_BE }
+
+#define IIO_ST(si, rb, sb, sh) IIO_ST_CPU(si, rb, sb, sh)
 
 #define IIO_CHAN_SOFT_TIMESTAMP(_si)					\
 	{ .type = IIO_TIMESTAMP, .channel = -1,				\
-- 
1.7.9.5


             reply	other threads:[~2012-09-30 10:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-30 10:05 Peter Meerwald [this message]
2012-09-30 10:05 ` [PATCH 2/3] iio staging: make use of IIO_ST macro where easily possible Peter Meerwald
2012-09-30 10:35   ` Jonathan Cameron
2012-09-30 11:16     ` Peter Meerwald
2012-09-30 10:05 ` [PATCH 3/3] staging iio: consistent commas in adis16400 channel spec Peter Meerwald
2012-10-13 20:27   ` 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=1348999545-19099-1-git-send-email-pmeerw@pmeerw.net \
    --to=pmeerw@pmeerw.net \
    --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).