diff options
author | Fabrice Gasnier <fabrice.gasnier@st.com> | 2019-03-25 15:24:01 +0100 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2019-04-04 20:21:10 +0100 |
commit | 9f57110d2e3de5411730f2cdd160d60f4b59acc5 (patch) | |
tree | 85354d4e3399f7e53fde11d09b44b6f8db5dd96e /init | |
parent | 65500c53aa6d0a6c4e40fcc7788332af9720ad14 (diff) | |
download | linux-9f57110d2e3de5411730f2cdd160d60f4b59acc5.tar.gz linux-9f57110d2e3de5411730f2cdd160d60f4b59acc5.tar.bz2 linux-9f57110d2e3de5411730f2cdd160d60f4b59acc5.zip |
iio: adc: stm32-dfsdm: improve sampling frequency accuracy
The sample frequency is driven using the oversampling ratio depending
on the SPI bus frequency.
Currently, oversampling ratio is computed by an entire division:
- spi_freq / sample_freq. This may result in inaccurate value.
Using DIV_ROUND_CLOSEST improves resulting sample frequency, which is
useful for audio that requests fixed rates (such as: 8, 16 or 32 kHz).
BTW, introduce new routine to re-factor sample frequency setting, and
move frequency accuracy message from warning to debug level.
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'init')
0 files changed, 0 insertions, 0 deletions