summaryrefslogtreecommitdiff
path: root/drivers/iio/adc/stm32-dfsdm.h
AgeCommit message (Collapse)AuthorFilesLines
2020-10-08ASoC: stm32: dfsdm: add actual resolution traceOlivier Moysan1-0/+2
Add a trace to report actual resolution of audio samples. Signed-off-by: Olivier Moysan <olivier.moysan@st.com> Link: https://lore.kernel.org/r/20201007153459.22155-3-olivier.moysan@st.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-06-22iio: adc: stm32-dfsdm: add fast mode supportOlivier Moysan1-2/+2
The use of fast mode allows to get a larger set of solution for filter parameters. This can be useful to reach a better output sample resolution, when fast mode can be used. Fast mode is selected at startup if it is relevant. The startup is performed in postenable callback context, where there are too tight time constraints for filter parameters computation. For this reason both fast and non fast filter parameters are pre-computed previously. Signed-off-by: Olivier Moysan <olivier.moysan@st.com> Acked-by: Fabrice Gasnier <fabrice.gasnier@st.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-06-22iio: adc: stm32-dfsdm: fix output resolutionOlivier Moysan1-5/+19
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>
2018-01-10IIO: ADC: add stm32 DFSDM core supportArnaud Pouliquen1-0/+310
Add driver for stm32 DFSDM pheripheral. Its converts a sigma delta stream in n bit samples through a low pass filter and an integrator. stm32-dfsdm-core driver is the core part supporting the filter instances dedicated to sigma-delta ADC or audio PDM microphone purpose. Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com> Signed-off-by: Mark Brown <broonie@kernel.org>