diff mbox series

[7/8] ARM: dts: stm32: adopt generic iio bindings for adc channels on dhcor-drc

Message ID 20230524133918.1439516-8-olivier.moysan@foss.st.com (mailing list archive)
State New, archived
Headers show
Series ARM: dts: stm32: add adc internal channels on stm32mp15 | expand

Commit Message

Olivier Moysan May 24, 2023, 1:39 p.m. UTC
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(-)

Comments

Marek Vasut May 24, 2023, 1:54 p.m. UTC | #1
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>;
> +		};
>   	};

[...]
Olivier Moysan May 24, 2023, 3:39 p.m. UTC | #2
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>;
>> +        };
>>       };
> 
> [...]
Alexandre TORGUE May 30, 2023, 7:59 a.m. UTC | #3
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>;
>>> +        };
>>>       };
>>
>> [...]
Marek Vasut May 30, 2023, 11:42 a.m. UTC | #4
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.
diff mbox series

Patch

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>;
+		};
 	};
 };