• Fabrice Gasnier's avatar
    iio: adc: stm32: fix common clock rate · 50dbe1f4
    Fabrice Gasnier authored
    ADC clock input is provided to internal prescaler (that decreases its
    frequency). It's then used as reference clock for conversions.
    
    - Fix common clock rate used then by stm32-adc sub-devices. Take common
      prescaler into account. Currently, rate is used to set "boost" mode.
      It may unnecessarily be set. This impacts power consumption.
    - Fix ADC max clock rate on STM32H7 (fADC from datasheet). Currently,
      prescaler may be set too low. This can result in ADC reference
      clock used for conversion to exceed max allowed clock frequency.
    
    Fixes: 95e339b6 ("iio: adc: stm32: add support for STM32H7")
    Signed-off-by: default avatarFabrice Gasnier <fabrice.gasnier@st.com>
    Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
    50dbe1f4
stm32-adc-core.c 13.8 KB