Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
iio/adc: ingenic: Fix channel offsets in buffer
Consumers expect the buffer to only contain enabled channels. While preparing the buffer, the driver makes two mistakes: 1) It inserts empty data for disabled channels. 2) Each ADC readout contains samples for two 16-bit channels. If either of them is active, the whole 32-bit sample is pushed into the buffer as-is. Both of those issues cause the active channels to appear at the wrong offsets in the buffer. Fix the above by demuxing samples for active channels only. This has remained unnoticed, as all the consumers so far were only using channels 0 and 1, leaving them unaffected by changes introduced in this commit. Signed-off-by: Artur Rojek <contact@artur-rojek.eu> Tested-by: Paul Cercueil <paul@crapouillou.net>
- Loading branch information