diff options
author | Olivier Moysan <olivier.moysan@st.com> | 2019-06-19 15:03:47 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-09-19 09:11:06 +0200 |
commit | bb9dee6edb5a70e70144e076c3193d14ca181337 (patch) | |
tree | 48517b029c91d1c7cf3bffcef68ba3bb701598b3 /kernel/module.c | |
parent | 83ad11d6d7fa7a58dc4f8e038105e46145ebb9c3 (diff) |
iio: adc: stm32-dfsdm: fix output resolution
commit 12c8398d8012ead3d3d68422067ab2f9a66ae76a upstream.
In buffered mode, output samples are shifted left
unconditionally. This works for filter order 3,
but this shift is not adapted for other filter orders.
Compute required shift, left or right, and shift
output data accordingly.
Add also saturation management to avoid wrap-around
when maximum positive sample is reached.
Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Fixes: eca949800d2d ("IIO: ADC: add stm32 DFSDM support for PDM microphone")
Acked-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel/module.c')
0 files changed, 0 insertions, 0 deletions