• Fabrice Gasnier's avatar
    iio: adc: stm32: add optional st,min-sample-time-nsecs · ee2ac1cd
    Fabrice Gasnier authored
    STM32 ADC allows each channel to be sampled with a different sampling time,
    by setting SMPR registers. Basically, value depends on local electrical
    properties. Selecting correct value for sampling time highly depends on
    analog source impedance. There is a manual that may help in this process:
    'How to get the best ADC accuracy in STM32...'
    
    This patch allows to configure minimum sampling time via device tree,
    either for:
    - all channels at once:
      st,min-sample-time-nsecs = <10000>;
    
    - independently for each channel (must match "st,adc-channels" list):
      st,adc-channels = <0 1>;
      st,min-sample-time-nsecs = <5000 10000>;
    Signed-off-by: default avatarFabrice Gasnier <fabrice.gasnier@st.com>
    Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
    ee2ac1cd
stm32-adc.c 52.4 KB