> >> + .scan_index = _addr, \ > >> + .scan_type = { \ > >> + .sign = 's', \ > >> + .realbits = 12, \ > >> + .storagebits = 16, \ > >> + .shift = 4, \ > >> + .endianness = IIO_CPU, \ > > > > I don't see the code for endianness conversion, I guess it should be _BE > > (also below) > > Conversion register is _BE but I think here is better to use IIO_CPU. > regmap_read() encapsulates a lot of magic, it actually does the endianness > conversion. indeed, this is super complicated > converts the value read from reg endianess to cpu endianness (in our case > there is a transparent call to b16_to_cpu). kind of, depending on what i2c capabilities you have :) anyway, your code *might* be correct :) p. -- Peter Meerwald-Stadler +43-664-2444418 (mobile) -- 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