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>
This commit is contained in:
parent
6101bf7119
commit
41bceb1272
drivers/iio/adc
|
@ -293,6 +293,7 @@ static int stm32_dfsdm_compute_osrs(struct stm32_dfsdm_filter *fl,
|
||||||
max >>= flo->rshift;
|
max >>= flo->rshift;
|
||||||
}
|
}
|
||||||
flo->max = (s32)max;
|
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",
|
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,
|
__func__, fast, flo->fosr, flo->iosr,
|
||||||
|
@ -476,6 +477,9 @@ static int stm32_dfsdm_channels_configure(struct iio_dev *indio_dev,
|
||||||
if (!flo->res)
|
if (!flo->res)
|
||||||
return -EINVAL;
|
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,
|
for_each_set_bit(bit, &adc->smask,
|
||||||
sizeof(adc->smask) * BITS_PER_BYTE) {
|
sizeof(adc->smask) * BITS_PER_BYTE) {
|
||||||
chan = indio_dev->channels + bit;
|
chan = indio_dev->channels + bit;
|
||||||
|
|
|
@ -249,6 +249,7 @@ enum stm32_dfsdm_sinc_order {
|
||||||
* @rshift: output sample right shift (hardware shift)
|
* @rshift: output sample right shift (hardware shift)
|
||||||
* @lshift: output sample left shift (software shift)
|
* @lshift: output sample left shift (software shift)
|
||||||
* @res: output sample resolution
|
* @res: output sample resolution
|
||||||
|
* @bits: output sample resolution in bits
|
||||||
* @max: output sample maximum positive value
|
* @max: output sample maximum positive value
|
||||||
*/
|
*/
|
||||||
struct stm32_dfsdm_filter_osr {
|
struct stm32_dfsdm_filter_osr {
|
||||||
|
@ -257,6 +258,7 @@ struct stm32_dfsdm_filter_osr {
|
||||||
unsigned int rshift;
|
unsigned int rshift;
|
||||||
unsigned int lshift;
|
unsigned int lshift;
|
||||||
u64 res;
|
u64 res;
|
||||||
|
u32 bits;
|
||||||
s32 max;
|
s32 max;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue