Re: [PATCH v2] iio: adc: Add TI ADS1015 ADC driver support

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

 



> >> +     .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



[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