diff options
author | Olivier Moysan <olivier.moysan@st.com> | 2020-10-07 18:34:59 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-10-08 22:44:41 +0300 |
commit | 41bceb1272164ee2a6fd1ac3bed97043c94b6636 (patch) | |
tree | ad3c9759e5cd9478bf4363da4577dbf655ce9e45 /drivers/iio/adc/stm32-dfsdm-adc.c | |
parent | 6101bf71192f543799a796274e160f7dfc10f2d2 (diff) | |
download | linux-41bceb1272164ee2a6fd1ac3bed97043c94b6636.tar.xz |
ASoC: stm32: dfsdm: add actual resolution trace
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>
Diffstat (limited to 'drivers/iio/adc/stm32-dfsdm-adc.c')
-rw-r--r-- | drivers/iio/adc/stm32-dfsdm-adc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/iio/adc/stm32-dfsdm-adc.c b/drivers/iio/adc/stm32-dfsdm-adc.c index 5e10fb4f3704..b7e9ef1a6eec 100644 --- a/drivers/iio/adc/stm32-dfsdm-adc.c +++ b/drivers/iio/adc/stm32-dfsdm-adc.c @@ -293,6 +293,7 @@ static int stm32_dfsdm_compute_osrs(struct stm32_dfsdm_filter *fl, max >>= flo->rshift; } flo->max = (s32)max; + flo->bits = bits; pr_debug("%s: fast %d, fosr %d, iosr %d, res 0x%llx/%d bits, rshift %d, lshift %d\n", __func__, fast, flo->fosr, flo->iosr, @@ -476,6 +477,9 @@ static int stm32_dfsdm_channels_configure(struct iio_dev *indio_dev, if (!flo->res) return -EINVAL; + dev_dbg(&indio_dev->dev, "Samples actual resolution: %d bits", + min(flo->bits, (u32)DFSDM_DATA_RES - 1)); + for_each_set_bit(bit, &adc->smask, sizeof(adc->smask) * BITS_PER_BYTE) { chan = indio_dev->channels + bit; |