Commit e39d9905 authored by Jonathan Cameron's avatar Jonathan Cameron

iio:adc:ad7887 Fix channel reported endianness from cpu to big endian

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.
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
Acked-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Cc: stable@vger.kernel.org
parent 3425c0f7
...@@ -200,7 +200,13 @@ static const struct ad7887_chip_info ad7887_chip_info_tbl[] = { ...@@ -200,7 +200,13 @@ static const struct ad7887_chip_info ad7887_chip_info_tbl[] = {
.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
.address = 1, .address = 1,
.scan_index = 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] = { .channel[1] = {
.type = IIO_VOLTAGE, .type = IIO_VOLTAGE,
...@@ -210,7 +216,13 @@ static const struct ad7887_chip_info ad7887_chip_info_tbl[] = { ...@@ -210,7 +216,13 @@ static const struct ad7887_chip_info ad7887_chip_info_tbl[] = {
.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE),
.address = 0, .address = 0,
.scan_index = 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), .channel[2] = IIO_CHAN_SOFT_TIMESTAMP(2),
.int_vref_mv = 2500, .int_vref_mv = 2500,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment