diff mbox series

[V5,04/10] dt-bindings: timestamp: Add nvidia,gpio-controller

Message ID 20230406171837.11206-5-dipenp@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: Dipen Patel
Headers show
Series Add Tegra234 HTE support | expand

Commit Message

Dipen Patel April 6, 2023, 5:18 p.m. UTC
The tegra always-on (AON) GPIO HTE/GTE provider depends on the AON
GPIO controller where it needs to do namespace conversion between GPIO
line number (belonging to AON GPIO controller instance) and the GTE
slice bits. The patch introduces nvidia,gpio-controller property to
represent that dependency.

Signed-off-by: Dipen Patel <dipenp@nvidia.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
---
 .../timestamp/nvidia,tegra194-hte.yaml        | 36 ++++++++++++++++---
 1 file changed, 31 insertions(+), 5 deletions(-)

Comments

Rob Herring (Arm) April 12, 2023, 2:29 p.m. UTC | #1
On Thu, Apr 06, 2023 at 10:18:31AM -0700, Dipen Patel wrote:
> The tegra always-on (AON) GPIO HTE/GTE provider depends on the AON
> GPIO controller where it needs to do namespace conversion between GPIO
> line number (belonging to AON GPIO controller instance) and the GTE
> slice bits. The patch introduces nvidia,gpio-controller property to
> represent that dependency.
> 
> Signed-off-by: Dipen Patel <dipenp@nvidia.com>
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  .../timestamp/nvidia,tegra194-hte.yaml        | 36 ++++++++++++++++---
>  1 file changed, 31 insertions(+), 5 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/timestamp/nvidia,tegra194-hte.yaml b/Documentation/devicetree/bindings/timestamp/nvidia,tegra194-hte.yaml
> index 855dad3f2023..66eaa3fab8cc 100644
> --- a/Documentation/devicetree/bindings/timestamp/nvidia,tegra194-hte.yaml
> +++ b/Documentation/devicetree/bindings/timestamp/nvidia,tegra194-hte.yaml
> @@ -51,6 +51,12 @@ properties:
>        LIC instance has 11 slices and Tegra234 LIC has 17 slices.
>      enum: [3, 11, 17]
>  
> +  nvidia,gpio-controller:
> +    $ref: /schemas/types.yaml#/definitions/phandle
> +    description:
> +      The phandle to AON gpio controller instance. This is required to handle
> +      namespace conversion between GPIO and GTE.
> +
>    '#timestamp-cells':
>      description:
>        This represents number of line id arguments as specified by the
> @@ -59,6 +65,12 @@ properties:
>        mentioned in the nvidia GPIO device tree binding document.
>      const: 1
>  
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - "#timestamp-cells"
> +
>  allOf:
>    - if:
>        properties:
> @@ -94,11 +106,15 @@ allOf:
>          nvidia,slices:
>            const: 17
>  
> -required:
> -  - compatible
> -  - reg
> -  - interrupts
> -  - "#timestamp-cells"
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - nvidia,tegra234-gte-aon
> +    then:
> +      required:
> +        - nvidia,gpio-controller

Adding a new required property is an ABI break. But you just added this 
in patch 2. If this is required as part of nvidia,tegra234-gte-aon 
support, then it should all be 1 patch.

>  
>  additionalProperties: false
>  
> @@ -112,6 +128,16 @@ examples:
>                #timestamp-cells = <1>;
>      };
>  
> +  - |
> +    tegra234_hte_aon: timestamp@c1e0000 {
> +              compatible = "nvidia,tegra234-gte-aon";
> +              reg = <0xc1e0000 0x10000>;
> +              interrupts = <0 13 0x4>;
> +              nvidia,int-threshold = <1>;
> +              nvidia,gpio-controller = <&gpio_aon>;
> +              #timestamp-cells = <1>;
> +    };
> +

Really need a whole other example for 1 property?

>    - |
>      tegra_hte_lic: timestamp@3aa0000 {
>                compatible = "nvidia,tegra194-gte-lic";
> -- 
> 2.17.1
>
Dipen Patel April 12, 2023, 5:10 p.m. UTC | #2
On 4/12/23 7:29 AM, Rob Herring wrote:
> On Thu, Apr 06, 2023 at 10:18:31AM -0700, Dipen Patel wrote:
>> The tegra always-on (AON) GPIO HTE/GTE provider depends on the AON
>> GPIO controller where it needs to do namespace conversion between GPIO
>> line number (belonging to AON GPIO controller instance) and the GTE
>> slice bits. The patch introduces nvidia,gpio-controller property to
>> represent that dependency.
>>
>> Signed-off-by: Dipen Patel <dipenp@nvidia.com>
>> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
>> ---
>>  .../timestamp/nvidia,tegra194-hte.yaml        | 36 ++++++++++++++++---
>>  1 file changed, 31 insertions(+), 5 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/timestamp/nvidia,tegra194-hte.yaml b/Documentation/devicetree/bindings/timestamp/nvidia,tegra194-hte.yaml
>> index 855dad3f2023..66eaa3fab8cc 100644
>> --- a/Documentation/devicetree/bindings/timestamp/nvidia,tegra194-hte.yaml
>> +++ b/Documentation/devicetree/bindings/timestamp/nvidia,tegra194-hte.yaml
>> @@ -51,6 +51,12 @@ properties:
>>        LIC instance has 11 slices and Tegra234 LIC has 17 slices.
>>      enum: [3, 11, 17]
>>  
>> +  nvidia,gpio-controller:
>> +    $ref: /schemas/types.yaml#/definitions/phandle
>> +    description:
>> +      The phandle to AON gpio controller instance. This is required to handle
>> +      namespace conversion between GPIO and GTE.
>> +
>>    '#timestamp-cells':
>>      description:
>>        This represents number of line id arguments as specified by the
>> @@ -59,6 +65,12 @@ properties:
>>        mentioned in the nvidia GPIO device tree binding document.
>>      const: 1
>>  
>> +required:
>> +  - compatible
>> +  - reg
>> +  - interrupts
>> +  - "#timestamp-cells"
>> +
>>  allOf:
>>    - if:
>>        properties:
>> @@ -94,11 +106,15 @@ allOf:
>>          nvidia,slices:
>>            const: 17
>>  
>> -required:
>> -  - compatible
>> -  - reg
>> -  - interrupts
>> -  - "#timestamp-cells"
>> +  - if:
>> +      properties:
>> +        compatible:
>> +          contains:
>> +            enum:
>> +              - nvidia,tegra234-gte-aon
>> +    then:
>> +      required:
>> +        - nvidia,gpio-controller
> 
> Adding a new required property is an ABI break. But you just added this 
> in patch 2. If this is required as part of nvidia,tegra234-gte-aon 
> support, then it should all be 1 patch.
Ok, will move this to one patch. For the ABI break, I have added appropriate
code in the concerned driver to continue to be backward compatible.

> 
>>  
>>  additionalProperties: false
>>  
>> @@ -112,6 +128,16 @@ examples:
>>                #timestamp-cells = <1>;
>>      };
>>  
>> +  - |
>> +    tegra234_hte_aon: timestamp@c1e0000 {
>> +              compatible = "nvidia,tegra234-gte-aon";
>> +              reg = <0xc1e0000 0x10000>;
>> +              interrupts = <0 13 0x4>;
>> +              nvidia,int-threshold = <1>;
>> +              nvidia,gpio-controller = <&gpio_aon>;
>> +              #timestamp-cells = <1>;
>> +    };
>> +
> 
> Really need a whole other example for 1 property?
The property affects Tegra234 Soc and beyond, This example is provided
to showcase that and it also implies that old SoC Tegra194 is not affected
by this new property. Havind said, that I have not issue removing this example. 

> 
>>    - |
>>      tegra_hte_lic: timestamp@3aa0000 {
>>                compatible = "nvidia,tegra194-gte-lic";
>> -- 
>> 2.17.1
>>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/timestamp/nvidia,tegra194-hte.yaml b/Documentation/devicetree/bindings/timestamp/nvidia,tegra194-hte.yaml
index 855dad3f2023..66eaa3fab8cc 100644
--- a/Documentation/devicetree/bindings/timestamp/nvidia,tegra194-hte.yaml
+++ b/Documentation/devicetree/bindings/timestamp/nvidia,tegra194-hte.yaml
@@ -51,6 +51,12 @@  properties:
       LIC instance has 11 slices and Tegra234 LIC has 17 slices.
     enum: [3, 11, 17]
 
+  nvidia,gpio-controller:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description:
+      The phandle to AON gpio controller instance. This is required to handle
+      namespace conversion between GPIO and GTE.
+
   '#timestamp-cells':
     description:
       This represents number of line id arguments as specified by the
@@ -59,6 +65,12 @@  properties:
       mentioned in the nvidia GPIO device tree binding document.
     const: 1
 
+required:
+  - compatible
+  - reg
+  - interrupts
+  - "#timestamp-cells"
+
 allOf:
   - if:
       properties:
@@ -94,11 +106,15 @@  allOf:
         nvidia,slices:
           const: 17
 
-required:
-  - compatible
-  - reg
-  - interrupts
-  - "#timestamp-cells"
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - nvidia,tegra234-gte-aon
+    then:
+      required:
+        - nvidia,gpio-controller
 
 additionalProperties: false
 
@@ -112,6 +128,16 @@  examples:
               #timestamp-cells = <1>;
     };
 
+  - |
+    tegra234_hte_aon: timestamp@c1e0000 {
+              compatible = "nvidia,tegra234-gte-aon";
+              reg = <0xc1e0000 0x10000>;
+              interrupts = <0 13 0x4>;
+              nvidia,int-threshold = <1>;
+              nvidia,gpio-controller = <&gpio_aon>;
+              #timestamp-cells = <1>;
+    };
+
   - |
     tegra_hte_lic: timestamp@3aa0000 {
               compatible = "nvidia,tegra194-gte-lic";