[PATCH 1/3] iio: add IIO_ST macros specifying endianness, IIO_ST_CPU and IIO_ST_BE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux