* [PATCH 0/8] ARM: dts: stm32: add adc internal channels on stm32mp15
@ 2023-05-24 13:39 Olivier Moysan
2023-05-24 13:39 ` [PATCH 1/8] ARM: dts: stm32: add adc internal channels to stm32mp15 Olivier Moysan
` (7 more replies)
0 siblings, 8 replies; 13+ messages in thread
From: Olivier Moysan @ 2023-05-24 13:39 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 all STM32 boards implementing the ADC.
This serie does not update stm32mp15xx-dhcom-som and
stm32mp15xx-dhcor-avenger96 DTs. These DTs have to be updated also, but
this change is already handled through the following patch:
https://lore.kernel.org/linux-arm-kernel/20230518020547.487670-1-marex@denx.de/T/
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 ++--
.../dts/stm32mp15xx-dhcor-drc-compact.dtsi | 28 +++++++++++++++---
.../boot/dts/stm32mp15xx-dhcor-testbench.dtsi | 28 +++++++++++++++---
arch/arm/boot/dts/stm32mp15xx-dkx.dtsi | 29 +++++++++++++------
6 files changed, 102 insertions(+), 22 deletions(-)
--
2.25.1
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 1/8] ARM: dts: stm32: add adc internal channels to stm32mp15
2023-05-24 13:39 [PATCH 0/8] ARM: dts: stm32: add adc internal channels on stm32mp15 Olivier Moysan
@ 2023-05-24 13:39 ` Olivier Moysan
2023-05-24 13:39 ` [PATCH 2/8] ARM: dts: stm32: add vrefint calibration on stm32mp15 Olivier Moysan
` (6 subsequent siblings)
7 siblings, 0 replies; 13+ messages in thread
From: Olivier Moysan @ 2023-05-24 13:39 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 a98ae58e2c1c..9c40b5e679f8 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 [flat|nested] 13+ messages in thread
* [PATCH 2/8] ARM: dts: stm32: add vrefint calibration on stm32mp15
2023-05-24 13:39 [PATCH 0/8] ARM: dts: stm32: add adc internal channels on stm32mp15 Olivier Moysan
2023-05-24 13:39 ` [PATCH 1/8] ARM: dts: stm32: add adc internal channels to stm32mp15 Olivier Moysan
@ 2023-05-24 13:39 ` Olivier Moysan
2023-05-24 13:39 ` [PATCH 3/8] ARM: dts: stm32: add vrefint support to adc2 " Olivier Moysan
` (5 subsequent siblings)
7 siblings, 0 replies; 13+ messages in thread
From: Olivier Moysan @ 2023-05-24 13:39 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 9c40b5e679f8..40d3959964cf 100644
--- a/arch/arm/boot/dts/stm32mp151.dtsi
+++ b/arch/arm/boot/dts/stm32mp151.dtsi
@@ -1635,6 +1635,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 [flat|nested] 13+ messages in thread
* [PATCH 3/8] ARM: dts: stm32: add vrefint support to adc2 on stm32mp15
2023-05-24 13:39 [PATCH 0/8] ARM: dts: stm32: add adc internal channels on stm32mp15 Olivier Moysan
2023-05-24 13:39 ` [PATCH 1/8] ARM: dts: stm32: add adc internal channels to stm32mp15 Olivier Moysan
2023-05-24 13:39 ` [PATCH 2/8] ARM: dts: stm32: add vrefint calibration on stm32mp15 Olivier Moysan
@ 2023-05-24 13:39 ` Olivier Moysan
2023-05-24 13:39 ` [PATCH 4/8] ARM: dts: stm32: enable adc on stm32mp15xx-dkx boards Olivier Moysan
` (4 subsequent siblings)
7 siblings, 0 replies; 13+ messages in thread
From: Olivier Moysan @ 2023-05-24 13:39 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 40d3959964cf..5bb5dfabb747 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 [flat|nested] 13+ messages in thread
* [PATCH 4/8] ARM: dts: stm32: enable adc on stm32mp15xx-dkx boards
2023-05-24 13:39 [PATCH 0/8] ARM: dts: stm32: add adc internal channels on stm32mp15 Olivier Moysan
` (2 preceding siblings ...)
2023-05-24 13:39 ` [PATCH 3/8] ARM: dts: stm32: add vrefint support to adc2 " Olivier Moysan
@ 2023-05-24 13:39 ` Olivier Moysan
2023-05-24 13:39 ` [PATCH 5/8] ARM: dts: stm32: adopt generic iio bindings for adc channels on stm32mp157c-ed1 Olivier Moysan
` (3 subsequent siblings)
7 siblings, 0 replies; 13+ messages in thread
From: Olivier Moysan @ 2023-05-24 13:39 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 0f1110e42c93..ad46f1b1e1ed 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 [flat|nested] 13+ messages in thread
* [PATCH 5/8] ARM: dts: stm32: adopt generic iio bindings for adc channels on stm32mp157c-ed1
2023-05-24 13:39 [PATCH 0/8] ARM: dts: stm32: add adc internal channels on stm32mp15 Olivier Moysan
` (3 preceding siblings ...)
2023-05-24 13:39 ` [PATCH 4/8] ARM: dts: stm32: enable adc on stm32mp15xx-dkx boards Olivier Moysan
@ 2023-05-24 13:39 ` Olivier Moysan
2023-05-24 13:39 ` [PATCH 6/8] ARM: dts: stm32: adopt generic iio bindings for adc channels on emstamp-argon Olivier Moysan
` (2 subsequent siblings)
7 siblings, 0 replies; 13+ messages in thread
From: Olivier Moysan @ 2023-05-24 13:39 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 [flat|nested] 13+ messages in thread
* [PATCH 6/8] ARM: dts: stm32: adopt generic iio bindings for adc channels on emstamp-argon
2023-05-24 13:39 [PATCH 0/8] ARM: dts: stm32: add adc internal channels on stm32mp15 Olivier Moysan
` (4 preceding siblings ...)
2023-05-24 13:39 ` [PATCH 5/8] ARM: dts: stm32: adopt generic iio bindings for adc channels on stm32mp157c-ed1 Olivier Moysan
@ 2023-05-24 13:39 ` Olivier Moysan
2023-05-24 13:39 ` [PATCH 7/8] ARM: dts: stm32: adopt generic iio bindings for adc channels on dhcor-drc Olivier Moysan
2023-05-24 13:39 ` [PATCH 8/8] ARM: dts: stm32: adopt generic iio bindings for adc channels on dhcor-testbench Olivier Moysan
7 siblings, 0 replies; 13+ messages in thread
From: Olivier Moysan @ 2023-05-24 13:39 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 [flat|nested] 13+ messages in thread
* [PATCH 7/8] ARM: dts: stm32: adopt generic iio bindings for adc channels on dhcor-drc
2023-05-24 13:39 [PATCH 0/8] ARM: dts: stm32: add adc internal channels on stm32mp15 Olivier Moysan
` (5 preceding siblings ...)
2023-05-24 13:39 ` [PATCH 6/8] ARM: dts: stm32: adopt generic iio bindings for adc channels on emstamp-argon Olivier Moysan
@ 2023-05-24 13:39 ` Olivier Moysan
2023-05-24 13:54 ` Marek Vasut
2023-05-24 13:39 ` [PATCH 8/8] ARM: dts: stm32: adopt generic iio bindings for adc channels on dhcor-testbench Olivier Moysan
7 siblings, 1 reply; 13+ messages in thread
From: Olivier Moysan @ 2023-05-24 13:39 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 [flat|nested] 13+ messages in thread
* [PATCH 8/8] ARM: dts: stm32: adopt generic iio bindings for adc channels on dhcor-testbench
2023-05-24 13:39 [PATCH 0/8] ARM: dts: stm32: add adc internal channels on stm32mp15 Olivier Moysan
` (6 preceding siblings ...)
2023-05-24 13:39 ` [PATCH 7/8] ARM: dts: stm32: adopt generic iio bindings for adc channels on dhcor-drc Olivier Moysan
@ 2023-05-24 13:39 ` Olivier Moysan
7 siblings, 0 replies; 13+ messages in thread
From: Olivier Moysan @ 2023-05-24 13:39 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 [flat|nested] 13+ messages in thread
* Re: [PATCH 7/8] ARM: dts: stm32: adopt generic iio bindings for adc channels on dhcor-drc
2023-05-24 13:39 ` [PATCH 7/8] ARM: dts: stm32: adopt generic iio bindings for adc channels on dhcor-drc Olivier Moysan
@ 2023-05-24 13:54 ` Marek Vasut
2023-05-24 15:39 ` Olivier MOYSAN
0 siblings, 1 reply; 13+ messages in thread
From: Marek Vasut @ 2023-05-24 13:54 UTC (permalink / raw)
To: Olivier Moysan, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Maxime Coquelin, Alexandre Torgue
Cc: kernel, devicetree, linux-stm32, linux-arm-kernel, linux-kernel
On 5/24/23 15:39, Olivier Moysan wrote:
> 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 {
I sent similar patch recently too:
[PATCH] ARM: dts: stm32: Update to generic ADC channel binding on DHSOM
systems
But I needed to add #address-cells/#size-cells here and to adc@100,
otherwise DTB checker was complaining . Did you run DTB check and was it
OK on your side ?
> - 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>;
> + };
> };
[...]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 7/8] ARM: dts: stm32: adopt generic iio bindings for adc channels on dhcor-drc
2023-05-24 13:54 ` Marek Vasut
@ 2023-05-24 15:39 ` Olivier MOYSAN
2023-05-30 7:59 ` Alexandre TORGUE
0 siblings, 1 reply; 13+ messages in thread
From: Olivier MOYSAN @ 2023-05-24 15:39 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
Hi Marek,
On 5/24/23 15:54, Marek Vasut wrote:
> On 5/24/23 15:39, Olivier Moysan wrote:
>> 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 {
>
>
> I sent similar patch recently too:
>
> [PATCH] ARM: dts: stm32: Update to generic ADC channel binding on DHSOM
> systems
>
> But I needed to add #address-cells/#size-cells here and to adc@100,
> otherwise DTB checker was complaining . Did you run DTB check and was it
> OK on your side ?
The first patch in this serie adds the #address-cells/#size-cells to the
SoC DT. So, there is no need to add them later in the board DT.
I can send a v2 with your patch (after removing the cells properties
from the patch). Having all the patches in the same serie, will help
avoiding sequencing problems.
Do you agree with this ?
BRs
Olivier
>
>> - 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>;
>> + };
>> };
>
> [...]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 7/8] ARM: dts: stm32: adopt generic iio bindings for adc channels on dhcor-drc
2023-05-24 15:39 ` Olivier MOYSAN
@ 2023-05-30 7:59 ` Alexandre TORGUE
2023-05-30 11:42 ` Marek Vasut
0 siblings, 1 reply; 13+ messages in thread
From: Alexandre TORGUE @ 2023-05-30 7:59 UTC (permalink / raw)
To: Olivier MOYSAN, Marek Vasut, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Maxime Coquelin
Cc: kernel, devicetree, linux-stm32, linux-arm-kernel, linux-kernel
Marek, Olivier
On 5/24/23 17:39, Olivier MOYSAN wrote:
> Hi Marek,
>
> On 5/24/23 15:54, Marek Vasut wrote:
>> On 5/24/23 15:39, Olivier Moysan wrote:
>>> 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 {
>>
>>
>> I sent similar patch recently too:
>>
>> [PATCH] ARM: dts: stm32: Update to generic ADC channel binding on
>> DHSOM systems
>>
>> But I needed to add #address-cells/#size-cells here and to adc@100,
>> otherwise DTB checker was complaining . Did you run DTB check and was
>> it OK on your side ?
>
> The first patch in this serie adds the #address-cells/#size-cells to the
> SoC DT. So, there is no need to add them later in the board DT.
>
> I can send a v2 with your patch (after removing the cells properties
> from the patch). Having all the patches in the same serie, will help
> avoiding sequencing problems.
>
> Do you agree with this ?
What is the status of this patch ?
Marek, I would prefer to take all ADC updates in this series if you agree.
Alex
>
> BRs
> Olivier
>
>>
>>> - 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>;
>>> + };
>>> };
>>
>> [...]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 7/8] ARM: dts: stm32: adopt generic iio bindings for adc channels on dhcor-drc
2023-05-30 7:59 ` Alexandre TORGUE
@ 2023-05-30 11:42 ` Marek Vasut
0 siblings, 0 replies; 13+ messages in thread
From: Marek Vasut @ 2023-05-30 11:42 UTC (permalink / raw)
To: Alexandre TORGUE, Olivier MOYSAN, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin
Cc: kernel, devicetree, linux-stm32, linux-arm-kernel, linux-kernel
On 5/30/23 09:59, Alexandre TORGUE wrote:
> Marek, Olivier
>
> On 5/24/23 17:39, Olivier MOYSAN wrote:
>> Hi Marek,
>>
>> On 5/24/23 15:54, Marek Vasut wrote:
>>> On 5/24/23 15:39, Olivier Moysan wrote:
>>>> 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 {
>>>
>>>
>>> I sent similar patch recently too:
>>>
>>> [PATCH] ARM: dts: stm32: Update to generic ADC channel binding on
>>> DHSOM systems
>>>
>>> But I needed to add #address-cells/#size-cells here and to adc@100,
>>> otherwise DTB checker was complaining . Did you run DTB check and was
>>> it OK on your side ?
>>
>> The first patch in this serie adds the #address-cells/#size-cells to
>> the SoC DT. So, there is no need to add them later in the board DT.
>>
>> I can send a v2 with your patch (after removing the cells properties
>> from the patch). Having all the patches in the same serie, will help
>> avoiding sequencing problems.
>>
>> Do you agree with this ?
>
> What is the status of this patch ?
>
> Marek, I would prefer to take all ADC updates in this series if you agree.
I missed the reply from Olivier, sorry. Please pick the whole thing.
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2023-05-30 11:44 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-24 13:39 [PATCH 0/8] ARM: dts: stm32: add adc internal channels on stm32mp15 Olivier Moysan
2023-05-24 13:39 ` [PATCH 1/8] ARM: dts: stm32: add adc internal channels to stm32mp15 Olivier Moysan
2023-05-24 13:39 ` [PATCH 2/8] ARM: dts: stm32: add vrefint calibration on stm32mp15 Olivier Moysan
2023-05-24 13:39 ` [PATCH 3/8] ARM: dts: stm32: add vrefint support to adc2 " Olivier Moysan
2023-05-24 13:39 ` [PATCH 4/8] ARM: dts: stm32: enable adc on stm32mp15xx-dkx boards Olivier Moysan
2023-05-24 13:39 ` [PATCH 5/8] ARM: dts: stm32: adopt generic iio bindings for adc channels on stm32mp157c-ed1 Olivier Moysan
2023-05-24 13:39 ` [PATCH 6/8] ARM: dts: stm32: adopt generic iio bindings for adc channels on emstamp-argon Olivier Moysan
2023-05-24 13:39 ` [PATCH 7/8] ARM: dts: stm32: adopt generic iio bindings for adc channels on dhcor-drc Olivier Moysan
2023-05-24 13:54 ` Marek Vasut
2023-05-24 15:39 ` Olivier MOYSAN
2023-05-30 7:59 ` Alexandre TORGUE
2023-05-30 11:42 ` Marek Vasut
2023-05-24 13:39 ` [PATCH 8/8] ARM: dts: stm32: adopt generic iio bindings for adc channels on dhcor-testbench Olivier Moysan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®