Skip to contentSkip to conversation

Drop the IIO_ST macro for setting scan_type elements.

PATCH Applied Jonathan Cameron 2 participants 33 messages Dec 11, 2013 – Feb 15, 2014

Subsystems (5)
lore
Share & tools
lore

Jonathan Cameron

author maintainer
#0 lore raw

cover Drop the IIO_ST macro for setting scan_type elements.

This macro is no longer fit for purpose given it doesn't allow the endianness of the element to be set. Missuse of the macro has also been responsible for a couple of bugs including some fixed in this series.

If everyone is happy I'll be apply the fixes through the fixes-togreg branch and follow up with the others after those have worked their way through.

Please do check the fixes in particular as I'm not entirely sure they are correct (particularly the ad7887 which gave me a headache on a train last night at the end of a very long day).

Thanks,

Jonathan

Jonathan Cameron (24):
staging:iio:mag:hmc5843 fix incorrect endianness of channel as a
result of missuse of the IIO_ST macro.
iio:imu:adis16400 fix pressure channel scan type iio:adc:ad7887 Fix channel reported endianness from cpu to big endian iio:accel:bma180 replaces IIO_ST macro with explicit entries to struct
scan_type
iio:mag:mag3110 replaces IIO_ST macro with explicit entries to struct
scan_type
iio:dac:ad5064 replaces IIO_ST macro with explicit entries to struct
scan_type
iio:dac:ad5360 replaces IIO_ST macro with explicit entries to struct
scan_type
iio:dac:ad5380 replaces IIO_ST macro with explicit entries to struct
scan_type
iio:dac:ad5421 replaces IIO_ST macro with explicit entries to struct
scan_type
iio:dac:ad5446 replaces IIO_ST macro with explicit entries to struct
scan_type
iio:dac:ad5449 replaces IIO_ST macro with explicit entries to struct
scan_type
iio:dac:ad5504 replaces IIO_ST macro with explicit entries to struct
scan_type
iio:dac:ad5624r replaces IIO_ST macro with explicit entries to struct
scan_type
iio:dac:ad5686 replaces IIO_ST macro with explicit entries to struct
scan_type
iio:dac:ad5755 replaces IIO_ST macro with explicit entries to struct
scan_type
iio:dac:ad5764 replaces IIO_ST macro with explicit entries to struct
scan_type
iio:dac:ad5791 replaces IIO_ST macro with explicit entries to struct
scan_type
iio:dac:max517 drop specification of scan type as unused in this
driver.
iio:dac:mcp4725 drop specification of scan type as unused in this
driver.
iio:light:adjd_s311 replaces IIO_ST macro with explicit entries to
struct scan_type
iio:light:tcs3472 replaces IIO_ST macro with explicit entries to
struct scan_type
staging:iio:ad7606 replaces IIO_ST macro with explicit entries to
struct scan_type
staging:iio:ad799x replaces IIO_ST macro with explicit entries to
struct scan_type
iio:drop IIO_ST macro

 drivers/iio/accel/bma180.c                 |  7 ++++++-
 drivers/iio/adc/ad7887.c                   | 16 ++++++++++++++--
 drivers/iio/dac/ad5064.c                   |  7 ++++++-
 drivers/iio/dac/ad5360.c                   |  7 ++++++-
 drivers/iio/dac/ad5380.c                   |  7 ++++++-
 drivers/iio/dac/ad5421.c                   |  6 +++++-
 drivers/iio/dac/ad5446.c                   |  9 +++++++--
 drivers/iio/dac/ad5449.c                   |  7 ++++++-
 drivers/iio/dac/ad5504.c                   |  6 +++++-
 drivers/iio/dac/ad5624r_spi.c              |  7 ++++++-
 drivers/iio/dac/ad5686.c                   |  9 +++++++--
 drivers/iio/dac/ad5755.c                   |  7 ++++++-
 drivers/iio/dac/ad5764.c                   |  7 ++++++-
 drivers/iio/dac/ad5791.c                   |  9 +++++++--
 drivers/iio/dac/max517.c                   |  1 -
 drivers/iio/dac/mcp4725.c                  |  1 -
 drivers/iio/imu/adis16400_core.c           |  7 ++++++-
 drivers/iio/light/adjd_s311.c              |  7 ++++++-
 drivers/iio/light/tcs3472.c                |  7 ++++++-
 drivers/iio/magnetometer/mag3110.c         |  6 +++++-
 drivers/staging/iio/adc/ad7606_core.c      |  7 ++++++-
 drivers/staging/iio/adc/ad799x_core.c      |  8 +++++++-
 drivers/staging/iio/magnetometer/hmc5843.c |  7 ++++++-
 include/linux/iio/iio.h                    | 16 ++++++++++------
 24 files changed, 145 insertions(+), 33 deletions(-)
Signature · 1 line
1.8.4.2
author maintainer
#1 lore raw

PATCH 1/24 staging:iio:mag:hmc5843 fix incorrect endianness of channel as a result of missuse of the IIO_ST macro.

This driver sets the shift value equal to IIO_BE (or 1) rather than setting that to 0 and specificying the endianness. This means the channel type is missreported as
[be|le]:u16/16>>1 where the be|le is dependent on the cpu native endianness, rather than
be:u16/16>>0 resulting in any userspace code using this information, miss converting the channel and generating thoroughly trashed data.

---
 drivers/staging/iio/magnetometer/hmc5843.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/staging/iio/magnetometer/hmc5843.c +6 -1
index bdb018878296..680eb743df9a 100644
@@ -451,7 +451,12 @@ done:
 		.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE) |	\
 			BIT(IIO_CHAN_INFO_SAMP_FREQ),			\
 		.scan_index = idx,					\
-		.scan_type = IIO_ST('s', 16, 16, IIO_BE),		\
+		.scan_type = {						\
+			.sign = 's',					\
+			.realbits = 16,				\
+			.storagebits = 16,				\
+			.endianness = IIO_BE,				\
+			},						\
 	}
 
 static const struct iio_chan_spec hmc5843_channels[] = {
Signature · 1 line
1.8.4.2
author maintainer
#2 lore raw

Re: [PATCH 01/24] staging:iio:mag:hmc5843 fix incorrect endianness of channel as a result of missuse of the IIO_ST macro.

Quoted 9 lines · Jonathan Cameron

This driver sets the shift value equal to IIO_BE (or 1) rather than setting that to 0 and specificying the endianness. This means the channel type is missreported as
[be|le]:u16/16>>1 where the be|le is dependent on the cpu native endianness, rather than
be:u16/16>>0 resulting in any userspace code using this information, miss converting the channel and generating thoroughly trashed data.

Applied with the formatting fixup to the fixes-togreg branch of iio.git.

Tagged for stable.

Quoted 23 lines
---
 drivers/staging/iio/magnetometer/hmc5843.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/staging/iio/magnetometer/hmc5843.c +6 -1
index bdb018878296..680eb743df9a 100644
@@ -451,7 +451,12 @@ done:
 		.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE) |	\
 			BIT(IIO_CHAN_INFO_SAMP_FREQ),			\
 		.scan_index = idx,					\
-		.scan_type = IIO_ST('s', 16, 16, IIO_BE),		\
+		.scan_type = {						\
+			.sign = 's',					\
+			.realbits = 16,				\
+			.storagebits = 16,				\
+			.endianness = IIO_BE,				\
+			},						\
 	}
 
 static const struct iio_chan_spec hmc5843_channels[] = {
author maintainer
#3 lore raw

PATCH 2/24 iio:imu:adis16400 fix pressure channel scan type

In reply to Jonathan Cameron

A single channel in this driver was using the IIO_ST macro. This does not provide a parameter for setting the endianness of the channel. Thus this channel will have been reported as whatever is the native endianness of the cpu rather than big endian. This means it would be incorrect on little endian platforms.

---
 drivers/iio/imu/adis16400_core.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/iio/imu/adis16400_core.c +6 -1
index 3fb7757a1028..368660dfe135 100644
@@ -651,7 +651,12 @@ static const struct iio_chan_spec adis16448_channels[] = {
 		.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
 		.address = ADIS16448_BARO_OUT,
 		.scan_index = ADIS16400_SCAN_BARO,
-		.scan_type = IIO_ST('s', 16, 16, 0),
+		.scan_type = {
+			.sign = 's',
+			.realbits = 16,
+			.storagebits = 16,
+			.endianness = IIO_BE,
+		},
 	},
 	ADIS16400_TEMP_CHAN(ADIS16448_TEMP_OUT, 12),
 	IIO_CHAN_SOFT_TIMESTAMP(11)
Signature · 1 line
1.8.4.2
author maintainer Applied
#4 lore raw

Re: [PATCH 02/24] iio:imu:adis16400 fix pressure channel scan type

Quoted 7 lines · Jonathan Cameron

A single channel in this driver was using the IIO_ST macro. This does not provide a parameter for setting the endianness of the channel. Thus this channel will have been reported as whatever is the native endianness of the cpu rather than big endian. This means it would be incorrect on little endian platforms.

Applied to the fixes-togreg branch of iio.git

Quoted 23 lines
---
 drivers/iio/imu/adis16400_core.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/iio/imu/adis16400_core.c +6 -1
index 3fb7757a1028..368660dfe135 100644
@@ -651,7 +651,12 @@ static const struct iio_chan_spec adis16448_channels[] = {
 		.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
 		.address = ADIS16448_BARO_OUT,
 		.scan_index = ADIS16400_SCAN_BARO,
-		.scan_type = IIO_ST('s', 16, 16, 0),
+		.scan_type = {
+			.sign = 's',
+			.realbits = 16,
+			.storagebits = 16,
+			.endianness = IIO_BE,
+		},
 	},
 	ADIS16400_TEMP_CHAN(ADIS16448_TEMP_OUT, 12),
 	IIO_CHAN_SOFT_TIMESTAMP(11)
author maintainer
#5 lore raw

PATCH 3/24 iio:adc:ad7887 Fix channel reported endianness from cpu to big endian

In reply to Jonathan Cameron

Note this also sets the endianness to big endian whereas it would previously have defaulted to the cpu endian. Hence technically this is a bug fix on LE platforms.

---
 drivers/iio/adc/ad7887.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
drivers/iio/adc/ad7887.c +14 -2
index acb7f90359a3..3ce0160b6398 100644
@@ -200,7 +200,13 @@ static const struct ad7887_chip_info ad7887_chip_info_tbl[] = {
 			.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
 			.address = 1,
 			.scan_index = 1,
-			.scan_type = IIO_ST('u', 12, 16, 0),
+			.scan_type = {
+				.sign = 'u',
+				.realbits = 12,
+				.storagebits = 16,
+				.shift = 0,
+				.endianness = IIO_BE,
+				},
 		},
 		.channel[1] = {
 			.type = IIO_VOLTAGE,
@@ -210,7 +216,13 @@ static const struct ad7887_chip_info ad7887_chip_info_tbl[] = {
 			.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
 			.address = 0,
 			.scan_index = 0,
-			.scan_type = IIO_ST('u', 12, 16, 0),
+			.scan_type = {
+				.sign = 'u',
+				.realbits = 12,
+				.storagebits = 16,
+				.shift = 0,
+				.endianness = IIO_BE,
+				},
 		},
 		.channel[2] = IIO_CHAN_SOFT_TIMESTAMP(2),
 		.int_vref_mv = 2500,
Signature · 1 line
1.8.4.2
author maintainer Applied
#6 lore raw

Re: [PATCH 03/24] iio:adc:ad7887 Fix channel reported endianness from cpu to big endian

Quoted 5 lines · Jonathan Cameron

Note this also sets the endianness to big endian whereas it would previously have defaulted to the cpu endian. Hence technically this is a bug fix on LE platforms.

Applied to the fixes togreg branch of iio.git with the formatting fix.

Quoted 39 lines
---
 drivers/iio/adc/ad7887.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
drivers/iio/adc/ad7887.c +14 -2
index acb7f90359a3..3ce0160b6398 100644
@@ -200,7 +200,13 @@ static const struct ad7887_chip_info ad7887_chip_info_tbl[] = {
 			.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
 			.address = 1,
 			.scan_index = 1,
-			.scan_type = IIO_ST('u', 12, 16, 0),
+			.scan_type = {
+				.sign = 'u',
+				.realbits = 12,
+				.storagebits = 16,
+				.shift = 0,
+				.endianness = IIO_BE,
+				},
 		},
 		.channel[1] = {
 			.type = IIO_VOLTAGE,
@@ -210,7 +216,13 @@ static const struct ad7887_chip_info ad7887_chip_info_tbl[] = {
 			.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
 			.address = 0,
 			.scan_index = 0,
-			.scan_type = IIO_ST('u', 12, 16, 0),
+			.scan_type = {
+				.sign = 'u',
+				.realbits = 12,
+				.storagebits = 16,
+				.shift = 0,
+				.endianness = IIO_BE,
+				},
 		},
 		.channel[2] = IIO_CHAN_SOFT_TIMESTAMP(2),
 		.int_vref_mv = 2500,
author maintainer
#7 lore raw

PATCH 4/24 iio:accel:bma180 replaces IIO_ST macro with explicit entries to struct scan_type

In reply to Jonathan Cameron

The IIO_ST macro no longer covers all the elements of struct scan_type and has this has lead to some bugs being introduced.

The drivers are easier to follow with this structure being directly filled so that is now preferred.

---
 drivers/iio/accel/bma180.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/iio/accel/bma180.c +6 -1
index 28b39283bccf..9104f436e0eb 100644
@@ -455,7 +455,12 @@ static const struct iio_chan_spec_ext_info bma180_ext_info[] = {
 		BIT(IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY),	\
 	.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),		\
 	.scan_index = (_index),						\
-	.scan_type = IIO_ST('s', 14, 16, 2),				\
+	.scan_type = {							\
+		.sign = 's',						\
+		.realbits = 14,					\
+		.storagebits = 16,					\
+		.shift = 2,						\
+		},							\
 	.ext_info = bma180_ext_info,					\
 }
 
Signature · 1 line
1.8.4.2
author maintainer
#8 lore raw

PATCH 5/24 iio:mag:mag3110 replaces IIO_ST macro with explicit entries to struct scan_type

In reply to Jonathan Cameron

The IIO_ST macro no longer covers all the elements of struct scan_type and has this has lead to some bugs being introduced.

The drivers are easier to follow with this structure being directly filled so that is now preferred.

---
 drivers/iio/magnetometer/mag3110.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/iio/magnetometer/mag3110.c +5 -1
index becf54496967..4b65b6d3bdb1 100644
@@ -266,7 +266,11 @@ static const struct iio_chan_spec mag3110_channels[] = {
 		.type = IIO_TEMP,
 		.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
 		.scan_index = 3,
-		.scan_type = IIO_ST('s', 8, 8, 0),
+		.scan_type = {
+			.sign = 's',
+			.realbits = 8,
+			.storagebits = 8,
+			},
 	},
 	IIO_CHAN_SOFT_TIMESTAMP(4),
 };
Signature · 1 line
1.8.4.2
author maintainer
#9 lore raw

PATCH 6/24 iio:dac:ad5064 replaces IIO_ST macro with explicit entries to struct scan_type

In reply to Jonathan Cameron

IIO_ST is going away as it is a pain to maintain.

---
 drivers/iio/dac/ad5064.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/iio/dac/ad5064.c +6 -1
index cb9c6366032c..997b82a5ce61 100644
@@ -299,7 +299,12 @@ static const struct iio_chan_spec_ext_info ad5064_ext_info[] = {
 	.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |		\
 	BIT(IIO_CHAN_INFO_SCALE),					\
 	.address = addr,					\
-	.scan_type = IIO_ST('u', (bits), 16, 20 - (bits)),	\
+	.scan_type = {						\
+		.sign = 'u',					\
+		.realbits = (bits),				\
+		.storagebits = 16,				\
+		.shift = 20 - bits,				\
+		},						\
 	.ext_info = ad5064_ext_info,				\
 }
 
Signature · 1 line
1.8.4.2
author maintainer
#10 lore raw

PATCH 7/24 iio:dac:ad5360 replaces IIO_ST macro with explicit entries to struct scan_type

In reply to Jonathan Cameron

IIO_ST is going away as it is a pain to maintain.

---
 drivers/iio/dac/ad5360.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/iio/dac/ad5360.c +6 -1
index b968af50db0a..92b92bcdf86d 100644
@@ -107,7 +107,12 @@ enum ad5360_type {
 		BIT(IIO_CHAN_INFO_OFFSET) |				\
 		BIT(IIO_CHAN_INFO_CALIBSCALE) |			\
 		BIT(IIO_CHAN_INFO_CALIBBIAS),			\
-	.scan_type = IIO_ST('u', (bits), 16, 16 - (bits))	\
+	.scan_type = {						\
+		.sign = 'u',					\
+		.realbits = (bits),				\
+		.storagebits = 16,				\
+		.shift = 16 - (bits),				\
+		},						\
 }
 
 static const struct ad5360_chip_info ad5360_chip_info_tbl[] = {
Signature · 1 line
1.8.4.2
author maintainer
#11 lore raw

PATCH 8/24 iio:dac:ad5380 replaces IIO_ST macro with explicit entries to struct scan_type

In reply to Jonathan Cameron

IIO_ST is going away as it is a pain to maintain.

---
 drivers/iio/dac/ad5380.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/iio/dac/ad5380.c +6 -1
index a59ff0e7b888..90c9bf63d30b 100644
@@ -261,7 +261,12 @@ static struct iio_chan_spec_ext_info ad5380_ext_info[] = {
 		BIT(IIO_CHAN_INFO_CALIBSCALE) |			\
 		BIT(IIO_CHAN_INFO_CALIBBIAS),			\
 	.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),	\
-	.scan_type = IIO_ST('u', (_bits), 16, 14 - (_bits)),	\
+	.scan_type = {						\
+		.sign = 'u',					\
+		.realbits = (_bits),				\
+		.storagebits =  16,				\
+		.shift = 14 - (_bits),				\
+		},						\
 	.ext_info = ad5380_ext_info,				\
 }
 
Signature · 1 line
1.8.4.2
author maintainer
#12 lore raw

PATCH 9/24 iio:dac:ad5421 replaces IIO_ST macro with explicit entries to struct scan_type

In reply to Jonathan Cameron

IIO_ST is going away as it is a pain to maintain.

---
 drivers/iio/dac/ad5421.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/iio/dac/ad5421.c +5 -1
index 1cb15d8e94b7..904c3024c93b 100644
@@ -114,7 +114,11 @@ static const struct iio_chan_spec ad5421_channels[] = {
 			BIT(IIO_CHAN_INFO_CALIBBIAS),
 		.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE) |
 			BIT(IIO_CHAN_INFO_OFFSET),
-		.scan_type = IIO_ST('u', 16, 16, 0),
+		.scan_type = {
+			.sign = 'u',
+			.realbits = 16,
+			.storagebits = 16,
+			},
 		.event_spec = ad5421_current_event,
 		.num_event_specs = ARRAY_SIZE(ad5421_current_event),
 	},
Signature · 1 line
1.8.4.2
author maintainer
#13 lore raw

PATCH 10/24 iio:dac:ad5446 replaces IIO_ST macro with explicit entries to struct scan_type

In reply to Jonathan Cameron

IIO_ST is going away as it is a pain to maintain.

---
 drivers/iio/dac/ad5446.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/iio/dac/ad5446.c +7 -2
index 1263b0e5ad84..46bb62a5c1d4 100644
@@ -139,14 +139,19 @@ static const struct iio_chan_spec_ext_info ad5446_ext_info_powerdown[] = {
 	{ },
 };
 
-#define _AD5446_CHANNEL(bits, storage, shift, ext) { \
+#define _AD5446_CHANNEL(bits, storage, _shift, ext) { \
 	.type = IIO_VOLTAGE, \
 	.indexed = 1, \
 	.output = 1, \
 	.channel = 0, \
 	.info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \
 	.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \
-	.scan_type = IIO_ST('u', (bits), (storage), (shift)), \
+	.scan_type = { \
+		.sign = 'u', \
+		.realbits = (bits), \
+		.storagebits = (storage), \
+		.shift = (_shift), \
+		}, \
 	.ext_info = (ext), \
 }
 
Signature · 1 line
1.8.4.2
author maintainer
#14 lore raw

PATCH 11/24 iio:dac:ad5449 replaces IIO_ST macro with explicit entries to struct scan_type

In reply to Jonathan Cameron

IIO_ST is going away as it is a pain to maintain.

---
 drivers/iio/dac/ad5449.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/iio/dac/ad5449.c +6 -1
index 82e208f6cde2..49d8c4767309 100644
@@ -204,7 +204,12 @@ static const struct iio_info ad5449_info = {
 	.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |		\
 		BIT(IIO_CHAN_INFO_SCALE),			\
 	.address = (chan),					\
-	.scan_type = IIO_ST('u', (bits), 16, 12 - (bits)),	\
+	.scan_type = {						\
+		.sign = 'u',					\
+		.realbits = (bits),				\
+		.storagebits = 16,				\
+		.shift = 12 - (bits),				\
+		},					\
 }
 
 #define DECLARE_AD5449_CHANNELS(name, bits) \
Signature · 1 line
1.8.4.2
author maintainer
#15 lore raw

PATCH 12/24 iio:dac:ad5504 replaces IIO_ST macro with explicit entries to struct scan_type

In reply to Jonathan Cameron

IIO_ST is going away as it is a pain to maintain.

---
 drivers/iio/dac/ad5504.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/iio/dac/ad5504.c +5 -1
index d44c8f5fadee..257eb16b5f73 100644
@@ -261,7 +261,11 @@ static const struct iio_chan_spec_ext_info ad5504_ext_info[] = {
 	.info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \
 	.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \
 	.address = AD5504_ADDR_DAC(_chan), \
-	.scan_type = IIO_ST('u', 12, 16, 0), \
+	.scan_type = { \
+		.sign = 'u', \
+		.realbits = 12, \
+		.storagebits = 16, \
+		}, \
 	.ext_info = ad5504_ext_info, \
 }
 
Signature · 1 line
1.8.4.2
author maintainer
#16 lore raw

PATCH 13/24 iio:dac:ad5624r replaces IIO_ST macro with explicit entries to struct scan_type

In reply to Jonathan Cameron

IIO_ST is going away as it is a pain to maintain.

---
 drivers/iio/dac/ad5624r_spi.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/iio/dac/ad5624r_spi.c +6 -1
index 774dd968145b..40c7f6dbcb5b 100644
@@ -176,7 +176,12 @@ static const struct iio_chan_spec_ext_info ad5624r_ext_info[] = {
 	.info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \
 	.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \
 	.address = (_chan), \
-	.scan_type = IIO_ST('u', (_bits), 16, 16 - (_bits)), \
+	.scan_type = { \
+		.sign = 'u', \
+		.realbits = (_bits), \
+		.storagebits = 16, \
+		.shift = 16 - (_bits), \
+		}, \
 	.ext_info = ad5624r_ext_info, \
 }
 
Signature · 1 line
1.8.4.2
author maintainer
#17 lore raw

PATCH 14/24 iio:dac:ad5686 replaces IIO_ST macro with explicit entries to struct scan_type

In reply to Jonathan Cameron

IIO_ST is going away as it is a pain to maintain.

---
 drivers/iio/dac/ad5686.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/iio/dac/ad5686.c +7 -2
index e56ec0abb509..faf363f45675 100644
@@ -267,7 +267,7 @@ static const struct iio_chan_spec_ext_info ad5686_ext_info[] = {
 	{ },
 };
 
-#define AD5868_CHANNEL(chan, bits, shift) {			\
+#define AD5868_CHANNEL(chan, bits, _shift) {			\
 		.type = IIO_VOLTAGE,				\
 		.indexed = 1,					\
 		.output = 1,					\
@@ -275,7 +275,12 @@ static const struct iio_chan_spec_ext_info ad5686_ext_info[] = {
 		.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),	\
 		.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),\
 		.address = AD5686_ADDR_DAC(chan),		\
-		.scan_type = IIO_ST('u', bits, 16, shift),	\
+		.scan_type = {					\
+			.sign = 'u',				\
+			.realbits = (bits),			\
+			.storagebits = 16,			\
+			.shift = (_shift),			\
+			},					\
 		.ext_info = ad5686_ext_info,			\
 }
 
Signature · 1 line
1.8.4.2
author maintainer
#18 lore raw

PATCH 15/24 iio:dac:ad5755 replaces IIO_ST macro with explicit entries to struct scan_type

In reply to Jonathan Cameron

IIO_ST is going away as it is a pain to maintain.

---
 drivers/iio/dac/ad5755.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/iio/dac/ad5755.c +6 -1
index c494276da4b0..b9719f19d4cd 100644
@@ -392,7 +392,12 @@ static const struct iio_chan_spec_ext_info ad5755_ext_info[] = {
 		BIT(IIO_CHAN_INFO_OFFSET) |			\
 		BIT(IIO_CHAN_INFO_CALIBSCALE) |			\
 		BIT(IIO_CHAN_INFO_CALIBBIAS),			\
-	.scan_type = IIO_ST('u', (_bits), 16, 16 - (_bits)),	\
+	.scan_type = {						\
+		.sign = 'u',					\
+		.realbits = (_bits),				\
+		.storagebits = 16,				\
+		.shift = 16 - (_bits),				\
+		},						\
 	.ext_info = ad5755_ext_info,				\
 }
 
Signature · 1 line
1.8.4.2
author maintainer
#19 lore raw

PATCH 16/24 iio:dac:ad5764 replaces IIO_ST macro with explicit entries to struct scan_type

In reply to Jonathan Cameron

IIO_ST is going away as it is a pain to maintain.

---
 drivers/iio/dac/ad5764.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/iio/dac/ad5764.c +6 -1
index a8ff5b2ed13e..efc1472a4116 100644
@@ -83,7 +83,12 @@ enum ad5764_type {
 		BIT(IIO_CHAN_INFO_CALIBSCALE) |			\
 		BIT(IIO_CHAN_INFO_CALIBBIAS),			\
 	.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_OFFSET),	\
-	.scan_type = IIO_ST('u', (_bits), 16, 16 - (_bits))	\
+	.scan_type = {						\
+		.sign = 'u',					\
+		.realbits = (_bits),				\
+		.storagebits = 16,				\
+		.shift = 16 - (_bits),				\
+		},						\
 }
 
 #define DECLARE_AD5764_CHANNELS(_name, _bits) \
Signature · 1 line
1.8.4.2
author maintainer
#20 lore raw

PATCH 17/24 iio:dac:ad5791 replaces IIO_ST macro with explicit entries to struct scan_type

In reply to Jonathan Cameron

IIO_ST is going away as it is a pain to maintain.

---
 drivers/iio/dac/ad5791.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/iio/dac/ad5791.c +7 -2
index 79bf19945747..d4f64196d000 100644
@@ -293,7 +293,7 @@ static const struct iio_chan_spec_ext_info ad5791_ext_info[] = {
 	{ },
 };
 
-#define AD5791_CHAN(bits, shift) {			\
+#define AD5791_CHAN(bits, _shift) {			\
 	.type = IIO_VOLTAGE,				\
 	.output = 1,					\
 	.indexed = 1,					\
@@ -302,7 +302,12 @@ static const struct iio_chan_spec_ext_info ad5791_ext_info[] = {
 	.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),	\
 	.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE) |	\
 		BIT(IIO_CHAN_INFO_OFFSET),		\
-	.scan_type = IIO_ST('u', bits, 24, shift),	\
+	.scan_type = {					\
+		.sign = 'u',				\
+		.realbits = (bits),			\
+		.storagebits = 24,			\
+		.shift = (_shift),			\
+		},					\
 	.ext_info = ad5791_ext_info,			\
 }
 
Signature · 1 line
1.8.4.2
author maintainer
#21 lore raw

PATCH 18/24 iio:dac:max517 drop specification of scan type as unused in this driver.

In reply to Jonathan Cameron

IIO_ST is going away as it is a pain to maintain so the simplest path with this driver is to not specify the unused scan type.

---
 drivers/iio/dac/max517.c | 1 -
 1 file changed, 1 deletion(-)
drivers/iio/dac/max517.c +0 -1
index 6e1903537950..de76e6a34c1e 100644
@@ -146,7 +146,6 @@ static const struct iio_info max517_info = {
 	.channel = (chan),				\
 	.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |	\
 	BIT(IIO_CHAN_INFO_SCALE),			\
-	.scan_type = IIO_ST('u', 8, 8, 0),		\
 }
 
 static const struct iio_chan_spec max517_channels[] = {
Signature · 1 line
1.8.4.2
author maintainer
#22 lore raw

PATCH 19/24 iio:dac:mcp4725 drop specification of scan type as unused in this driver.

In reply to Jonathan Cameron

IIO_ST is going away as it is a pain to maintain so the simplest path with this driver is to not specify the unused scan type.

---
 drivers/iio/dac/mcp4725.c | 1 -
 1 file changed, 1 deletion(-)
drivers/iio/dac/mcp4725.c +0 -1
index 9f57ae84ab89..7d9f5c31d2fc 100644
@@ -209,7 +209,6 @@ static const struct iio_chan_spec mcp4725_channel = {
 	.channel	= 0,
 	.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
 	.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
-	.scan_type	= IIO_ST('u', 12, 16, 0),
 	.ext_info	= mcp4725_ext_info,
 };
 
Signature · 1 line
1.8.4.2
author maintainer
#23 lore raw

PATCH 20/24 iio:light:adjd_s311 replaces IIO_ST macro with explicit entries to struct scan_type

In reply to Jonathan Cameron

IIO_ST is going away as it is a pain to maintain.

---
 drivers/iio/light/adjd_s311.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/iio/light/adjd_s311.c +6 -1
index 83d15c5baf64..90e676ef2a8a 100644
@@ -155,7 +155,12 @@ done:
 		BIT(IIO_CHAN_INFO_INT_TIME), \
 	.channel2 = (IIO_MOD_LIGHT_##_color), \
 	.scan_index = (_scan_idx), \
-	.scan_type = IIO_ST('u', 10, 16, 0), \
+	.scan_type = { \
+		.sign = 'u', \
+		.realbits = 10, \
+		.storagebits = 16, \
+		.endianness = IIO_CPU, \
+		}, \
 }
 
 static const struct iio_chan_spec adjd_s311_channels[] = {
Signature · 1 line
1.8.4.2
author maintainer
#24 lore raw

PATCH 21/24 iio:light:tcs3472 replaces IIO_ST macro with explicit entries to struct scan_type

In reply to Jonathan Cameron

IIO_ST is going away as it is a pain to maintain.

---
 drivers/iio/light/tcs3472.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/iio/light/tcs3472.c +6 -1
index 45df2204614a..40d12f7d1056 100644
@@ -67,7 +67,12 @@ struct tcs3472_data {
 	.channel2 = IIO_MOD_LIGHT_##_color, \
 	.address = _addr, \
 	.scan_index = _si, \
-	.scan_type = IIO_ST('u', 16, 16, 0), \
+	.scan_type = { \
+		.sign = 'u', \
+		.realbits = 16, \
+		.storagebits = 16, \
+		.endianness = IIO_CPU, \
+		}, \
 }
 
 static const int tcs3472_agains[] = { 1, 4, 16, 60 };
Signature · 1 line
1.8.4.2
author maintainer
#25 lore raw

PATCH 22/24 staging:iio:ad7606 replaces IIO_ST macro with explicit entries to struct scan_type

In reply to Jonathan Cameron

IIO_ST is going away as it is a pain to maintain. Note that this driver currently ensures all fields are converted to the native endianness to keep things consistent across the different bus types.

---
 drivers/staging/iio/adc/ad7606_core.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/staging/iio/adc/ad7606_core.c +6 -1
index 2083673a79ca..7a83cc5eef4c 100644
@@ -239,7 +239,12 @@ static const struct attribute_group ad7606_attribute_group_range = {
 		.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),	\
 		.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),\
 		.scan_index = num,				\
-		.scan_type = IIO_ST('s', 16, 16, 0),		\
+		.scan_type = {					\
+			.sign = 's',				\
+			.realbits = 16,			\
+			.storagebits = 16,			\
+			.endianness = IIO_CPU,			\
+			},					\
 	}
 
 static const struct iio_chan_spec ad7606_8_channels[] = {
Signature · 1 line
1.8.4.2
author maintainer
#26 lore raw

PATCH 23/24 staging:iio:ad799x replaces IIO_ST macro with explicit entries to struct scan_type

In reply to Jonathan Cameron

IIO_ST is going away as it is a pain to maintain. As an i2c driver, multi byte words will be read by the driver in the native cpu endianness.

---
 drivers/staging/iio/adc/ad799x_core.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/staging/iio/adc/ad799x_core.c +7 -1
index 5ea36410f716..45e64d8bf29b 100644
@@ -409,7 +409,13 @@ static const struct iio_event_spec ad799x_events[] = {
 	.info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \
 	.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \
 	.scan_index = (_index), \
-	.scan_type = IIO_ST('u', _realbits, 16, 12 - (_realbits)), \
+	.scan_type = { \
+		.sign = 'u', \
+		.realbits = (_realbits), \
+		.storagebits = 16, \
+		.shift = 12 - (_realbits), \
+		.endianness = IIO_CPU, \
+		}, \
 	.event_spec = _ev_spec, \
 	.num_event_specs = _num_ev_spec, \
 }
Signature · 1 line
1.8.4.2
#27 lore raw

Re: [PATCH 23/24] staging:iio:ad799x replaces IIO_ST macro with explicit entries to struct scan_type

Quoted 2 lines · Jonathan Cameron

IIO_ST is going away as it is a pain to maintain. As an i2c driver, multi byte words will be read by the driver in the native cpu endianness.

Are you sure about this? As far as I understand it the I2C message will be read byte by byte. The device sends the MSB first, so I think it should be IIO_BE.

Quoted 26 lines
---
 drivers/staging/iio/adc/ad799x_core.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/staging/iio/adc/ad799x_core.c +7 -1
index 5ea36410f716..45e64d8bf29b 100644
@@ -409,7 +409,13 @@ static const struct iio_event_spec ad799x_events[] = {
 	.info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \
 	.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \
 	.scan_index = (_index), \
-	.scan_type = IIO_ST('u', _realbits, 16, 12 - (_realbits)), \
+	.scan_type = { \
+		.sign = 'u', \
+		.realbits = (_realbits), \
+		.storagebits = 16, \
+		.shift = 12 - (_realbits), \
+		.endianness = IIO_CPU, \
+		}, \
 	.event_spec = _ev_spec, \
 	.num_event_specs = _num_ev_spec, \
 }
author maintainer
#28 lore raw

Re: [PATCH 23/24] staging:iio:ad799x replaces IIO_ST macro with explicit entries to struct scan_type

Quoted 7 lines · Lars-Peter Clausen
Quoted 2 lines · Jonathan Cameron

IIO_ST is going away as it is a pain to maintain. As an i2c driver, multi byte words will be read by the driver in the native cpu endianness.

Are you sure about this? As far as I understand it the I2C message will be read byte by byte. The device sends the MSB first, so I think it should be IIO_BE.

Gah. I just spent 5 minutes writing an essay on the fact it was an smbus word read call, only to realise I was looking at the wrong function and this is done with a block read. Doh. You are quite right! I'll switch this one to IIO_BE.

Quoted 33 lines
Quoted 17 lines
---
 drivers/staging/iio/adc/ad799x_core.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/staging/iio/adc/ad799x_core.c +0 -1
index 5ea36410f716..45e64d8bf29b 100644
@@ -409,7 +409,13 @@ static const struct iio_event_spec ad799x_events[] = {
 	.info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \
 	.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \
 	.scan_index = (_index), \
-	.scan_type = IIO_ST('u', _realbits, 16, 12 - (_realbits)), \

drivers/staging/iio/adc/ad799x_core.c static const struct iio_event_spec ad799x_events[] = { · line 421

Quoted 10 lines
drivers/staging/iio/adc/ad799x_core.c +7 -0
+	.scan_type = { \
+		.sign = 'u', \
+		.realbits = (_realbits), \
+		.storagebits = 16, \
+		.shift = 12 - (_realbits), \
+		.endianness = IIO_CPU, \
+		}, \
 	.event_spec = _ev_spec, \
 	.num_event_specs = _num_ev_spec, \
 }

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

author maintainer
#29 lore raw

PATCH 24/24 iio:drop IIO_ST macro

In reply to Jonathan Cameron

This macro no longer allows all the elements of the scan_type structure to be set. Missinterpretation of the parameters also caused a couple of recent bugs. No mainline drivers now use this macro so drop it.

---
 include/linux/iio/iio.h | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
include/linux/iio/iio.h +10 -6
index 75a8a20c8179..5f2d00e7e488 100644
@@ -254,12 +254,16 @@ static inline bool iio_channel_has_info(const struct iio_chan_spec *chan,
 		(chan->info_mask_shared_by_all & BIT(type));
 }
 
-#define IIO_ST(si, rb, sb, sh)						\
-	{ .sign = si, .realbits = rb, .storagebits = sb, .shift = sh }
-
-#define IIO_CHAN_SOFT_TIMESTAMP(_si)					\
-	{ .type = IIO_TIMESTAMP, .channel = -1,				\
-			.scan_index = _si, .scan_type = IIO_ST('s', 64, 64, 0) }
+#define IIO_CHAN_SOFT_TIMESTAMP(_si) {					\
+	.type = IIO_TIMESTAMP,						\
+	.channel = -1,							\
+	.scan_index = _si,						\
+	.scan_type = {							\
+		.sign = 's',						\
+		.realbits = 64,					\
+		.storagebits = 64,					\
+		},							\
+}
 
 /**
  * iio_get_time_ns() - utility function to get a time stamp for events etc
Signature · 1 line
1.8.4.2
author maintainer
#30 lore raw

Re: [PATCH 24/24] iio:drop IIO_ST macro

Quoted 5 lines · Jonathan Cameron

This macro no longer allows all the elements of the scan_type structure to be set. Missinterpretation of the parameters also caused a couple of recent bugs. No mainline drivers now use this macro so drop it.

Finally applied to the togreg branch of iio.git. It's gone at last!

J

Quoted 32 lines
---
  include/linux/iio/iio.h | 16 ++++++++++------
  1 file changed, 10 insertions(+), 6 deletions(-)
include/linux/iio/iio.h +10 -6
index 75a8a20c8179..5f2d00e7e488 100644
@@ -254,12 +254,16 @@ static inline bool iio_channel_has_info(const struct iio_chan_spec *chan,
  		(chan->info_mask_shared_by_all & BIT(type));
  }
 
-#define IIO_ST(si, rb, sb, sh)						\
-	{ .sign = si, .realbits = rb, .storagebits = sb, .shift = sh }
-
-#define IIO_CHAN_SOFT_TIMESTAMP(_si)					\
-	{ .type = IIO_TIMESTAMP, .channel = -1,				\
-			.scan_index = _si, .scan_type = IIO_ST('s', 64, 64, 0) }
+#define IIO_CHAN_SOFT_TIMESTAMP(_si) {					\
+	.type = IIO_TIMESTAMP,						\
+	.channel = -1,							\
+	.scan_index = _si,						\
+	.scan_type = {							\
+		.sign = 's',						\
+		.realbits = 64,					\
+		.storagebits = 64,					\
+		},							\
+}
 
  /**
   * iio_get_time_ns() - utility function to get a time stamp for events etc
Acked-by on the v1 series
#31 lore raw
In reply to Jonathan Cameron
Quoted 11 lines · Jonathan Cameron

This macro is no longer fit for purpose given it doesn't allow the endianness of the element to be set. Missuse of the macro has also been responsible for a couple of bugs including some fixed in this series.

If everyone is happy I'll be apply the fixes through the fixes-togreg branch and follow up with the others after those have worked their way through.

Please do check the fixes in particular as I'm not entirely sure they are correct (particularly the ad7887 which gave me a headache on a train last night at the end of a very long day).

Looks all good to me, except for the ad799x.

One minor nitpick though. I think the proper indention is

	{
		.foo = bar,
	}

instead of

	{
		.foo = bar,
		}

- Lars

Quoted 77 lines

Thanks,

Jonathan

Jonathan Cameron (24):
staging:iio:mag:hmc5843 fix incorrect endianness of channel as a
result of missuse of the IIO_ST macro.
iio:imu:adis16400 fix pressure channel scan type iio:adc:ad7887 Fix channel reported endianness from cpu to big endian iio:accel:bma180 replaces IIO_ST macro with explicit entries to struct
scan_type
iio:mag:mag3110 replaces IIO_ST macro with explicit entries to struct
scan_type
iio:dac:ad5064 replaces IIO_ST macro with explicit entries to struct
scan_type
iio:dac:ad5360 replaces IIO_ST macro with explicit entries to struct
scan_type
iio:dac:ad5380 replaces IIO_ST macro with explicit entries to struct
scan_type
iio:dac:ad5421 replaces IIO_ST macro with explicit entries to struct
scan_type
iio:dac:ad5446 replaces IIO_ST macro with explicit entries to struct
scan_type
iio:dac:ad5449 replaces IIO_ST macro with explicit entries to struct
scan_type
iio:dac:ad5504 replaces IIO_ST macro with explicit entries to struct
scan_type
iio:dac:ad5624r replaces IIO_ST macro with explicit entries to struct
scan_type
iio:dac:ad5686 replaces IIO_ST macro with explicit entries to struct
scan_type
iio:dac:ad5755 replaces IIO_ST macro with explicit entries to struct
scan_type
iio:dac:ad5764 replaces IIO_ST macro with explicit entries to struct
scan_type
iio:dac:ad5791 replaces IIO_ST macro with explicit entries to struct
scan_type
iio:dac:max517 drop specification of scan type as unused in this
driver.
iio:dac:mcp4725 drop specification of scan type as unused in this
driver.
iio:light:adjd_s311 replaces IIO_ST macro with explicit entries to
struct scan_type
iio:light:tcs3472 replaces IIO_ST macro with explicit entries to
struct scan_type
staging:iio:ad7606 replaces IIO_ST macro with explicit entries to
struct scan_type
staging:iio:ad799x replaces IIO_ST macro with explicit entries to
struct scan_type
iio:drop IIO_ST macro

 drivers/iio/accel/bma180.c                 |  7 ++++++-
 drivers/iio/adc/ad7887.c                   | 16 ++++++++++++++--
 drivers/iio/dac/ad5064.c                   |  7 ++++++-
 drivers/iio/dac/ad5360.c                   |  7 ++++++-
 drivers/iio/dac/ad5380.c                   |  7 ++++++-
 drivers/iio/dac/ad5421.c                   |  6 +++++-
 drivers/iio/dac/ad5446.c                   |  9 +++++++--
 drivers/iio/dac/ad5449.c                   |  7 ++++++-
 drivers/iio/dac/ad5504.c                   |  6 +++++-
 drivers/iio/dac/ad5624r_spi.c              |  7 ++++++-
 drivers/iio/dac/ad5686.c                   |  9 +++++++--
 drivers/iio/dac/ad5755.c                   |  7 ++++++-
 drivers/iio/dac/ad5764.c                   |  7 ++++++-
 drivers/iio/dac/ad5791.c                   |  9 +++++++--
 drivers/iio/dac/max517.c                   |  1 -
 drivers/iio/dac/mcp4725.c                  |  1 -
 drivers/iio/imu/adis16400_core.c           |  7 ++++++-
 drivers/iio/light/adjd_s311.c              |  7 ++++++-
 drivers/iio/light/tcs3472.c                |  7 ++++++-
 drivers/iio/magnetometer/mag3110.c         |  6 +++++-
 drivers/staging/iio/adc/ad7606_core.c      |  7 ++++++-
 drivers/staging/iio/adc/ad799x_core.c      |  8 +++++++-
 drivers/staging/iio/magnetometer/hmc5843.c |  7 ++++++-
 include/linux/iio/iio.h                    | 16 ++++++++++------
 24 files changed, 145 insertions(+), 33 deletions(-)
author maintainer
#32 lore raw
Quoted 8 lines · Lars-Peter Clausen
Quoted 7 lines · Jonathan Cameron

This macro is no longer fit for purpose given it doesn't allow the endianness of the element to be set. Missuse of the macro has also been responsible for a couple of bugs including some fixed in this series.

If everyone is happy I'll be apply the fixes through the fixes-togreg branch and follow up with the others after those have worked their way through.

Quoted 8 lines
Quoted 4 lines

Please do check the fixes in particular as I'm not entirely sure they are correct (particularly the ad7887 which gave me a headache on a train last night at the end of a very long day).

Looks all good to me, except for the ad799x.

Thanks. I've applied 1..3 to fixes-togreg and 4..22 to the togreg branch of iio.git (pushed out as testing for build tests).

If I'd been more awake I'd have noticed that with the ad799x now being IIO_BE that one is another fix. Hence I've applied 23 with a new blurb to fixes-togreg.

Will apply 24 once all the others in are in one tree!

Indentation fixed up as you pointed out below.

Jonathan

Quoted 97 lines

One minor nitpick though. I think the proper indention is

	{
		.foo = bar,
	}

instead of

	{
		.foo = bar,
		}

- Lars

Quoted 68 lines

Thanks,

Jonathan

Jonathan Cameron (24):
staging:iio:mag:hmc5843 fix incorrect endianness of channel as a
result of missuse of the IIO_ST macro.
iio:imu:adis16400 fix pressure channel scan type iio:adc:ad7887 Fix channel reported endianness from cpu to big endian iio:accel:bma180 replaces IIO_ST macro with explicit entries to struct
scan_type
iio:mag:mag3110 replaces IIO_ST macro with explicit entries to struct
scan_type
iio:dac:ad5064 replaces IIO_ST macro with explicit entries to struct
scan_type
iio:dac:ad5360 replaces IIO_ST macro with explicit entries to struct
scan_type
iio:dac:ad5380 replaces IIO_ST macro with explicit entries to struct
scan_type
iio:dac:ad5421 replaces IIO_ST macro with explicit entries to struct
scan_type
iio:dac:ad5446 replaces IIO_ST macro with explicit entries to struct
scan_type
iio:dac:ad5449 replaces IIO_ST macro with explicit entries to struct
scan_type
iio:dac:ad5504 replaces IIO_ST macro with explicit entries to struct
scan_type
iio:dac:ad5624r replaces IIO_ST macro with explicit entries to struct
scan_type
iio:dac:ad5686 replaces IIO_ST macro with explicit entries to struct
scan_type
iio:dac:ad5755 replaces IIO_ST macro with explicit entries to struct
scan_type
iio:dac:ad5764 replaces IIO_ST macro with explicit entries to struct
scan_type
iio:dac:ad5791 replaces IIO_ST macro with explicit entries to struct
scan_type
iio:dac:max517 drop specification of scan type as unused in this
driver.
iio:dac:mcp4725 drop specification of scan type as unused in this
driver.
iio:light:adjd_s311 replaces IIO_ST macro with explicit entries to
struct scan_type
iio:light:tcs3472 replaces IIO_ST macro with explicit entries to
struct scan_type
staging:iio:ad7606 replaces IIO_ST macro with explicit entries to
struct scan_type
staging:iio:ad799x replaces IIO_ST macro with explicit entries to
struct scan_type
iio:drop IIO_ST macro

 drivers/iio/accel/bma180.c                 |  7 ++++++-
 drivers/iio/adc/ad7887.c                   | 16 ++++++++++++++--
 drivers/iio/dac/ad5064.c                   |  7 ++++++-
 drivers/iio/dac/ad5360.c                   |  7 ++++++-
 drivers/iio/dac/ad5380.c                   |  7 ++++++-
 drivers/iio/dac/ad5421.c                   |  6 +++++-
 drivers/iio/dac/ad5446.c                   |  9 +++++++--
 drivers/iio/dac/ad5449.c                   |  7 ++++++-
 drivers/iio/dac/ad5504.c                   |  6 +++++-
 drivers/iio/dac/ad5624r_spi.c              |  7 ++++++-
 drivers/iio/dac/ad5686.c                   |  9 +++++++--
 drivers/iio/dac/ad5755.c                   |  7 ++++++-
 drivers/iio/dac/ad5764.c                   |  7 ++++++-
 drivers/iio/dac/ad5791.c                   |  9 +++++++--
 drivers/iio/dac/max517.c                   |  1 -
 drivers/iio/dac/mcp4725.c                  |  1 -
 drivers/iio/imu/adis16400_core.c           |  7 ++++++-
Quoted 9 lines
 drivers/iio/light/adjd_s311.c              |  7 ++++++-
 drivers/iio/light/tcs3472.c                |  7 ++++++-
 drivers/iio/magnetometer/mag3110.c         |  6 +++++-
 drivers/staging/iio/adc/ad7606_core.c      |  7 ++++++-
 drivers/staging/iio/adc/ad799x_core.c      |  8 +++++++-
 drivers/staging/iio/magnetometer/hmc5843.c |  7 ++++++-
 include/linux/iio/iio.h                    | 16 ++++++++++------
 24 files changed, 145 insertions(+), 33 deletions(-)

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