All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/10] ARM: dts: stm32: add adc internal channels on stm32mp15
@ 2023-01-12 10:44 ` Olivier Moysan
  0 siblings, 0 replies; 26+ messages in thread
From: Olivier Moysan @ 2023-01-12 10:44 UTC (permalink / raw
  To: Rob Herring, Krzysztof Kozlowski, 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 all STM32 boards implementing the ADC.

Olivier Moysan (10):
  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
    avenger96
  ARM: dts: stm32: adopt generic iio bindings for adc channels on
    emstamp-argon
  ARM: dts: stm32: adopt generic iio bindings for adc channels on dhcom
  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  | 12 +++++---
 .../boot/dts/stm32mp15xx-dhcor-avenger96.dtsi | 28 +++++++++++++++---
 .../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, 134 insertions(+), 30 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] 26+ messages in thread

* [PATCH 00/10] ARM: dts: stm32: add adc internal channels on stm32mp15
@ 2023-01-12 10:44 ` Olivier Moysan
  0 siblings, 0 replies; 26+ messages in thread
From: Olivier Moysan @ 2023-01-12 10:44 UTC (permalink / raw
  To: Rob Herring, Krzysztof Kozlowski, 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 all STM32 boards implementing the ADC.

Olivier Moysan (10):
  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
    avenger96
  ARM: dts: stm32: adopt generic iio bindings for adc channels on
    emstamp-argon
  ARM: dts: stm32: adopt generic iio bindings for adc channels on dhcom
  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  | 12 +++++---
 .../boot/dts/stm32mp15xx-dhcor-avenger96.dtsi | 28 +++++++++++++++---
 .../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, 134 insertions(+), 30 deletions(-)

-- 
2.25.1


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

* [PATCH 01/10] ARM: dts: stm32: add adc internal channels to stm32mp15
  2023-01-12 10:44 ` Olivier Moysan
@ 2023-01-12 10:44   ` Olivier Moysan
  -1 siblings, 0 replies; 26+ messages in thread
From: Olivier Moysan @ 2023-01-12 10:44 UTC (permalink / raw
  To: Rob Herring, Krzysztof Kozlowski, 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 4e437d3f2ed6..dea1c53f2b1d 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] 26+ messages in thread

* [PATCH 01/10] ARM: dts: stm32: add adc internal channels to stm32mp15
@ 2023-01-12 10:44   ` Olivier Moysan
  0 siblings, 0 replies; 26+ messages in thread
From: Olivier Moysan @ 2023-01-12 10:44 UTC (permalink / raw
  To: Rob Herring, Krzysztof Kozlowski, 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 4e437d3f2ed6..dea1c53f2b1d 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] 26+ messages in thread

* [PATCH 02/10] ARM: dts: stm32: add vrefint calibration on stm32mp15
  2023-01-12 10:44 ` Olivier Moysan
@ 2023-01-12 10:44   ` Olivier Moysan
  -1 siblings, 0 replies; 26+ messages in thread
From: Olivier Moysan @ 2023-01-12 10:44 UTC (permalink / raw
  To: Rob Herring, Krzysztof Kozlowski, 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 dea1c53f2b1d..eec5e9992bff 100644
--- a/arch/arm/boot/dts/stm32mp151.dtsi
+++ b/arch/arm/boot/dts/stm32mp151.dtsi
@@ -1632,6 +1632,9 @@ bsec: efuse@5c005000 {
 			reg = <0x5c005000 0x400>;
 			#address-cells = <1>;
 			#size-cells = <1>;
+			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] 26+ messages in thread

* [PATCH 02/10] ARM: dts: stm32: add vrefint calibration on stm32mp15
@ 2023-01-12 10:44   ` Olivier Moysan
  0 siblings, 0 replies; 26+ messages in thread
From: Olivier Moysan @ 2023-01-12 10:44 UTC (permalink / raw
  To: Rob Herring, Krzysztof Kozlowski, 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 dea1c53f2b1d..eec5e9992bff 100644
--- a/arch/arm/boot/dts/stm32mp151.dtsi
+++ b/arch/arm/boot/dts/stm32mp151.dtsi
@@ -1632,6 +1632,9 @@ bsec: efuse@5c005000 {
 			reg = <0x5c005000 0x400>;
 			#address-cells = <1>;
 			#size-cells = <1>;
+			vrefint: vrefin_cal@52 {
+				reg = <0x52 0x2>;
+			};
 			ts_cal1: calib@5c {
 				reg = <0x5c 0x2>;
 			};
-- 
2.25.1


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

* [PATCH 03/10] ARM: dts: stm32: add vrefint support to adc2 on stm32mp15
  2023-01-12 10:44 ` Olivier Moysan
@ 2023-01-12 10:44   ` Olivier Moysan
  -1 siblings, 0 replies; 26+ messages in thread
From: Olivier Moysan @ 2023-01-12 10:44 UTC (permalink / raw
  To: Rob Herring, Krzysztof Kozlowski, 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 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(+)

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>;
-- 
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] 26+ messages in thread

* [PATCH 03/10] ARM: dts: stm32: add vrefint support to adc2 on stm32mp15
@ 2023-01-12 10:44   ` Olivier Moysan
  0 siblings, 0 replies; 26+ messages in thread
From: Olivier Moysan @ 2023-01-12 10:44 UTC (permalink / raw
  To: Rob Herring, Krzysztof Kozlowski, 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 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(+)

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>;
-- 
2.25.1


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

* [PATCH 04/10] ARM: dts: stm32: enable adc on stm32mp15xx-dkx boards
  2023-01-12 10:44 ` Olivier Moysan
@ 2023-01-12 10:44   ` Olivier Moysan
  -1 siblings, 0 replies; 26+ messages in thread
From: Olivier Moysan @ 2023-01-12 10:44 UTC (permalink / raw
  To: Rob Herring, Krzysztof Kozlowski, 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 11370ae0d868..6f88e9b1af90 100644
--- a/arch/arm/boot/dts/stm32mp15xx-dkx.dtsi
+++ b/arch/arm/boot/dts/stm32mp15xx-dkx.dtsi
@@ -92,28 +92,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] 26+ messages in thread

* [PATCH 04/10] ARM: dts: stm32: enable adc on stm32mp15xx-dkx boards
@ 2023-01-12 10:44   ` Olivier Moysan
  0 siblings, 0 replies; 26+ messages in thread
From: Olivier Moysan @ 2023-01-12 10:44 UTC (permalink / raw
  To: Rob Herring, Krzysztof Kozlowski, 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 11370ae0d868..6f88e9b1af90 100644
--- a/arch/arm/boot/dts/stm32mp15xx-dkx.dtsi
+++ b/arch/arm/boot/dts/stm32mp15xx-dkx.dtsi
@@ -92,28 +92,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] 26+ messages in thread

* [PATCH 05/10] ARM: dts: stm32: adopt generic iio bindings for adc channels on stm32mp157c-ed1
  2023-01-12 10:44 ` Olivier Moysan
@ 2023-01-12 10:44   ` Olivier Moysan
  -1 siblings, 0 replies; 26+ messages in thread
From: Olivier Moysan @ 2023-01-12 10:44 UTC (permalink / raw
  To: Rob Herring, Krzysztof Kozlowski, 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 b1eb688a278a..4e218aaaaf9b 100644
--- a/arch/arm/boot/dts/stm32mp157c-ed1.dts
+++ b/arch/arm/boot/dts/stm32mp157c-ed1.dts
@@ -108,10 +108,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] 26+ messages in thread

* [PATCH 05/10] ARM: dts: stm32: adopt generic iio bindings for adc channels on stm32mp157c-ed1
@ 2023-01-12 10:44   ` Olivier Moysan
  0 siblings, 0 replies; 26+ messages in thread
From: Olivier Moysan @ 2023-01-12 10:44 UTC (permalink / raw
  To: Rob Herring, Krzysztof Kozlowski, 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 b1eb688a278a..4e218aaaaf9b 100644
--- a/arch/arm/boot/dts/stm32mp157c-ed1.dts
+++ b/arch/arm/boot/dts/stm32mp157c-ed1.dts
@@ -108,10 +108,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] 26+ messages in thread

* [PATCH 06/10] ARM: dts: stm32: adopt generic iio bindings for adc channels on avenger96
  2023-01-12 10:44 ` Olivier Moysan
@ 2023-01-12 10:44   ` Olivier Moysan
  -1 siblings, 0 replies; 26+ messages in thread
From: Olivier Moysan @ 2023-01-12 10:44 UTC (permalink / raw
  To: Marek Vasut, Rob Herring, Krzysztof Kozlowski, 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
Avenger96 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-avenger96.dtsi | 28 ++++++++++++++++---
 1 file changed, 24 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/stm32mp15xx-dhcor-avenger96.dtsi b/arch/arm/boot/dts/stm32mp15xx-dhcor-avenger96.dtsi
index 50af4a27d6be..62efb550ae64 100644
--- a/arch/arm/boot/dts/stm32mp15xx-dhcor-avenger96.dtsi
+++ b/arch/arm/boot/dts/stm32mp15xx-dhcor-avenger96.dtsi
@@ -113,15 +113,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] 26+ messages in thread

* [PATCH 06/10] ARM: dts: stm32: adopt generic iio bindings for adc channels on avenger96
@ 2023-01-12 10:44   ` Olivier Moysan
  0 siblings, 0 replies; 26+ messages in thread
From: Olivier Moysan @ 2023-01-12 10:44 UTC (permalink / raw
  To: Marek Vasut, Rob Herring, Krzysztof Kozlowski, 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
Avenger96 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-avenger96.dtsi | 28 ++++++++++++++++---
 1 file changed, 24 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/stm32mp15xx-dhcor-avenger96.dtsi b/arch/arm/boot/dts/stm32mp15xx-dhcor-avenger96.dtsi
index 50af4a27d6be..62efb550ae64 100644
--- a/arch/arm/boot/dts/stm32mp15xx-dhcor-avenger96.dtsi
+++ b/arch/arm/boot/dts/stm32mp15xx-dhcor-avenger96.dtsi
@@ -113,15 +113,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] 26+ messages in thread

* [PATCH 07/10] ARM: dts: stm32: adopt generic iio bindings for adc channels on emstamp-argon
  2023-01-12 10:44 ` Olivier Moysan
@ 2023-01-12 10:44   ` Olivier Moysan
  -1 siblings, 0 replies; 26+ messages in thread
From: Olivier Moysan @ 2023-01-12 10:44 UTC (permalink / raw
  To: Rob Herring, Krzysztof Kozlowski, 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 7d11c50b9e40..8b1f1ebd13f9 100644
--- a/arch/arm/boot/dts/stm32mp157c-emstamp-argon.dtsi
+++ b/arch/arm/boot/dts/stm32mp157c-emstamp-argon.dtsi
@@ -102,9 +102,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] 26+ messages in thread

* [PATCH 07/10] ARM: dts: stm32: adopt generic iio bindings for adc channels on emstamp-argon
@ 2023-01-12 10:44   ` Olivier Moysan
  0 siblings, 0 replies; 26+ messages in thread
From: Olivier Moysan @ 2023-01-12 10:44 UTC (permalink / raw
  To: Rob Herring, Krzysztof Kozlowski, 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 7d11c50b9e40..8b1f1ebd13f9 100644
--- a/arch/arm/boot/dts/stm32mp157c-emstamp-argon.dtsi
+++ b/arch/arm/boot/dts/stm32mp157c-emstamp-argon.dtsi
@@ -102,9 +102,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] 26+ messages in thread

* [PATCH 08/10] ARM: dts: stm32: adopt generic iio bindings for adc channels on dhcom
  2023-01-12 10:44 ` Olivier Moysan
@ 2023-01-12 10:44   ` Olivier Moysan
  -1 siblings, 0 replies; 26+ messages in thread
From: Olivier Moysan @ 2023-01-12 10:44 UTC (permalink / raw
  To: Marek Vasut, Rob Herring, Krzysztof Kozlowski, 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
DHCOM 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/stm32mp15xx-dhcom-som.dtsi | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/stm32mp15xx-dhcom-som.dtsi b/arch/arm/boot/dts/stm32mp15xx-dhcom-som.dtsi
index c06edd2eacb0..343ceaf8cd96 100644
--- a/arch/arm/boot/dts/stm32mp15xx-dhcom-som.dtsi
+++ b/arch/arm/boot/dts/stm32mp15xx-dhcom-som.dtsi
@@ -82,15 +82,19 @@ &adc {
 	status = "okay";
 
 	adc1: adc@0 {
-		st,min-sample-time-nsecs = <5000>;
-		st,adc-channels = <0>;
 		status = "okay";
+		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";
+		channel@1 {
+			reg = <1>;
+			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] 26+ messages in thread

* [PATCH 08/10] ARM: dts: stm32: adopt generic iio bindings for adc channels on dhcom
@ 2023-01-12 10:44   ` Olivier Moysan
  0 siblings, 0 replies; 26+ messages in thread
From: Olivier Moysan @ 2023-01-12 10:44 UTC (permalink / raw
  To: Marek Vasut, Rob Herring, Krzysztof Kozlowski, 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
DHCOM 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/stm32mp15xx-dhcom-som.dtsi | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/stm32mp15xx-dhcom-som.dtsi b/arch/arm/boot/dts/stm32mp15xx-dhcom-som.dtsi
index c06edd2eacb0..343ceaf8cd96 100644
--- a/arch/arm/boot/dts/stm32mp15xx-dhcom-som.dtsi
+++ b/arch/arm/boot/dts/stm32mp15xx-dhcom-som.dtsi
@@ -82,15 +82,19 @@ &adc {
 	status = "okay";
 
 	adc1: adc@0 {
-		st,min-sample-time-nsecs = <5000>;
-		st,adc-channels = <0>;
 		status = "okay";
+		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";
+		channel@1 {
+			reg = <1>;
+			st,min-sample-time-ns = <5000>;
+		};
 	};
 };
 
-- 
2.25.1


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

* [PATCH 09/10] ARM: dts: stm32: adopt generic iio bindings for adc channels on dhcor-drc
  2023-01-12 10:44 ` Olivier Moysan
@ 2023-01-12 10:44   ` Olivier Moysan
  -1 siblings, 0 replies; 26+ messages in thread
From: Olivier Moysan @ 2023-01-12 10:44 UTC (permalink / raw
  To: Marek Vasut, Rob Herring, Krzysztof Kozlowski, 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 c32c160f97f2..12c85926b901 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] 26+ messages in thread

* [PATCH 09/10] ARM: dts: stm32: adopt generic iio bindings for adc channels on dhcor-drc
@ 2023-01-12 10:44   ` Olivier Moysan
  0 siblings, 0 replies; 26+ messages in thread
From: Olivier Moysan @ 2023-01-12 10:44 UTC (permalink / raw
  To: Marek Vasut, Rob Herring, Krzysztof Kozlowski, 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 c32c160f97f2..12c85926b901 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] 26+ messages in thread

* [PATCH 10/10] ARM: dts: stm32: adopt generic iio bindings for adc channels on dhcor-testbench
  2023-01-12 10:44 ` Olivier Moysan
@ 2023-01-12 10:44   ` Olivier Moysan
  -1 siblings, 0 replies; 26+ messages in thread
From: Olivier Moysan @ 2023-01-12 10:44 UTC (permalink / raw
  To: Marek Vasut, Rob Herring, Krzysztof Kozlowski, 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 5fdb74b652ac..487779a44156 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] 26+ messages in thread

* [PATCH 10/10] ARM: dts: stm32: adopt generic iio bindings for adc channels on dhcor-testbench
@ 2023-01-12 10:44   ` Olivier Moysan
  0 siblings, 0 replies; 26+ messages in thread
From: Olivier Moysan @ 2023-01-12 10:44 UTC (permalink / raw
  To: Marek Vasut, Rob Herring, Krzysztof Kozlowski, 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 5fdb74b652ac..487779a44156 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] 26+ messages in thread

* Re: [PATCH 02/10] ARM: dts: stm32: add vrefint calibration on stm32mp15
  2023-01-12 10:44   ` Olivier Moysan
@ 2023-01-12 11:46     ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 26+ messages in thread
From: Krzysztof Kozlowski @ 2023-01-12 11:46 UTC (permalink / raw
  To: Olivier Moysan, Rob Herring, Krzysztof Kozlowski, Maxime Coquelin,
	Alexandre Torgue
  Cc: devicetree, linux-stm32, linux-arm-kernel, linux-kernel

On 12/01/2023 11:44, Olivier Moysan wrote:
> 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 dea1c53f2b1d..eec5e9992bff 100644
> --- a/arch/arm/boot/dts/stm32mp151.dtsi
> +++ b/arch/arm/boot/dts/stm32mp151.dtsi
> @@ -1632,6 +1632,9 @@ bsec: efuse@5c005000 {
>  			reg = <0x5c005000 0x400>;
>  			#address-cells = <1>;
>  			#size-cells = <1>;
> +			vrefint: vrefin_cal@52 {

No underscores in node names.


Best regards,
Krzysztof


_______________________________________________
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] 26+ messages in thread

* Re: [PATCH 02/10] ARM: dts: stm32: add vrefint calibration on stm32mp15
@ 2023-01-12 11:46     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 26+ messages in thread
From: Krzysztof Kozlowski @ 2023-01-12 11:46 UTC (permalink / raw
  To: Olivier Moysan, Rob Herring, Krzysztof Kozlowski, Maxime Coquelin,
	Alexandre Torgue
  Cc: devicetree, linux-stm32, linux-arm-kernel, linux-kernel

On 12/01/2023 11:44, Olivier Moysan wrote:
> 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 dea1c53f2b1d..eec5e9992bff 100644
> --- a/arch/arm/boot/dts/stm32mp151.dtsi
> +++ b/arch/arm/boot/dts/stm32mp151.dtsi
> @@ -1632,6 +1632,9 @@ bsec: efuse@5c005000 {
>  			reg = <0x5c005000 0x400>;
>  			#address-cells = <1>;
>  			#size-cells = <1>;
> +			vrefint: vrefin_cal@52 {

No underscores in node names.


Best regards,
Krzysztof


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

* Re: [PATCH 06/10] ARM: dts: stm32: adopt generic iio bindings for adc channels on avenger96
  2023-01-12 10:44   ` Olivier Moysan
@ 2023-01-12 14:28     ` Marek Vasut
  -1 siblings, 0 replies; 26+ messages in thread
From: Marek Vasut @ 2023-01-12 14:28 UTC (permalink / raw
  To: Olivier Moysan, Rob Herring, Krzysztof Kozlowski, Maxime Coquelin,
	Alexandre Torgue
  Cc: kernel, devicetree, linux-stm32, linux-arm-kernel, linux-kernel

On 1/12/23 11:44, Olivier Moysan wrote:
> Use STM32 ADC generic bindings instead of legacy bindings on
> Avenger96 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-avenger96.dtsi | 28 ++++++++++++++++---
>   1 file changed, 24 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/stm32mp15xx-dhcor-avenger96.dtsi b/arch/arm/boot/dts/stm32mp15xx-dhcor-avenger96.dtsi
> index 50af4a27d6be..62efb550ae64 100644
> --- a/arch/arm/boot/dts/stm32mp15xx-dhcor-avenger96.dtsi
> +++ b/arch/arm/boot/dts/stm32mp15xx-dhcor-avenger96.dtsi
> @@ -113,15 +113,35 @@ &adc {
>   	status = "okay";
>   
>   	adc1: adc@0 {
> -		st,adc-channels = <0 1 6>;
> -		st,min-sample-time-nsecs = <5000>;

U-Boot drivers/adc/stm32-adc.c depends on these properties , so if you 
drop them here and U-Boot DTs gets synced with Linux, the ADC driver 
there will start failing. Can you update the U-Boot ADC driver too ?

Maybe the easiest way would be to retain the old properties for now with 
a comment, and add the new properties ?

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

* Re: [PATCH 06/10] ARM: dts: stm32: adopt generic iio bindings for adc channels on avenger96
@ 2023-01-12 14:28     ` Marek Vasut
  0 siblings, 0 replies; 26+ messages in thread
From: Marek Vasut @ 2023-01-12 14:28 UTC (permalink / raw
  To: Olivier Moysan, Rob Herring, Krzysztof Kozlowski, Maxime Coquelin,
	Alexandre Torgue
  Cc: kernel, devicetree, linux-stm32, linux-arm-kernel, linux-kernel

On 1/12/23 11:44, Olivier Moysan wrote:
> Use STM32 ADC generic bindings instead of legacy bindings on
> Avenger96 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-avenger96.dtsi | 28 ++++++++++++++++---
>   1 file changed, 24 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/stm32mp15xx-dhcor-avenger96.dtsi b/arch/arm/boot/dts/stm32mp15xx-dhcor-avenger96.dtsi
> index 50af4a27d6be..62efb550ae64 100644
> --- a/arch/arm/boot/dts/stm32mp15xx-dhcor-avenger96.dtsi
> +++ b/arch/arm/boot/dts/stm32mp15xx-dhcor-avenger96.dtsi
> @@ -113,15 +113,35 @@ &adc {
>   	status = "okay";
>   
>   	adc1: adc@0 {
> -		st,adc-channels = <0 1 6>;
> -		st,min-sample-time-nsecs = <5000>;

U-Boot drivers/adc/stm32-adc.c depends on these properties , so if you 
drop them here and U-Boot DTs gets synced with Linux, the ADC driver 
there will start failing. Can you update the U-Boot ADC driver too ?

Maybe the easiest way would be to retain the old properties for now with 
a comment, and add the new properties ?

_______________________________________________
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] 26+ messages in thread

end of thread, other threads:[~2023-01-12 16:30 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-12 10:44 [PATCH 00/10] ARM: dts: stm32: add adc internal channels on stm32mp15 Olivier Moysan
2023-01-12 10:44 ` Olivier Moysan
2023-01-12 10:44 ` [PATCH 01/10] ARM: dts: stm32: add adc internal channels to stm32mp15 Olivier Moysan
2023-01-12 10:44   ` Olivier Moysan
2023-01-12 10:44 ` [PATCH 02/10] ARM: dts: stm32: add vrefint calibration on stm32mp15 Olivier Moysan
2023-01-12 10:44   ` Olivier Moysan
2023-01-12 11:46   ` Krzysztof Kozlowski
2023-01-12 11:46     ` Krzysztof Kozlowski
2023-01-12 10:44 ` [PATCH 03/10] ARM: dts: stm32: add vrefint support to adc2 " Olivier Moysan
2023-01-12 10:44   ` Olivier Moysan
2023-01-12 10:44 ` [PATCH 04/10] ARM: dts: stm32: enable adc on stm32mp15xx-dkx boards Olivier Moysan
2023-01-12 10:44   ` Olivier Moysan
2023-01-12 10:44 ` [PATCH 05/10] ARM: dts: stm32: adopt generic iio bindings for adc channels on stm32mp157c-ed1 Olivier Moysan
2023-01-12 10:44   ` Olivier Moysan
2023-01-12 10:44 ` [PATCH 06/10] ARM: dts: stm32: adopt generic iio bindings for adc channels on avenger96 Olivier Moysan
2023-01-12 10:44   ` Olivier Moysan
2023-01-12 14:28   ` Marek Vasut
2023-01-12 14:28     ` Marek Vasut
2023-01-12 10:44 ` [PATCH 07/10] ARM: dts: stm32: adopt generic iio bindings for adc channels on emstamp-argon Olivier Moysan
2023-01-12 10:44   ` Olivier Moysan
2023-01-12 10:44 ` [PATCH 08/10] ARM: dts: stm32: adopt generic iio bindings for adc channels on dhcom Olivier Moysan
2023-01-12 10:44   ` Olivier Moysan
2023-01-12 10:44 ` [PATCH 09/10] ARM: dts: stm32: adopt generic iio bindings for adc channels on dhcor-drc Olivier Moysan
2023-01-12 10:44   ` Olivier Moysan
2023-01-12 10:44 ` [PATCH 10/10] ARM: dts: stm32: adopt generic iio bindings for adc channels on dhcor-testbench Olivier Moysan
2023-01-12 10:44   ` Olivier Moysan

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.