[03/10] ARM: dts: stm32: add vrefint support to adc2 on stm32mp15

Message ID 20230112104446.1140551-4-olivier.moysan@foss.st.com
State New
Headers
Series ARM: dts: stm32: add adc internal channels on stm32mp15 |

Commit Message

Olivier MOYSAN Jan. 12, 2023, 10:44 a.m. UTC
  Set STM32 ADC2 as a consumer of BSEC on STM32MP15, to retrieve
vrefint calibration data savec in OTP.

During the calibration process vrefp is set to 3.3V and the data
acquired is saved to the OTP. This data is used by the ADC driver
to calculated the actual value of vrefp according to the formula:
vrefp = 3.3 x vrefint_cal / vrefint_data

The vrefint channel provides the actual value of vrefp,
which can be used to correct ADC acquisition data.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
---
 arch/arm/boot/dts/stm32mp151.dtsi | 2 ++
 1 file changed, 2 insertions(+)
  

Patch

diff --git a/arch/arm/boot/dts/stm32mp151.dtsi b/arch/arm/boot/dts/stm32mp151.dtsi
index eec5e9992bff..472fc3b94f33 100644
--- a/arch/arm/boot/dts/stm32mp151.dtsi
+++ b/arch/arm/boot/dts/stm32mp151.dtsi
@@ -1113,6 +1113,8 @@  adc2: adc@100 {
 				interrupts = <1>;
 				dmas = <&dmamux1 10 0x400 0x01>;
 				dma-names = "rx";
+				nvmem-cells = <&vrefint>;
+				nvmem-cell-names = "vrefint";
 				status = "disabled";
 				channel@13 {
 					reg = <13>;