From 8f197adc3023db068a747b715f968dfcb3b3e228 Mon Sep 17 00:00:00 2001 From: Guillaume Gautier Date: Fri, 23 Jun 2023 10:14:16 +0200 Subject: [PATCH] dts: bindings: adc: add properties for stm32 adc clock source Add two properties to define the STM32 ADC clock source: - Clock source: synchronous or asynchronous - Clock prescaler By combining these two parameters, it will be possible to set the desired ADC clock for most series. Signed-off-by: Guillaume Gautier --- dts/bindings/adc/st,stm32-adc.yaml | 38 ++++++++++++++++++++++++++++ dts/bindings/adc/st,stm32f1-adc.yaml | 11 ++++++-- 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/dts/bindings/adc/st,stm32-adc.yaml b/dts/bindings/adc/st,stm32-adc.yaml index dd02a45bbdf..d9c2dac9dc4 100644 --- a/dts/bindings/adc/st,stm32-adc.yaml +++ b/dts/bindings/adc/st,stm32-adc.yaml @@ -27,6 +27,44 @@ properties: pinctrl-names: required: true + st,adc-clock-source: + type: int + required: true + enum: + - 1 # SYNC for synchronous ADC clock source + - 2 # ASYNC for asynchronous ADC clock source + description: | + Type of ADC clock source : + - : derived from the bus clock. + - : independent and asynchronous with the bus clock + One of the two values may not apply to some series. Refer to the RefMan. + + st,adc-prescaler: + type: int + required: true + enum: + - 1 # not divided + - 2 + - 4 + - 6 + - 8 + - 10 + - 12 + - 16 + - 32 + - 64 + - 128 + - 256 + description: | + Clock prescaler at the input of the ADC: + Apply to synchronous or asynchronous clock depending on the STM32 + st,adc-clock-source. + Some of the values may not apply to some series, and may depend on the + selected clock source. Refer to the RefMan. + On STM32F3x (except STM32F37x), this configures only the synchronous + prescaler (see properties adcXX-prescaler in st,stm32f3-rcc bindings to + set asynchronous prescaler). + vref-mv: type: int default: 3300 diff --git a/dts/bindings/adc/st,stm32f1-adc.yaml b/dts/bindings/adc/st,stm32f1-adc.yaml index 7ccb23c3c68..a8c99d677ab 100644 --- a/dts/bindings/adc/st,stm32f1-adc.yaml +++ b/dts/bindings/adc/st,stm32f1-adc.yaml @@ -5,8 +5,15 @@ description: | ST STM32F1 family ADC This compatible stands for all ADC blocks similar to the one on STM32F1, - like F37x. + like STM32F37x. + Remove the st,adc-clock-source and st,adc-prescaler property. + See adc-prescaler property in st,stm32f1-rcc binding to configure ADC + prescaler. compatible: "st,stm32f1-adc" -include: st,stm32-adc.yaml +include: + - name: st,stm32-adc.yaml + property-blocklist: + - st,adc-clock-source + - st,adc-prescaler