diff mbox series

[v5,1/5] dt-bindings: pinctrl: modify gpio-cells property

Message ID 20241112-a4_pinctrl-v5-1-3460ce10c480@amlogic.com (mailing list archive)
State New
Headers show
Series Pinctrl: A4: Add pinctrl driver | expand

Commit Message

Xianwei Zhao via B4 Relay Nov. 12, 2024, 10:26 a.m. UTC
From: Xianwei Zhao <xianwei.zhao@amlogic.com>

Extend the value range of #gpio-cells property, including [2, 3],
to compatible with Amlogic A4 SoC and later chips's pinctrl module.
The early GPIO parameter number is 2, and the later GPIO parameter
number is 3.

Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
---
 .../devicetree/bindings/pinctrl/amlogic,meson-pinctrl-common.yaml       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Neil Armstrong Nov. 12, 2024, 1:26 p.m. UTC | #1
Hi,

On 12/11/2024 11:26, Xianwei Zhao via B4 Relay wrote:
> From: Xianwei Zhao <xianwei.zhao@amlogic.com>
> 
> Extend the value range of #gpio-cells property, including [2, 3],
> to compatible with Amlogic A4 SoC and later chips's pinctrl module.
> The early GPIO parameter number is 2, and the later GPIO parameter
> number is 3.
> 
> Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
> ---
>   .../devicetree/bindings/pinctrl/amlogic,meson-pinctrl-common.yaml       | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-common.yaml b/Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-common.yaml
> index e707c222a07f..6b53577dea59 100644
> --- a/Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-common.yaml
> +++ b/Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-common.yaml
> @@ -36,7 +36,7 @@ $defs:
>         gpio-controller: true
>   
>         "#gpio-cells":
> -        const: 2
> +        enum: [2, 3]
>   
>         gpio-ranges:
>           maxItems: 1
> 

This is not what I expected, this allows 3 cells for all Amlogic pinctrl,
which is wrong.

Instead, remove "#gpio-cells" definition from amlogic,meson-pinctrl-common.yaml
and add them in all amlogic,meson-pinctrl-XXX.yaml with const: 2, and then when you
introduce A4/A5, add a new amlogic,meson-pinctrl-a5.yaml with const: 3.

Neil
Xianwei Zhao Nov. 13, 2024, 2:23 a.m. UTC | #2
Hi Neil,
    Thanks for your advice.

On 2024/11/12 21:26, Neil Armstrong wrote:
> [ EXTERNAL EMAIL ]
> 
> Hi,
> 
> On 12/11/2024 11:26, Xianwei Zhao via B4 Relay wrote:
>> From: Xianwei Zhao <xianwei.zhao@amlogic.com>
>>
>> Extend the value range of #gpio-cells property, including [2, 3],
>> to compatible with Amlogic A4 SoC and later chips's pinctrl module.
>> The early GPIO parameter number is 2, and the later GPIO parameter
>> number is 3.
>>
>> Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
>> ---
>>   
>> .../devicetree/bindings/pinctrl/amlogic,meson-pinctrl-common.yaml       | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git 
>> a/Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-common.yaml b/Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-common.yaml
>> index e707c222a07f..6b53577dea59 100644
>> --- 
>> a/Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-common.yaml
>> +++ 
>> b/Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-common.yaml
>> @@ -36,7 +36,7 @@ $defs:
>>         gpio-controller: true
>>
>>         "#gpio-cells":
>> -        const: 2
>> +        enum: [2, 3]
>>
>>         gpio-ranges:
>>           maxItems: 1
>>
> 
> This is not what I expected, this allows 3 cells for all Amlogic pinctrl,
> which is wrong.
> 
> Instead, remove "#gpio-cells" definition from 
> amlogic,meson-pinctrl-common.yaml
> and add them in all amlogic,meson-pinctrl-XXX.yaml with const: 2, and 
> then when you
> introduce A4/A5, add a new amlogic,meson-pinctrl-a5.yaml with const: 3.
> 
Got it. Will do.
> Neil
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-common.yaml b/Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-common.yaml
index e707c222a07f..6b53577dea59 100644
--- a/Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-common.yaml
+++ b/Documentation/devicetree/bindings/pinctrl/amlogic,meson-pinctrl-common.yaml
@@ -36,7 +36,7 @@  $defs:
       gpio-controller: true
 
       "#gpio-cells":
-        const: 2
+        enum: [2, 3]
 
       gpio-ranges:
         maxItems: 1