diff mbox series

ARM: dts: qcom-pma8084: fix vadc channel node names

Message ID 20220925202143.123208-1-luca@z3ntu.xyz (mailing list archive)
State Superseded
Headers show
Series ARM: dts: qcom-pma8084: fix vadc channel node names | expand

Commit Message

Luca Weiss Sept. 25, 2022, 8:21 p.m. UTC
Node names for the channel are supposed to be adc-chan@REG.

Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
 arch/arm/boot/dts/qcom-pma8084.dtsi | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

Comments

Neil Armstrong Sept. 26, 2022, 8:27 a.m. UTC | #1
On 25/09/2022 22:21, Luca Weiss wrote:
> Node names for the channel are supposed to be adc-chan@REG.
> 
> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> ---
>   arch/arm/boot/dts/qcom-pma8084.dtsi | 17 +++++++++++------
>   1 file changed, 11 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/qcom-pma8084.dtsi b/arch/arm/boot/dts/qcom-pma8084.dtsi
> index e77602e9f95c..7ad573c7b4ac 100644
> --- a/arch/arm/boot/dts/qcom-pma8084.dtsi
> +++ b/arch/arm/boot/dts/qcom-pma8084.dtsi
> @@ -64,22 +64,27 @@ pma8084_vadc: adc@3100 {
>   			#size-cells = <0>;
>   			#io-channel-cells = <1>;
>   
> -			die_temp {
> +			adc-chan@8 {
>   				reg = <VADC_DIE_TEMP>;
>   			};
> -			ref_625mv {
> +
> +			adc-chan@9 {
>   				reg = <VADC_REF_625MV>;
>   			};
> -			ref_1250v {
> +
> +			adc-chan@10 {
>   				reg = <VADC_REF_1250MV>;
>   			};
> -			ref_buf_625mv {
> +
> +			adc-chan@12 {
>   				reg = <VADC_SPARE1>;
>   			};
> -			ref_gnd {
> +
> +			adc-chan@14 {
>   				reg = <VADC_GND_REF>;
>   			};
> -			ref_vdd {
> +
> +			adc-chan@15 {
>   				reg = <VADC_VDD_VADC>;
>   			};
>   		};

I don't see where this is required, bindings doesn't mandate this naming:

patternProperties:

    "^.*@[0-9a-f]+$":
Neil
Luca Weiss Sept. 26, 2022, 2:57 p.m. UTC | #2
Hi Neil,

On Montag, 26. September 2022 10:27:54 CEST Neil Armstrong wrote:
> On 25/09/2022 22:21, Luca Weiss wrote:
> > Node names for the channel are supposed to be adc-chan@REG.
> > 
> > Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> > ---
> > 
> >   arch/arm/boot/dts/qcom-pma8084.dtsi | 17 +++++++++++------
> >   1 file changed, 11 insertions(+), 6 deletions(-)
> > 
> > diff --git a/arch/arm/boot/dts/qcom-pma8084.dtsi
> > b/arch/arm/boot/dts/qcom-pma8084.dtsi index e77602e9f95c..7ad573c7b4ac
> > 100644
> > --- a/arch/arm/boot/dts/qcom-pma8084.dtsi
> > +++ b/arch/arm/boot/dts/qcom-pma8084.dtsi
> > @@ -64,22 +64,27 @@ pma8084_vadc: adc@3100 {
> > 
> >   			#size-cells = <0>;
> >   			#io-channel-cells = <1>;
> > 
> > -			die_temp {
> > +			adc-chan@8 {
> > 
> >   				reg = <VADC_DIE_TEMP>;
> >   			
> >   			};
> > 
> > -			ref_625mv {
> > +
> > +			adc-chan@9 {
> > 
> >   				reg = <VADC_REF_625MV>;
> >   			
> >   			};
> > 
> > -			ref_1250v {
> > +
> > +			adc-chan@10 {
> > 
> >   				reg = <VADC_REF_1250MV>;
> >   			
> >   			};
> > 
> > -			ref_buf_625mv {
> > +
> > +			adc-chan@12 {
> > 
> >   				reg = <VADC_SPARE1>;
> >   			
> >   			};
> > 
> > -			ref_gnd {
> > +
> > +			adc-chan@14 {
> > 
> >   				reg = <VADC_GND_REF>;
> >   			
> >   			};
> > 
> > -			ref_vdd {
> > +
> > +			adc-chan@15 {
> > 
> >   				reg = <VADC_VDD_VADC>;
> >   			
> >   			};
> >   		
> >   		};
> 
> I don't see where this is required, bindings doesn't mandate this naming:
> 
> patternProperties:
> 
>     "^.*@[0-9a-f]+$":

They don't require the "adc-chan" part (although dt nodes are supposed to have 
common names and adc-chan is used for adc for that; and dt node names are not 
supposed to have underscores), but this validation error happens without this 
commit:

<snip>/arch/arm/boot/dts/qcom-apq8084-ifc6540.dtb: pma8084@0: adc@3100: 
'oneOf' conditional failed, one must be fixed:
        '#address-cells', '#size-cells', 'die_temp', 'ref_1250v', 'ref_625mv', 
'ref_buf_625mv', 'ref_gnd', 'ref_vdd' do not match any of the regexes: 
'pinctrl-[0-9]+'
        'die_temp', 'ref_1250v', 'ref_625mv', 'ref_buf_625mv', 'ref_gnd', 
'ref_vdd' do not match any of the regexes: '^.*@[0-9a-f]+$', 'pinctrl-[0-9]+'
        'qcom,spmi-iadc' was expected
        From schema: <snip>/Documentation/devicetree/bindings/mfd/qcom,spmi-
pmic.yaml

So while e.g. ref-vdd@15 would also work, adc-chan@15 is more correct.

Regards
Luca


> Neil
Krzysztof Kozlowski Sept. 26, 2022, 3:32 p.m. UTC | #3
On 26/09/2022 16:57, Luca Weiss wrote:
> Hi Neil,
> 
> On Montag, 26. September 2022 10:27:54 CEST Neil Armstrong wrote:
>> On 25/09/2022 22:21, Luca Weiss wrote:
>>> Node names for the channel are supposed to be adc-chan@REG.
>>>
>>> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
>>> ---
>>>
>>>   arch/arm/boot/dts/qcom-pma8084.dtsi | 17 +++++++++++------
>>>   1 file changed, 11 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/arch/arm/boot/dts/qcom-pma8084.dtsi
>>> b/arch/arm/boot/dts/qcom-pma8084.dtsi index e77602e9f95c..7ad573c7b4ac
>>> 100644
>>> --- a/arch/arm/boot/dts/qcom-pma8084.dtsi
>>> +++ b/arch/arm/boot/dts/qcom-pma8084.dtsi
>>> @@ -64,22 +64,27 @@ pma8084_vadc: adc@3100 {
>>>
>>>   			#size-cells = <0>;
>>>   			#io-channel-cells = <1>;
>>>
>>> -			die_temp {
>>> +			adc-chan@8 {
>>>
>>>   				reg = <VADC_DIE_TEMP>;
>>>   			
>>>   			};
>>>
>>> -			ref_625mv {
>>> +
>>> +			adc-chan@9 {
>>>
>>>   				reg = <VADC_REF_625MV>;
>>>   			
>>>   			};
>>>
>>> -			ref_1250v {
>>> +
>>> +			adc-chan@10 {
>>>
>>>   				reg = <VADC_REF_1250MV>;
>>>   			
>>>   			};
>>>
>>> -			ref_buf_625mv {
>>> +
>>> +			adc-chan@12 {
>>>
>>>   				reg = <VADC_SPARE1>;
>>>   			
>>>   			};
>>>
>>> -			ref_gnd {
>>> +
>>> +			adc-chan@14 {
>>>
>>>   				reg = <VADC_GND_REF>;
>>>   			
>>>   			};
>>>
>>> -			ref_vdd {
>>> +
>>> +			adc-chan@15 {
>>>
>>>   				reg = <VADC_VDD_VADC>;
>>>   			
>>>   			};
>>>   		
>>>   		};
>>
>> I don't see where this is required, bindings doesn't mandate this naming:
>>
>> patternProperties:
>>
>>     "^.*@[0-9a-f]+$":
> 
> They don't require the "adc-chan" part (although dt nodes are supposed to have 
> common names and adc-chan is used for adc for that; and dt node names are not 
> supposed to have underscores), but this validation error happens without this 
> commit:
> 
> <snip>/arch/arm/boot/dts/qcom-apq8084-ifc6540.dtb: pma8084@0: adc@3100: 
> 'oneOf' conditional failed, one must be fixed:
>         '#address-cells', '#size-cells', 'die_temp', 'ref_1250v', 'ref_625mv', 
> 'ref_buf_625mv', 'ref_gnd', 'ref_vdd' do not match any of the regexes: 
> 'pinctrl-[0-9]+'
>         'die_temp', 'ref_1250v', 'ref_625mv', 'ref_buf_625mv', 'ref_gnd', 
> 'ref_vdd' do not match any of the regexes: '^.*@[0-9a-f]+$', 'pinctrl-[0-9]+'
>         'qcom,spmi-iadc' was expected
>         From schema: <snip>/Documentation/devicetree/bindings/mfd/qcom,spmi-
> pmic.yaml
> 
> So while e.g. ref-vdd@15 would also work, adc-chan@15 is more correct.

The commit msg is not precise here. What the nodes are missing is unit
address (required by VADC bindings) and replace of underscore (coding
style). I think bindings do not require the adc-chan and we could apply
here rule from DT spec that node name should reflect it's
purpose/function, so die-temp@xxxx could be fine. Other places use
already adc-chan, so consistency could be an argument. But anyway commit
msg is not really describing why you are doing this.

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/arch/arm/boot/dts/qcom-pma8084.dtsi b/arch/arm/boot/dts/qcom-pma8084.dtsi
index e77602e9f95c..7ad573c7b4ac 100644
--- a/arch/arm/boot/dts/qcom-pma8084.dtsi
+++ b/arch/arm/boot/dts/qcom-pma8084.dtsi
@@ -64,22 +64,27 @@  pma8084_vadc: adc@3100 {
 			#size-cells = <0>;
 			#io-channel-cells = <1>;
 
-			die_temp {
+			adc-chan@8 {
 				reg = <VADC_DIE_TEMP>;
 			};
-			ref_625mv {
+
+			adc-chan@9 {
 				reg = <VADC_REF_625MV>;
 			};
-			ref_1250v {
+
+			adc-chan@10 {
 				reg = <VADC_REF_1250MV>;
 			};
-			ref_buf_625mv {
+
+			adc-chan@12 {
 				reg = <VADC_SPARE1>;
 			};
-			ref_gnd {
+
+			adc-chan@14 {
 				reg = <VADC_GND_REF>;
 			};
-			ref_vdd {
+
+			adc-chan@15 {
 				reg = <VADC_VDD_VADC>;
 			};
 		};