All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/9] ARM: dts: stm32: add adc internal channels on stm32mp15
@ 2023-05-30 12:45 ` Olivier Moysan
  0 siblings, 0 replies; 24+ messages in thread
From: Olivier Moysan @ 2023-05-30 12:45 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
	Alexandre Torgue, Marek Vasut
  Cc: Olivier Moysan, devicetree, linux-stm32, linux-arm-kernel,
	linux-kernel, kernel

Add STM32 ADC2 internal channels VREFINT and VDDCORE to STM32MP15x SoCs.

Add support of vrefint channel by adding access to vrefint calibration
data in OTP.

The internal channels are defined in STM32MP15 SoC DT according to
generic channel bindings. The STM32 driver does not support a mixed use
of legacy and generic channels. When generic channels are defined,
legacy channel are ignored. This involves that the board device trees
using legacy bindings have to be changed to generic bindings.

Adopt generic iio bindings on STM32 boards implementing the ADC.

Changes in v2:
- Add patch from https://lore.kernel.org/linux-arm-kernel/20230518020547.487670-1-marex@denx.de/T/
- Change node name from vrefin_cal to vrefin-cal

Marek Vasut (1):
  ARM: dts: stm32: Update to generic ADC channel binding on DHSOM
    systems

Olivier Moysan (8):
  ARM: dts: stm32: add adc internal channels to stm32mp15
  ARM: dts: stm32: add vrefint calibration on stm32mp15
  ARM: dts: stm32: add vrefint support to adc2 on stm32mp15
  ARM: dts: stm32: enable adc on stm32mp15xx-dkx boards
  ARM: dts: stm32: adopt generic iio bindings for adc channels on
    stm32mp157c-ed1
  ARM: dts: stm32: adopt generic iio bindings for adc channels on
    emstamp-argon
  ARM: dts: stm32: adopt generic iio bindings for adc channels on
    dhcor-drc
  ARM: dts: stm32: adopt generic iio bindings for adc channels on
    dhcor-testbench

 arch/arm/boot/dts/stm32mp151.dtsi             | 17 +++++++++
 arch/arm/boot/dts/stm32mp157c-ed1.dts         | 16 ++++++--
 .../boot/dts/stm32mp157c-emstamp-argon.dtsi   |  6 ++-
 arch/arm/boot/dts/stm32mp15xx-dhcom-som.dtsi  | 18 +++++----
 .../boot/dts/stm32mp15xx-dhcor-avenger96.dtsi | 38 +++++++++++++++----
 .../dts/stm32mp15xx-dhcor-drc-compact.dtsi    | 28 ++++++++++++--
 .../boot/dts/stm32mp15xx-dhcor-testbench.dtsi | 28 ++++++++++++--
 arch/arm/boot/dts/stm32mp15xx-dkx.dtsi        | 29 +++++++++-----
 8 files changed, 142 insertions(+), 38 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH v2 0/9] ARM: dts: stm32: add adc internal channels on stm32mp15
@ 2023-05-30 12:45 ` Olivier Moysan
  0 siblings, 0 replies; 24+ messages in thread
From: Olivier Moysan @ 2023-05-30 12:45 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
	Alexandre Torgue, Marek Vasut
  Cc: Olivier Moysan, devicetree, linux-stm32, linux-arm-kernel,
	linux-kernel, kernel

Add STM32 ADC2 internal channels VREFINT and VDDCORE to STM32MP15x SoCs.

Add support of vrefint channel by adding access to vrefint calibration
data in OTP.

The internal channels are defined in STM32MP15 SoC DT according to
generic channel bindings. The STM32 driver does not support a mixed use
of legacy and generic channels. When generic channels are defined,
legacy channel are ignored. This involves that the board device trees
using legacy bindings have to be changed to generic bindings.

Adopt generic iio bindings on STM32 boards implementing the ADC.

Changes in v2:
- Add patch from https://lore.kernel.org/linux-arm-kernel/20230518020547.487670-1-marex@denx.de/T/
- Change node name from vrefin_cal to vrefin-cal

Marek Vasut (1):
  ARM: dts: stm32: Update to generic ADC channel binding on DHSOM
    systems

Olivier Moysan (8):
  ARM: dts: stm32: add adc internal channels to stm32mp15
  ARM: dts: stm32: add vrefint calibration on stm32mp15
  ARM: dts: stm32: add vrefint support to adc2 on stm32mp15
  ARM: dts: stm32: enable adc on stm32mp15xx-dkx boards
  ARM: dts: stm32: adopt generic iio bindings for adc channels on
    stm32mp157c-ed1
  ARM: dts: stm32: adopt generic iio bindings for adc channels on
    emstamp-argon
  ARM: dts: stm32: adopt generic iio bindings for adc channels on
    dhcor-drc
  ARM: dts: stm32: adopt generic iio bindings for adc channels on
    dhcor-testbench

 arch/arm/boot/dts/stm32mp151.dtsi             | 17 +++++++++
 arch/arm/boot/dts/stm32mp157c-ed1.dts         | 16 ++++++--
 .../boot/dts/stm32mp157c-emstamp-argon.dtsi   |  6 ++-
 arch/arm/boot/dts/stm32mp15xx-dhcom-som.dtsi  | 18 +++++----
 .../boot/dts/stm32mp15xx-dhcor-avenger96.dtsi | 38 +++++++++++++++----
 .../dts/stm32mp15xx-dhcor-drc-compact.dtsi    | 28 ++++++++++++--
 .../boot/dts/stm32mp15xx-dhcor-testbench.dtsi | 28 ++++++++++++--
 arch/arm/boot/dts/stm32mp15xx-dkx.dtsi        | 29 +++++++++-----
 8 files changed, 142 insertions(+), 38 deletions(-)

-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH v2 1/9] ARM: dts: stm32: add adc internal channels to stm32mp15
  2023-05-30 12:45 ` Olivier Moysan
@ 2023-05-30 12:45   ` Olivier Moysan
  -1 siblings, 0 replies; 24+ messages in thread
From: Olivier Moysan @ 2023-05-30 12:45 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
	Alexandre Torgue
  Cc: Olivier Moysan, devicetree, linux-stm32, linux-arm-kernel, linux-kernel

Add STM32 ADC2 internal channels VREFINT and VDDCORE to STM32MP15x SoCs.
VBAT internal channel is not defined by default in SoC DT, and
has be defined in board DT when needed, instead. This avoids unwanted
current consumption on battery, when ADC conversions are performed
on any other channels.

The internal channels are defined in STM32MP15 SoC DT according to the
generic IIO channel bindings. The STM32 driver does not support a mixed
use of legacy and generic channels. When generic channels are defined,
legacy channels are ignored. This involves that the board device trees
using legacy bindings for ADC2, have to be reworked.

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

diff --git a/arch/arm/boot/dts/stm32mp151.dtsi b/arch/arm/boot/dts/stm32mp151.dtsi
index bf3830dca742..7b360ee1ba2b 100644
--- a/arch/arm/boot/dts/stm32mp151.dtsi
+++ b/arch/arm/boot/dts/stm32mp151.dtsi
@@ -1093,6 +1093,8 @@ adc: adc@48003000 {
 			adc1: adc@0 {
 				compatible = "st,stm32mp1-adc";
 				#io-channel-cells = <1>;
+				#address-cells = <1>;
+				#size-cells = <0>;
 				reg = <0x0>;
 				interrupt-parent = <&adc>;
 				interrupts = <0>;
@@ -1104,12 +1106,22 @@ adc1: adc@0 {
 			adc2: adc@100 {
 				compatible = "st,stm32mp1-adc";
 				#io-channel-cells = <1>;
+				#address-cells = <1>;
+				#size-cells = <0>;
 				reg = <0x100>;
 				interrupt-parent = <&adc>;
 				interrupts = <1>;
 				dmas = <&dmamux1 10 0x400 0x01>;
 				dma-names = "rx";
 				status = "disabled";
+				channel@13 {
+					reg = <13>;
+					label = "vrefint";
+				};
+				channel@14 {
+					reg = <14>;
+					label = "vddcore";
+				};
 			};
 		};
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 1/9] ARM: dts: stm32: add adc internal channels to stm32mp15
@ 2023-05-30 12:45   ` Olivier Moysan
  0 siblings, 0 replies; 24+ messages in thread
From: Olivier Moysan @ 2023-05-30 12:45 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
	Alexandre Torgue
  Cc: Olivier Moysan, devicetree, linux-stm32, linux-arm-kernel, linux-kernel

Add STM32 ADC2 internal channels VREFINT and VDDCORE to STM32MP15x SoCs.
VBAT internal channel is not defined by default in SoC DT, and
has be defined in board DT when needed, instead. This avoids unwanted
current consumption on battery, when ADC conversions are performed
on any other channels.

The internal channels are defined in STM32MP15 SoC DT according to the
generic IIO channel bindings. The STM32 driver does not support a mixed
use of legacy and generic channels. When generic channels are defined,
legacy channels are ignored. This involves that the board device trees
using legacy bindings for ADC2, have to be reworked.

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

diff --git a/arch/arm/boot/dts/stm32mp151.dtsi b/arch/arm/boot/dts/stm32mp151.dtsi
index bf3830dca742..7b360ee1ba2b 100644
--- a/arch/arm/boot/dts/stm32mp151.dtsi
+++ b/arch/arm/boot/dts/stm32mp151.dtsi
@@ -1093,6 +1093,8 @@ adc: adc@48003000 {
 			adc1: adc@0 {
 				compatible = "st,stm32mp1-adc";
 				#io-channel-cells = <1>;
+				#address-cells = <1>;
+				#size-cells = <0>;
 				reg = <0x0>;
 				interrupt-parent = <&adc>;
 				interrupts = <0>;
@@ -1104,12 +1106,22 @@ adc1: adc@0 {
 			adc2: adc@100 {
 				compatible = "st,stm32mp1-adc";
 				#io-channel-cells = <1>;
+				#address-cells = <1>;
+				#size-cells = <0>;
 				reg = <0x100>;
 				interrupt-parent = <&adc>;
 				interrupts = <1>;
 				dmas = <&dmamux1 10 0x400 0x01>;
 				dma-names = "rx";
 				status = "disabled";
+				channel@13 {
+					reg = <13>;
+					label = "vrefint";
+				};
+				channel@14 {
+					reg = <14>;
+					label = "vddcore";
+				};
 			};
 		};
 
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 2/9] ARM: dts: stm32: add vrefint calibration on stm32mp15
  2023-05-30 12:45 ` Olivier Moysan
@ 2023-05-30 12:45   ` Olivier Moysan
  -1 siblings, 0 replies; 24+ messages in thread
From: Olivier Moysan @ 2023-05-30 12:45 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
	Alexandre Torgue
  Cc: Olivier Moysan, devicetree, linux-stm32, linux-arm-kernel, linux-kernel

Describe vrefint calibration cell to be retrieved through bsec.

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

diff --git a/arch/arm/boot/dts/stm32mp151.dtsi b/arch/arm/boot/dts/stm32mp151.dtsi
index 7b360ee1ba2b..3d0c39d847b5 100644
--- a/arch/arm/boot/dts/stm32mp151.dtsi
+++ b/arch/arm/boot/dts/stm32mp151.dtsi
@@ -1630,6 +1630,9 @@ bsec: efuse@5c005000 {
 			part_number_otp: part-number-otp@4 {
 				reg = <0x4 0x1>;
 			};
+			vrefint: vrefin-cal@52 {
+				reg = <0x52 0x2>;
+			};
 			ts_cal1: calib@5c {
 				reg = <0x5c 0x2>;
 			};
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 2/9] ARM: dts: stm32: add vrefint calibration on stm32mp15
@ 2023-05-30 12:45   ` Olivier Moysan
  0 siblings, 0 replies; 24+ messages in thread
From: Olivier Moysan @ 2023-05-30 12:45 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
	Alexandre Torgue
  Cc: Olivier Moysan, devicetree, linux-stm32, linux-arm-kernel, linux-kernel

Describe vrefint calibration cell to be retrieved through bsec.

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

diff --git a/arch/arm/boot/dts/stm32mp151.dtsi b/arch/arm/boot/dts/stm32mp151.dtsi
index 7b360ee1ba2b..3d0c39d847b5 100644
--- a/arch/arm/boot/dts/stm32mp151.dtsi
+++ b/arch/arm/boot/dts/stm32mp151.dtsi
@@ -1630,6 +1630,9 @@ bsec: efuse@5c005000 {
 			part_number_otp: part-number-otp@4 {
 				reg = <0x4 0x1>;
 			};
+			vrefint: vrefin-cal@52 {
+				reg = <0x52 0x2>;
+			};
 			ts_cal1: calib@5c {
 				reg = <0x5c 0x2>;
 			};
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 3/9] ARM: dts: stm32: add vrefint support to adc2 on stm32mp15
  2023-05-30 12:45 ` Olivier Moysan
@ 2023-05-30 12:45   ` Olivier Moysan
  -1 siblings, 0 replies; 24+ messages in thread
From: Olivier Moysan @ 2023-05-30 12:45 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
	Alexandre Torgue
  Cc: Olivier Moysan, devicetree, linux-stm32, linux-arm-kernel, linux-kernel

Set STM32 ADC2 as a consumer of BSEC on STM32MP15, to retrieve
vrefint calibration data saved 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(+)

diff --git a/arch/arm/boot/dts/stm32mp151.dtsi b/arch/arm/boot/dts/stm32mp151.dtsi
index 3d0c39d847b5..61508917521c 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>;
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 3/9] ARM: dts: stm32: add vrefint support to adc2 on stm32mp15
@ 2023-05-30 12:45   ` Olivier Moysan
  0 siblings, 0 replies; 24+ messages in thread
From: Olivier Moysan @ 2023-05-30 12:45 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
	Alexandre Torgue
  Cc: Olivier Moysan, devicetree, linux-stm32, linux-arm-kernel, linux-kernel

Set STM32 ADC2 as a consumer of BSEC on STM32MP15, to retrieve
vrefint calibration data saved 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(+)

diff --git a/arch/arm/boot/dts/stm32mp151.dtsi b/arch/arm/boot/dts/stm32mp151.dtsi
index 3d0c39d847b5..61508917521c 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>;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 4/9] ARM: dts: stm32: enable adc on stm32mp15xx-dkx boards
  2023-05-30 12:45 ` Olivier Moysan
@ 2023-05-30 12:45   ` Olivier Moysan
  -1 siblings, 0 replies; 24+ messages in thread
From: Olivier Moysan @ 2023-05-30 12:45 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
	Alexandre Torgue
  Cc: Olivier Moysan, devicetree, linux-stm32, linux-arm-kernel, linux-kernel

U-Boot enables ADC1&2 to support USB power measurement and ADC
calibration on STM32MP15x Disco boards.
When leaving U-boot the ADCs do not return to power down state
to keep ADC linear calibration available for kernel.
Enable ADC1&2 by default on STM32MP15xx-DKx boards to align kernel
DT with Uboot. This avoids to shutdown the ADCs VDDA, while the
ADCs are not in power down.

Use STM32 ADC generic bindings instead of legacy bindings on
STM32MP15xx-DKx boards.

The ADC pins on Arduino connector are not set by default.
These pins are added in A7 Disco example DTs only.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
---
 arch/arm/boot/dts/stm32mp15xx-dkx.dtsi | 29 ++++++++++++++++++--------
 1 file changed, 20 insertions(+), 9 deletions(-)

diff --git a/arch/arm/boot/dts/stm32mp15xx-dkx.dtsi b/arch/arm/boot/dts/stm32mp15xx-dkx.dtsi
index a6e2e20f12fa..e78ba956b9d0 100644
--- a/arch/arm/boot/dts/stm32mp15xx-dkx.dtsi
+++ b/arch/arm/boot/dts/stm32mp15xx-dkx.dtsi
@@ -93,28 +93,39 @@ vin: vin {
 
 &adc {
 	pinctrl-names = "default";
-	pinctrl-0 = <&adc12_ain_pins_a>, <&adc12_usb_cc_pins_a>;
+	pinctrl-0 = <&adc12_usb_cc_pins_a>;
 	vdd-supply = <&vdd>;
 	vdda-supply = <&vdd>;
 	vref-supply = <&vrefbuf>;
-	status = "disabled";
+	status = "okay";
 	adc1: adc@0 {
+		status = "okay";
 		/*
 		 * Type-C USB_PWR_CC1 & USB_PWR_CC2 on in18 & in19.
 		 * Use at least 5 * RC time, e.g. 5 * (Rp + Rd) * C:
 		 * 5 * (56 + 47kOhms) * 5pF => 2.5us.
 		 * Use arbitrary margin here (e.g. 5us).
 		 */
-		st,min-sample-time-nsecs = <5000>;
-		/* AIN connector, USB Type-C CC1 & CC2 */
-		st,adc-channels = <0 1 6 13 18 19>;
-		status = "okay";
+		channel@18 {
+			reg = <18>;
+			st,min-sample-time-ns = <5000>;
+		};
+		channel@19 {
+			reg = <19>;
+			st,min-sample-time-ns = <5000>;
+		};
 	};
 	adc2: adc@100 {
-		/* AIN connector, USB Type-C CC1 & CC2 */
-		st,adc-channels = <0 1 2 6 18 19>;
-		st,min-sample-time-nsecs = <5000>;
 		status = "okay";
+		/* USB Type-C CC1 & CC2 */
+		channel@18 {
+			reg = <18>;
+			st,min-sample-time-ns = <5000>;
+		};
+		channel@19 {
+			reg = <19>;
+			st,min-sample-time-ns = <5000>;
+		};
 	};
 };
 
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 4/9] ARM: dts: stm32: enable adc on stm32mp15xx-dkx boards
@ 2023-05-30 12:45   ` Olivier Moysan
  0 siblings, 0 replies; 24+ messages in thread
From: Olivier Moysan @ 2023-05-30 12:45 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
	Alexandre Torgue
  Cc: Olivier Moysan, devicetree, linux-stm32, linux-arm-kernel, linux-kernel

U-Boot enables ADC1&2 to support USB power measurement and ADC
calibration on STM32MP15x Disco boards.
When leaving U-boot the ADCs do not return to power down state
to keep ADC linear calibration available for kernel.
Enable ADC1&2 by default on STM32MP15xx-DKx boards to align kernel
DT with Uboot. This avoids to shutdown the ADCs VDDA, while the
ADCs are not in power down.

Use STM32 ADC generic bindings instead of legacy bindings on
STM32MP15xx-DKx boards.

The ADC pins on Arduino connector are not set by default.
These pins are added in A7 Disco example DTs only.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
---
 arch/arm/boot/dts/stm32mp15xx-dkx.dtsi | 29 ++++++++++++++++++--------
 1 file changed, 20 insertions(+), 9 deletions(-)

diff --git a/arch/arm/boot/dts/stm32mp15xx-dkx.dtsi b/arch/arm/boot/dts/stm32mp15xx-dkx.dtsi
index a6e2e20f12fa..e78ba956b9d0 100644
--- a/arch/arm/boot/dts/stm32mp15xx-dkx.dtsi
+++ b/arch/arm/boot/dts/stm32mp15xx-dkx.dtsi
@@ -93,28 +93,39 @@ vin: vin {
 
 &adc {
 	pinctrl-names = "default";
-	pinctrl-0 = <&adc12_ain_pins_a>, <&adc12_usb_cc_pins_a>;
+	pinctrl-0 = <&adc12_usb_cc_pins_a>;
 	vdd-supply = <&vdd>;
 	vdda-supply = <&vdd>;
 	vref-supply = <&vrefbuf>;
-	status = "disabled";
+	status = "okay";
 	adc1: adc@0 {
+		status = "okay";
 		/*
 		 * Type-C USB_PWR_CC1 & USB_PWR_CC2 on in18 & in19.
 		 * Use at least 5 * RC time, e.g. 5 * (Rp + Rd) * C:
 		 * 5 * (56 + 47kOhms) * 5pF => 2.5us.
 		 * Use arbitrary margin here (e.g. 5us).
 		 */
-		st,min-sample-time-nsecs = <5000>;
-		/* AIN connector, USB Type-C CC1 & CC2 */
-		st,adc-channels = <0 1 6 13 18 19>;
-		status = "okay";
+		channel@18 {
+			reg = <18>;
+			st,min-sample-time-ns = <5000>;
+		};
+		channel@19 {
+			reg = <19>;
+			st,min-sample-time-ns = <5000>;
+		};
 	};
 	adc2: adc@100 {
-		/* AIN connector, USB Type-C CC1 & CC2 */
-		st,adc-channels = <0 1 2 6 18 19>;
-		st,min-sample-time-nsecs = <5000>;
 		status = "okay";
+		/* USB Type-C CC1 & CC2 */
+		channel@18 {
+			reg = <18>;
+			st,min-sample-time-ns = <5000>;
+		};
+		channel@19 {
+			reg = <19>;
+			st,min-sample-time-ns = <5000>;
+		};
 	};
 };
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 5/9] ARM: dts: stm32: adopt generic iio bindings for adc channels on stm32mp157c-ed1
  2023-05-30 12:45 ` Olivier Moysan
@ 2023-05-30 12:45   ` Olivier Moysan
  -1 siblings, 0 replies; 24+ messages in thread
From: Olivier Moysan @ 2023-05-30 12:45 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
	Alexandre Torgue
  Cc: Olivier Moysan, devicetree, linux-stm32, linux-arm-kernel, linux-kernel

Use STM32 ADC generic bindings instead of legacy bindings on
STM32MP157c-ed1 board.

The STM32 ADC specific binding to declare channels has been deprecated,
hence adopt the generic IIO channels bindings, instead.
The STM32MP151 device tree now exposes internal channels using the
generic binding. This makes the change mandatory here to avoid a mixed
use of legacy and generic binding, which is not supported by the driver.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
---
 arch/arm/boot/dts/stm32mp157c-ed1.dts | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/stm32mp157c-ed1.dts b/arch/arm/boot/dts/stm32mp157c-ed1.dts
index 8beb901be506..66ed5f9921ba 100644
--- a/arch/arm/boot/dts/stm32mp157c-ed1.dts
+++ b/arch/arm/boot/dts/stm32mp157c-ed1.dts
@@ -103,10 +103,20 @@ &adc {
 	vref-supply = <&vdda>;
 	status = "disabled";
 	adc1: adc@0 {
-		st,adc-channels = <0 1 6>;
-		/* 16.5 ck_cycles sampling time */
-		st,min-sample-time-nsecs = <400>;
 		status = "okay";
+		channel@0 {
+			reg = <0>;
+			/* 16.5 ck_cycles sampling time */
+			st,min-sample-time-ns = <400>;
+		};
+		channel@1 {
+			reg = <1>;
+			st,min-sample-time-ns = <400>;
+		};
+		channel@6 {
+			reg = <6>;
+			st,min-sample-time-ns = <400>;
+		};
 	};
 };
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 5/9] ARM: dts: stm32: adopt generic iio bindings for adc channels on stm32mp157c-ed1
@ 2023-05-30 12:45   ` Olivier Moysan
  0 siblings, 0 replies; 24+ messages in thread
From: Olivier Moysan @ 2023-05-30 12:45 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
	Alexandre Torgue
  Cc: Olivier Moysan, devicetree, linux-stm32, linux-arm-kernel, linux-kernel

Use STM32 ADC generic bindings instead of legacy bindings on
STM32MP157c-ed1 board.

The STM32 ADC specific binding to declare channels has been deprecated,
hence adopt the generic IIO channels bindings, instead.
The STM32MP151 device tree now exposes internal channels using the
generic binding. This makes the change mandatory here to avoid a mixed
use of legacy and generic binding, which is not supported by the driver.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
---
 arch/arm/boot/dts/stm32mp157c-ed1.dts | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/stm32mp157c-ed1.dts b/arch/arm/boot/dts/stm32mp157c-ed1.dts
index 8beb901be506..66ed5f9921ba 100644
--- a/arch/arm/boot/dts/stm32mp157c-ed1.dts
+++ b/arch/arm/boot/dts/stm32mp157c-ed1.dts
@@ -103,10 +103,20 @@ &adc {
 	vref-supply = <&vdda>;
 	status = "disabled";
 	adc1: adc@0 {
-		st,adc-channels = <0 1 6>;
-		/* 16.5 ck_cycles sampling time */
-		st,min-sample-time-nsecs = <400>;
 		status = "okay";
+		channel@0 {
+			reg = <0>;
+			/* 16.5 ck_cycles sampling time */
+			st,min-sample-time-ns = <400>;
+		};
+		channel@1 {
+			reg = <1>;
+			st,min-sample-time-ns = <400>;
+		};
+		channel@6 {
+			reg = <6>;
+			st,min-sample-time-ns = <400>;
+		};
 	};
 };
 
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 6/9] ARM: dts: stm32: adopt generic iio bindings for adc channels on emstamp-argon
  2023-05-30 12:45 ` Olivier Moysan
@ 2023-05-30 12:45   ` Olivier Moysan
  -1 siblings, 0 replies; 24+ messages in thread
From: Olivier Moysan @ 2023-05-30 12:45 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
	Alexandre Torgue
  Cc: Olivier Moysan, devicetree, linux-stm32, linux-arm-kernel, linux-kernel

Use STM32 ADC generic bindings instead of legacy bindings on
emtrion GmbH Argon boards.

The STM32 ADC specific binding to declare channels has been deprecated,
hence adopt the generic IIO channels bindings, instead.
The STM32MP151 device tree now exposes internal channels using the
generic binding. This makes the change mandatory here to avoid a mixed
use of legacy and generic binding, which is not supported by the driver.

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

diff --git a/arch/arm/boot/dts/stm32mp157c-emstamp-argon.dtsi b/arch/arm/boot/dts/stm32mp157c-emstamp-argon.dtsi
index b01470a9a3d5..94e38141af67 100644
--- a/arch/arm/boot/dts/stm32mp157c-emstamp-argon.dtsi
+++ b/arch/arm/boot/dts/stm32mp157c-emstamp-argon.dtsi
@@ -97,9 +97,11 @@ &adc {
 	adc1: adc@0 {
 		pinctrl-names = "default";
 		pinctrl-0 = <&adc1_in6_pins_a>;
-		st,min-sample-time-nsecs = <5000>;
-		st,adc-channels = <6>;
 		status = "disabled";
+		channel@6 {
+			reg = <6>;
+			st,min-sample-time-ns = <5000>;
+		};
 	};
 
 	adc2: adc@100 {
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 6/9] ARM: dts: stm32: adopt generic iio bindings for adc channels on emstamp-argon
@ 2023-05-30 12:45   ` Olivier Moysan
  0 siblings, 0 replies; 24+ messages in thread
From: Olivier Moysan @ 2023-05-30 12:45 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
	Alexandre Torgue
  Cc: Olivier Moysan, devicetree, linux-stm32, linux-arm-kernel, linux-kernel

Use STM32 ADC generic bindings instead of legacy bindings on
emtrion GmbH Argon boards.

The STM32 ADC specific binding to declare channels has been deprecated,
hence adopt the generic IIO channels bindings, instead.
The STM32MP151 device tree now exposes internal channels using the
generic binding. This makes the change mandatory here to avoid a mixed
use of legacy and generic binding, which is not supported by the driver.

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

diff --git a/arch/arm/boot/dts/stm32mp157c-emstamp-argon.dtsi b/arch/arm/boot/dts/stm32mp157c-emstamp-argon.dtsi
index b01470a9a3d5..94e38141af67 100644
--- a/arch/arm/boot/dts/stm32mp157c-emstamp-argon.dtsi
+++ b/arch/arm/boot/dts/stm32mp157c-emstamp-argon.dtsi
@@ -97,9 +97,11 @@ &adc {
 	adc1: adc@0 {
 		pinctrl-names = "default";
 		pinctrl-0 = <&adc1_in6_pins_a>;
-		st,min-sample-time-nsecs = <5000>;
-		st,adc-channels = <6>;
 		status = "disabled";
+		channel@6 {
+			reg = <6>;
+			st,min-sample-time-ns = <5000>;
+		};
 	};
 
 	adc2: adc@100 {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 7/9] ARM: dts: stm32: adopt generic iio bindings for adc channels on dhcor-drc
  2023-05-30 12:45 ` Olivier Moysan
@ 2023-05-30 12:45   ` Olivier Moysan
  -1 siblings, 0 replies; 24+ messages in thread
From: Olivier Moysan @ 2023-05-30 12:45 UTC (permalink / raw)
  To: Marek Vasut, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Maxime Coquelin, Alexandre Torgue
  Cc: Olivier Moysan, kernel, devicetree, linux-stm32,
	linux-arm-kernel, linux-kernel

Use STM32 ADC generic bindings instead of legacy bindings on
DHCOR DRC Compact board.

The STM32 ADC specific binding to declare channels has been deprecated,
hence adopt the generic IIO channels bindings, instead.
The STM32MP151 device tree now exposes internal channels using the
generic binding. This makes the change mandatory here to avoid a mixed
use of legacy and generic binding, which is not supported by the driver.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
---
 .../dts/stm32mp15xx-dhcor-drc-compact.dtsi    | 28 ++++++++++++++++---
 1 file changed, 24 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/stm32mp15xx-dhcor-drc-compact.dtsi b/arch/arm/boot/dts/stm32mp15xx-dhcor-drc-compact.dtsi
index 39af79dc654c..92d906bfd5d7 100644
--- a/arch/arm/boot/dts/stm32mp15xx-dhcor-drc-compact.dtsi
+++ b/arch/arm/boot/dts/stm32mp15xx-dhcor-drc-compact.dtsi
@@ -57,15 +57,35 @@ &adc {	/* X11 ADC inputs */
 	status = "okay";
 
 	adc1: adc@0 {
-		st,adc-channels = <0 1 6>;
-		st,min-sample-time-nsecs = <5000>;
 		status = "okay";
+		channel@0 {
+			reg = <0>;
+			st,min-sample-time-ns = <5000>;
+		};
+		channel@1 {
+			reg = <1>;
+			st,min-sample-time-ns = <5000>;
+		};
+		channel@6 {
+			reg = <6>;
+			st,min-sample-time-ns = <5000>;
+		};
 	};
 
 	adc2: adc@100 {
-		st,adc-channels = <0 1 2>;
-		st,min-sample-time-nsecs = <5000>;
 		status = "okay";
+		channel@0 {
+			reg = <0>;
+			st,min-sample-time-ns = <5000>;
+		};
+		channel@1 {
+			reg = <1>;
+			st,min-sample-time-ns = <5000>;
+		};
+		channel@2 {
+			reg = <2>;
+			st,min-sample-time-ns = <5000>;
+		};
 	};
 };
 
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 7/9] ARM: dts: stm32: adopt generic iio bindings for adc channels on dhcor-drc
@ 2023-05-30 12:45   ` Olivier Moysan
  0 siblings, 0 replies; 24+ messages in thread
From: Olivier Moysan @ 2023-05-30 12:45 UTC (permalink / raw)
  To: Marek Vasut, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Maxime Coquelin, Alexandre Torgue
  Cc: Olivier Moysan, kernel, devicetree, linux-stm32,
	linux-arm-kernel, linux-kernel

Use STM32 ADC generic bindings instead of legacy bindings on
DHCOR DRC Compact board.

The STM32 ADC specific binding to declare channels has been deprecated,
hence adopt the generic IIO channels bindings, instead.
The STM32MP151 device tree now exposes internal channels using the
generic binding. This makes the change mandatory here to avoid a mixed
use of legacy and generic binding, which is not supported by the driver.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
---
 .../dts/stm32mp15xx-dhcor-drc-compact.dtsi    | 28 ++++++++++++++++---
 1 file changed, 24 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/stm32mp15xx-dhcor-drc-compact.dtsi b/arch/arm/boot/dts/stm32mp15xx-dhcor-drc-compact.dtsi
index 39af79dc654c..92d906bfd5d7 100644
--- a/arch/arm/boot/dts/stm32mp15xx-dhcor-drc-compact.dtsi
+++ b/arch/arm/boot/dts/stm32mp15xx-dhcor-drc-compact.dtsi
@@ -57,15 +57,35 @@ &adc {	/* X11 ADC inputs */
 	status = "okay";
 
 	adc1: adc@0 {
-		st,adc-channels = <0 1 6>;
-		st,min-sample-time-nsecs = <5000>;
 		status = "okay";
+		channel@0 {
+			reg = <0>;
+			st,min-sample-time-ns = <5000>;
+		};
+		channel@1 {
+			reg = <1>;
+			st,min-sample-time-ns = <5000>;
+		};
+		channel@6 {
+			reg = <6>;
+			st,min-sample-time-ns = <5000>;
+		};
 	};
 
 	adc2: adc@100 {
-		st,adc-channels = <0 1 2>;
-		st,min-sample-time-nsecs = <5000>;
 		status = "okay";
+		channel@0 {
+			reg = <0>;
+			st,min-sample-time-ns = <5000>;
+		};
+		channel@1 {
+			reg = <1>;
+			st,min-sample-time-ns = <5000>;
+		};
+		channel@2 {
+			reg = <2>;
+			st,min-sample-time-ns = <5000>;
+		};
 	};
 };
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 8/9] ARM: dts: stm32: adopt generic iio bindings for adc channels on dhcor-testbench
  2023-05-30 12:45 ` Olivier Moysan
@ 2023-05-30 12:45   ` Olivier Moysan
  -1 siblings, 0 replies; 24+ messages in thread
From: Olivier Moysan @ 2023-05-30 12:45 UTC (permalink / raw)
  To: Marek Vasut, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Maxime Coquelin, Alexandre Torgue
  Cc: Olivier Moysan, kernel, devicetree, linux-stm32,
	linux-arm-kernel, linux-kernel

Use STM32 ADC generic bindings instead of legacy bindings on
DHCOR Testbench board.

The STM32 ADC specific binding to declare channels has been deprecated,
hence adopt the generic IIO channels bindings, instead.
The STM32MP151 device tree now exposes internal channels using the
generic binding. This makes the change mandatory here to avoid a mixed
use of legacy and generic binding, which is not supported by the driver.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
---
 .../boot/dts/stm32mp15xx-dhcor-testbench.dtsi | 28 ++++++++++++++++---
 1 file changed, 24 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/stm32mp15xx-dhcor-testbench.dtsi b/arch/arm/boot/dts/stm32mp15xx-dhcor-testbench.dtsi
index faed31b6d84a..ab7f0ba49639 100644
--- a/arch/arm/boot/dts/stm32mp15xx-dhcor-testbench.dtsi
+++ b/arch/arm/boot/dts/stm32mp15xx-dhcor-testbench.dtsi
@@ -41,15 +41,35 @@ &adc {
 	status = "okay";
 
 	adc1: adc@0 {
-		st,adc-channels = <0 1 6>;
-		st,min-sample-time-nsecs = <5000>;
 		status = "okay";
+		channel@0 {
+			reg = <0>;
+			st,min-sample-time-ns = <5000>;
+		};
+		channel@1 {
+			reg = <1>;
+			st,min-sample-time-ns = <5000>;
+		};
+		channel@6 {
+			reg = <6>;
+			st,min-sample-time-ns = <5000>;
+		};
 	};
 
 	adc2: adc@100 {
-		st,adc-channels = <0 1 2>;
-		st,min-sample-time-nsecs = <5000>;
 		status = "okay";
+		channel@0 {
+			reg = <0>;
+			st,min-sample-time-ns = <5000>;
+		};
+		channel@1 {
+			reg = <1>;
+			st,min-sample-time-ns = <5000>;
+		};
+		channel@2 {
+			reg = <2>;
+			st,min-sample-time-ns = <5000>;
+		};
 	};
 };
 
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 8/9] ARM: dts: stm32: adopt generic iio bindings for adc channels on dhcor-testbench
@ 2023-05-30 12:45   ` Olivier Moysan
  0 siblings, 0 replies; 24+ messages in thread
From: Olivier Moysan @ 2023-05-30 12:45 UTC (permalink / raw)
  To: Marek Vasut, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Maxime Coquelin, Alexandre Torgue
  Cc: Olivier Moysan, kernel, devicetree, linux-stm32,
	linux-arm-kernel, linux-kernel

Use STM32 ADC generic bindings instead of legacy bindings on
DHCOR Testbench board.

The STM32 ADC specific binding to declare channels has been deprecated,
hence adopt the generic IIO channels bindings, instead.
The STM32MP151 device tree now exposes internal channels using the
generic binding. This makes the change mandatory here to avoid a mixed
use of legacy and generic binding, which is not supported by the driver.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
---
 .../boot/dts/stm32mp15xx-dhcor-testbench.dtsi | 28 ++++++++++++++++---
 1 file changed, 24 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/stm32mp15xx-dhcor-testbench.dtsi b/arch/arm/boot/dts/stm32mp15xx-dhcor-testbench.dtsi
index faed31b6d84a..ab7f0ba49639 100644
--- a/arch/arm/boot/dts/stm32mp15xx-dhcor-testbench.dtsi
+++ b/arch/arm/boot/dts/stm32mp15xx-dhcor-testbench.dtsi
@@ -41,15 +41,35 @@ &adc {
 	status = "okay";
 
 	adc1: adc@0 {
-		st,adc-channels = <0 1 6>;
-		st,min-sample-time-nsecs = <5000>;
 		status = "okay";
+		channel@0 {
+			reg = <0>;
+			st,min-sample-time-ns = <5000>;
+		};
+		channel@1 {
+			reg = <1>;
+			st,min-sample-time-ns = <5000>;
+		};
+		channel@6 {
+			reg = <6>;
+			st,min-sample-time-ns = <5000>;
+		};
 	};
 
 	adc2: adc@100 {
-		st,adc-channels = <0 1 2>;
-		st,min-sample-time-nsecs = <5000>;
 		status = "okay";
+		channel@0 {
+			reg = <0>;
+			st,min-sample-time-ns = <5000>;
+		};
+		channel@1 {
+			reg = <1>;
+			st,min-sample-time-ns = <5000>;
+		};
+		channel@2 {
+			reg = <2>;
+			st,min-sample-time-ns = <5000>;
+		};
 	};
 };
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 9/9] ARM: dts: stm32: Update to generic ADC channel binding on DHSOM systems
  2023-05-30 12:45 ` Olivier Moysan
@ 2023-05-30 12:45   ` Olivier Moysan
  -1 siblings, 0 replies; 24+ messages in thread
From: Olivier Moysan @ 2023-05-30 12:45 UTC (permalink / raw)
  To: Marek Vasut, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Maxime Coquelin, Alexandre Torgue
  Cc: kernel, devicetree, linux-stm32, linux-arm-kernel, linux-kernel

From: Marek Vasut <marex@denx.de>

The generic ADC channel binding is recommended over legacy one, update the
DT to the modern binding. No functional change. For further details, see
commit which adds the generic binding to STM32 ADC binding document:
'664b9879f56e ("dt-bindings: iio: stm32-adc: add generic channel binding")'

Signed-off-by: Marek Vasut <marex@denx.de>
---
 arch/arm/boot/dts/stm32mp15xx-dhcom-som.dtsi  | 18 +++++----
 .../boot/dts/stm32mp15xx-dhcor-avenger96.dtsi | 38 +++++++++++++++----
 2 files changed, 40 insertions(+), 16 deletions(-)

diff --git a/arch/arm/boot/dts/stm32mp15xx-dhcom-som.dtsi b/arch/arm/boot/dts/stm32mp15xx-dhcom-som.dtsi
index c06edd2eacb0..e61df23d361a 100644
--- a/arch/arm/boot/dts/stm32mp15xx-dhcom-som.dtsi
+++ b/arch/arm/boot/dts/stm32mp15xx-dhcom-som.dtsi
@@ -80,17 +80,19 @@ &adc {
 	vdda-supply = <&vdda>;
 	vref-supply = <&vdda>;
 	status = "okay";
+};
 
-	adc1: adc@0 {
-		st,min-sample-time-nsecs = <5000>;
-		st,adc-channels = <0>;
-		status = "okay";
+&adc1 {
+	channel@0 {
+		reg = <0>;
+		st,min-sample-time-ns = <5000>;
 	};
+};
 
-	adc2: adc@100 {
-		st,adc-channels = <1>;
-		st,min-sample-time-nsecs = <5000>;
-		status = "okay";
+&adc2 {
+	channel@1 {
+		reg = <1>;
+		st,min-sample-time-ns = <5000>;
 	};
 };
 
diff --git a/arch/arm/boot/dts/stm32mp15xx-dhcor-avenger96.dtsi b/arch/arm/boot/dts/stm32mp15xx-dhcor-avenger96.dtsi
index cdd4902b59a9..0069ad75d55e 100644
--- a/arch/arm/boot/dts/stm32mp15xx-dhcor-avenger96.dtsi
+++ b/arch/arm/boot/dts/stm32mp15xx-dhcor-avenger96.dtsi
@@ -111,17 +111,39 @@ &adc {
 	vdda-supply = <&vdda>;
 	vref-supply = <&vdda>;
 	status = "okay";
+};
 
-	adc1: adc@0 {
-		st,adc-channels = <0 1 6>;
-		st,min-sample-time-nsecs = <5000>;
-		status = "okay";
+&adc1 {
+	channel@0 {
+		reg = <0>;
+		st,min-sample-time-ns = <5000>;
 	};
 
-	adc2: adc@100 {
-		st,adc-channels = <0 1 2>;
-		st,min-sample-time-nsecs = <5000>;
-		status = "okay";
+	channel@1 {
+		reg = <1>;
+		st,min-sample-time-ns = <5000>;
+	};
+
+	channel@6 {
+		reg = <6>;
+		st,min-sample-time-ns = <5000>;
+	};
+};
+
+&adc2 {
+	channel@0 {
+		reg = <0>;
+		st,min-sample-time-ns = <5000>;
+	};
+
+	channel@1 {
+		reg = <1>;
+		st,min-sample-time-ns = <5000>;
+	};
+
+	channel@2 {
+		reg = <2>;
+		st,min-sample-time-ns = <5000>;
 	};
 };
 
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 9/9] ARM: dts: stm32: Update to generic ADC channel binding on DHSOM systems
@ 2023-05-30 12:45   ` Olivier Moysan
  0 siblings, 0 replies; 24+ messages in thread
From: Olivier Moysan @ 2023-05-30 12:45 UTC (permalink / raw)
  To: Marek Vasut, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Maxime Coquelin, Alexandre Torgue
  Cc: kernel, devicetree, linux-stm32, linux-arm-kernel, linux-kernel

From: Marek Vasut <marex@denx.de>

The generic ADC channel binding is recommended over legacy one, update the
DT to the modern binding. No functional change. For further details, see
commit which adds the generic binding to STM32 ADC binding document:
'664b9879f56e ("dt-bindings: iio: stm32-adc: add generic channel binding")'

Signed-off-by: Marek Vasut <marex@denx.de>
---
 arch/arm/boot/dts/stm32mp15xx-dhcom-som.dtsi  | 18 +++++----
 .../boot/dts/stm32mp15xx-dhcor-avenger96.dtsi | 38 +++++++++++++++----
 2 files changed, 40 insertions(+), 16 deletions(-)

diff --git a/arch/arm/boot/dts/stm32mp15xx-dhcom-som.dtsi b/arch/arm/boot/dts/stm32mp15xx-dhcom-som.dtsi
index c06edd2eacb0..e61df23d361a 100644
--- a/arch/arm/boot/dts/stm32mp15xx-dhcom-som.dtsi
+++ b/arch/arm/boot/dts/stm32mp15xx-dhcom-som.dtsi
@@ -80,17 +80,19 @@ &adc {
 	vdda-supply = <&vdda>;
 	vref-supply = <&vdda>;
 	status = "okay";
+};
 
-	adc1: adc@0 {
-		st,min-sample-time-nsecs = <5000>;
-		st,adc-channels = <0>;
-		status = "okay";
+&adc1 {
+	channel@0 {
+		reg = <0>;
+		st,min-sample-time-ns = <5000>;
 	};
+};
 
-	adc2: adc@100 {
-		st,adc-channels = <1>;
-		st,min-sample-time-nsecs = <5000>;
-		status = "okay";
+&adc2 {
+	channel@1 {
+		reg = <1>;
+		st,min-sample-time-ns = <5000>;
 	};
 };
 
diff --git a/arch/arm/boot/dts/stm32mp15xx-dhcor-avenger96.dtsi b/arch/arm/boot/dts/stm32mp15xx-dhcor-avenger96.dtsi
index cdd4902b59a9..0069ad75d55e 100644
--- a/arch/arm/boot/dts/stm32mp15xx-dhcor-avenger96.dtsi
+++ b/arch/arm/boot/dts/stm32mp15xx-dhcor-avenger96.dtsi
@@ -111,17 +111,39 @@ &adc {
 	vdda-supply = <&vdda>;
 	vref-supply = <&vdda>;
 	status = "okay";
+};
 
-	adc1: adc@0 {
-		st,adc-channels = <0 1 6>;
-		st,min-sample-time-nsecs = <5000>;
-		status = "okay";
+&adc1 {
+	channel@0 {
+		reg = <0>;
+		st,min-sample-time-ns = <5000>;
 	};
 
-	adc2: adc@100 {
-		st,adc-channels = <0 1 2>;
-		st,min-sample-time-nsecs = <5000>;
-		status = "okay";
+	channel@1 {
+		reg = <1>;
+		st,min-sample-time-ns = <5000>;
+	};
+
+	channel@6 {
+		reg = <6>;
+		st,min-sample-time-ns = <5000>;
+	};
+};
+
+&adc2 {
+	channel@0 {
+		reg = <0>;
+		st,min-sample-time-ns = <5000>;
+	};
+
+	channel@1 {
+		reg = <1>;
+		st,min-sample-time-ns = <5000>;
+	};
+
+	channel@2 {
+		reg = <2>;
+		st,min-sample-time-ns = <5000>;
 	};
 };
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* Re: [PATCH v2 0/9] ARM: dts: stm32: add adc internal channels on stm32mp15
  2023-05-30 12:45 ` Olivier Moysan
@ 2023-05-30 13:39   ` Marek Vasut
  -1 siblings, 0 replies; 24+ messages in thread
From: Marek Vasut @ 2023-05-30 13:39 UTC (permalink / raw)
  To: Olivier Moysan, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Maxime Coquelin, Alexandre Torgue
  Cc: devicetree, linux-stm32, linux-arm-kernel, linux-kernel, kernel

On 5/30/23 14:45, Olivier Moysan wrote:
> Add STM32 ADC2 internal channels VREFINT and VDDCORE to STM32MP15x SoCs.
> 
> Add support of vrefint channel by adding access to vrefint calibration
> data in OTP.
> 
> The internal channels are defined in STM32MP15 SoC DT according to
> generic channel bindings. The STM32 driver does not support a mixed use
> of legacy and generic channels. When generic channels are defined,
> legacy channel are ignored. This involves that the board device trees
> using legacy bindings have to be changed to generic bindings.
> 
> Adopt generic iio bindings on STM32 boards implementing the ADC.
> 
> Changes in v2:
> - Add patch from https://lore.kernel.org/linux-arm-kernel/20230518020547.487670-1-marex@denx.de/T/

Thank you

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v2 0/9] ARM: dts: stm32: add adc internal channels on stm32mp15
@ 2023-05-30 13:39   ` Marek Vasut
  0 siblings, 0 replies; 24+ messages in thread
From: Marek Vasut @ 2023-05-30 13:39 UTC (permalink / raw)
  To: Olivier Moysan, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Maxime Coquelin, Alexandre Torgue
  Cc: devicetree, linux-stm32, linux-arm-kernel, linux-kernel, kernel

On 5/30/23 14:45, Olivier Moysan wrote:
> Add STM32 ADC2 internal channels VREFINT and VDDCORE to STM32MP15x SoCs.
> 
> Add support of vrefint channel by adding access to vrefint calibration
> data in OTP.
> 
> The internal channels are defined in STM32MP15 SoC DT according to
> generic channel bindings. The STM32 driver does not support a mixed use
> of legacy and generic channels. When generic channels are defined,
> legacy channel are ignored. This involves that the board device trees
> using legacy bindings have to be changed to generic bindings.
> 
> Adopt generic iio bindings on STM32 boards implementing the ADC.
> 
> Changes in v2:
> - Add patch from https://lore.kernel.org/linux-arm-kernel/20230518020547.487670-1-marex@denx.de/T/

Thank you

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v2 0/9] ARM: dts: stm32: add adc internal channels on stm32mp15
  2023-05-30 12:45 ` Olivier Moysan
@ 2023-06-02 10:31   ` Alexandre TORGUE
  -1 siblings, 0 replies; 24+ messages in thread
From: Alexandre TORGUE @ 2023-06-02 10:31 UTC (permalink / raw)
  To: Olivier Moysan, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Maxime Coquelin, Marek Vasut
  Cc: devicetree, linux-stm32, linux-arm-kernel, linux-kernel, kernel

Hi Olivier

On 5/30/23 14:45, Olivier Moysan wrote:
> Add STM32 ADC2 internal channels VREFINT and VDDCORE to STM32MP15x SoCs.
> 
> Add support of vrefint channel by adding access to vrefint calibration
> data in OTP.
> 
> The internal channels are defined in STM32MP15 SoC DT according to
> generic channel bindings. The STM32 driver does not support a mixed use
> of legacy and generic channels. When generic channels are defined,
> legacy channel are ignored. This involves that the board device trees
> using legacy bindings have to be changed to generic bindings.
> 
> Adopt generic iio bindings on STM32 boards implementing the ADC.
> 
> Changes in v2:
> - Add patch from https://lore.kernel.org/linux-arm-kernel/20230518020547.487670-1-marex@denx.de/T/
> - Change node name from vrefin_cal to vrefin-cal
> 
> Marek Vasut (1):
>    ARM: dts: stm32: Update to generic ADC channel binding on DHSOM
>      systems
> 
> Olivier Moysan (8):
>    ARM: dts: stm32: add adc internal channels to stm32mp15
>    ARM: dts: stm32: add vrefint calibration on stm32mp15
>    ARM: dts: stm32: add vrefint support to adc2 on stm32mp15
>    ARM: dts: stm32: enable adc on stm32mp15xx-dkx boards
>    ARM: dts: stm32: adopt generic iio bindings for adc channels on
>      stm32mp157c-ed1
>    ARM: dts: stm32: adopt generic iio bindings for adc channels on
>      emstamp-argon
>    ARM: dts: stm32: adopt generic iio bindings for adc channels on
>      dhcor-drc
>    ARM: dts: stm32: adopt generic iio bindings for adc channels on
>      dhcor-testbench
> 
>   arch/arm/boot/dts/stm32mp151.dtsi             | 17 +++++++++
>   arch/arm/boot/dts/stm32mp157c-ed1.dts         | 16 ++++++--
>   .../boot/dts/stm32mp157c-emstamp-argon.dtsi   |  6 ++-
>   arch/arm/boot/dts/stm32mp15xx-dhcom-som.dtsi  | 18 +++++----
>   .../boot/dts/stm32mp15xx-dhcor-avenger96.dtsi | 38 +++++++++++++++----
>   .../dts/stm32mp15xx-dhcor-drc-compact.dtsi    | 28 ++++++++++++--
>   .../boot/dts/stm32mp15xx-dhcor-testbench.dtsi | 28 ++++++++++++--
>   arch/arm/boot/dts/stm32mp15xx-dkx.dtsi        | 29 +++++++++-----
>   8 files changed, 142 insertions(+), 38 deletions(-)
> 

Series applied on stm32-next.

Regards
Alex

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v2 0/9] ARM: dts: stm32: add adc internal channels on stm32mp15
@ 2023-06-02 10:31   ` Alexandre TORGUE
  0 siblings, 0 replies; 24+ messages in thread
From: Alexandre TORGUE @ 2023-06-02 10:31 UTC (permalink / raw)
  To: Olivier Moysan, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Maxime Coquelin, Marek Vasut
  Cc: devicetree, linux-stm32, linux-arm-kernel, linux-kernel, kernel

Hi Olivier

On 5/30/23 14:45, Olivier Moysan wrote:
> Add STM32 ADC2 internal channels VREFINT and VDDCORE to STM32MP15x SoCs.
> 
> Add support of vrefint channel by adding access to vrefint calibration
> data in OTP.
> 
> The internal channels are defined in STM32MP15 SoC DT according to
> generic channel bindings. The STM32 driver does not support a mixed use
> of legacy and generic channels. When generic channels are defined,
> legacy channel are ignored. This involves that the board device trees
> using legacy bindings have to be changed to generic bindings.
> 
> Adopt generic iio bindings on STM32 boards implementing the ADC.
> 
> Changes in v2:
> - Add patch from https://lore.kernel.org/linux-arm-kernel/20230518020547.487670-1-marex@denx.de/T/
> - Change node name from vrefin_cal to vrefin-cal
> 
> Marek Vasut (1):
>    ARM: dts: stm32: Update to generic ADC channel binding on DHSOM
>      systems
> 
> Olivier Moysan (8):
>    ARM: dts: stm32: add adc internal channels to stm32mp15
>    ARM: dts: stm32: add vrefint calibration on stm32mp15
>    ARM: dts: stm32: add vrefint support to adc2 on stm32mp15
>    ARM: dts: stm32: enable adc on stm32mp15xx-dkx boards
>    ARM: dts: stm32: adopt generic iio bindings for adc channels on
>      stm32mp157c-ed1
>    ARM: dts: stm32: adopt generic iio bindings for adc channels on
>      emstamp-argon
>    ARM: dts: stm32: adopt generic iio bindings for adc channels on
>      dhcor-drc
>    ARM: dts: stm32: adopt generic iio bindings for adc channels on
>      dhcor-testbench
> 
>   arch/arm/boot/dts/stm32mp151.dtsi             | 17 +++++++++
>   arch/arm/boot/dts/stm32mp157c-ed1.dts         | 16 ++++++--
>   .../boot/dts/stm32mp157c-emstamp-argon.dtsi   |  6 ++-
>   arch/arm/boot/dts/stm32mp15xx-dhcom-som.dtsi  | 18 +++++----
>   .../boot/dts/stm32mp15xx-dhcor-avenger96.dtsi | 38 +++++++++++++++----
>   .../dts/stm32mp15xx-dhcor-drc-compact.dtsi    | 28 ++++++++++++--
>   .../boot/dts/stm32mp15xx-dhcor-testbench.dtsi | 28 ++++++++++++--
>   arch/arm/boot/dts/stm32mp15xx-dkx.dtsi        | 29 +++++++++-----
>   8 files changed, 142 insertions(+), 38 deletions(-)
> 

Series applied on stm32-next.

Regards
Alex

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2023-06-02 10:35 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-30 12:45 [PATCH v2 0/9] ARM: dts: stm32: add adc internal channels on stm32mp15 Olivier Moysan
2023-05-30 12:45 ` Olivier Moysan
2023-05-30 12:45 ` [PATCH v2 1/9] ARM: dts: stm32: add adc internal channels to stm32mp15 Olivier Moysan
2023-05-30 12:45   ` Olivier Moysan
2023-05-30 12:45 ` [PATCH v2 2/9] ARM: dts: stm32: add vrefint calibration on stm32mp15 Olivier Moysan
2023-05-30 12:45   ` Olivier Moysan
2023-05-30 12:45 ` [PATCH v2 3/9] ARM: dts: stm32: add vrefint support to adc2 " Olivier Moysan
2023-05-30 12:45   ` Olivier Moysan
2023-05-30 12:45 ` [PATCH v2 4/9] ARM: dts: stm32: enable adc on stm32mp15xx-dkx boards Olivier Moysan
2023-05-30 12:45   ` Olivier Moysan
2023-05-30 12:45 ` [PATCH v2 5/9] ARM: dts: stm32: adopt generic iio bindings for adc channels on stm32mp157c-ed1 Olivier Moysan
2023-05-30 12:45   ` Olivier Moysan
2023-05-30 12:45 ` [PATCH v2 6/9] ARM: dts: stm32: adopt generic iio bindings for adc channels on emstamp-argon Olivier Moysan
2023-05-30 12:45   ` Olivier Moysan
2023-05-30 12:45 ` [PATCH v2 7/9] ARM: dts: stm32: adopt generic iio bindings for adc channels on dhcor-drc Olivier Moysan
2023-05-30 12:45   ` Olivier Moysan
2023-05-30 12:45 ` [PATCH v2 8/9] ARM: dts: stm32: adopt generic iio bindings for adc channels on dhcor-testbench Olivier Moysan
2023-05-30 12:45   ` Olivier Moysan
2023-05-30 12:45 ` [PATCH v2 9/9] ARM: dts: stm32: Update to generic ADC channel binding on DHSOM systems Olivier Moysan
2023-05-30 12:45   ` Olivier Moysan
2023-05-30 13:39 ` [PATCH v2 0/9] ARM: dts: stm32: add adc internal channels on stm32mp15 Marek Vasut
2023-05-30 13:39   ` Marek Vasut
2023-06-02 10:31 ` Alexandre TORGUE
2023-06-02 10:31   ` Alexandre TORGUE

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.