[PATCH 1/2] dt-bindings: pinctrl: samsung: google,gs101-pinctrl needs a clock

André Draszik posted 2 patches 1 year, 7 months ago
There is a newer version of this series
[PATCH 1/2] dt-bindings: pinctrl: samsung: google,gs101-pinctrl needs a clock
Posted by André Draszik 1 year, 7 months ago
The pin controller on Google Tensor gs101 requires a bus clock for
register access to work. Add it.

Signed-off-by: André Draszik <andre.draszik@linaro.org>

---
As we only have the one clock here, please let me know if the
clock-names should be removed. Having it does make
/sys/kernel/debug/clk/clk_summary look nicer / more meaningful though
:-)
---
 .../devicetree/bindings/pinctrl/samsung,pinctrl.yaml    | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/Documentation/devicetree/bindings/pinctrl/samsung,pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/samsung,pinctrl.yaml
index 118549c25976..49cc36b76fd0 100644
--- a/Documentation/devicetree/bindings/pinctrl/samsung,pinctrl.yaml
+++ b/Documentation/devicetree/bindings/pinctrl/samsung,pinctrl.yaml
@@ -73,6 +73,13 @@ properties:
     minItems: 1
     maxItems: 2
 
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    items:
+      - const: pclk
+
   wakeup-interrupt-controller:
     $ref: samsung,pinctrl-wakeup-interrupt.yaml
 
@@ -120,6 +127,16 @@ required:
 
 allOf:
   - $ref: pinctrl.yaml#
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: google,gs101-pinctrl
+    then:
+      required:
+        - clocks
+        - clock-names
+
   - if:
       properties:
         compatible:

-- 
2.44.0.769.g3c40516874-goog

Re: [PATCH 1/2] dt-bindings: pinctrl: samsung: google,gs101-pinctrl needs a clock
Posted by Krzysztof Kozlowski 1 year, 7 months ago
On 25/04/2024 18:03, André Draszik wrote:
> The pin controller on Google Tensor gs101 requires a bus clock for
> register access to work. Add it.
> 
> Signed-off-by: André Draszik <andre.draszik@linaro.org>
> 
> ---
> As we only have the one clock here, please let me know if the
> clock-names should be removed. Having it does make
> /sys/kernel/debug/clk/clk_summary look nicer / more meaningful though
> :-)
> ---
>  .../devicetree/bindings/pinctrl/samsung,pinctrl.yaml    | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/pinctrl/samsung,pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/samsung,pinctrl.yaml
> index 118549c25976..49cc36b76fd0 100644
> --- a/Documentation/devicetree/bindings/pinctrl/samsung,pinctrl.yaml
> +++ b/Documentation/devicetree/bindings/pinctrl/samsung,pinctrl.yaml
> @@ -73,6 +73,13 @@ properties:
>      minItems: 1
>      maxItems: 2
>  
> +  clocks:
> +    maxItems: 1
> +
> +  clock-names:
> +    items:
> +      - const: pclk
> +
>    wakeup-interrupt-controller:
>      $ref: samsung,pinctrl-wakeup-interrupt.yaml
>  
> @@ -120,6 +127,16 @@ required:
>  
>  allOf:
>    - $ref: pinctrl.yaml#
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: google,gs101-pinctrl
> +    then:
> +      required:
> +        - clocks
> +        - clock-names

else:
  properties:
    clocks: false
    clock-names: false

but anyway this is all a bit fragile, because pinctrl is not a driver
and you rely on initcall ordering.

> 

Best regards,
Krzysztof

Re: [PATCH 1/2] dt-bindings: pinctrl: samsung: google,gs101-pinctrl needs a clock
Posted by Krzysztof Kozlowski 1 year, 7 months ago
On 25/04/2024 20:15, Krzysztof Kozlowski wrote:
>> +      properties:
>> +        compatible:
>> +          contains:
>> +            const: google,gs101-pinctrl
>> +    then:
>> +      required:
>> +        - clocks
>> +        - clock-names
> 
> else:
>   properties:
>     clocks: false
>     clock-names: false
> 
> but anyway this is all a bit fragile, because pinctrl is not a driver
> and you rely on initcall ordering.

It is a driver, although initcall ordering is still there. Anyway, it's
the first soc requiring clock for pinctrl

Best regards,
Krzysztof
Re: [PATCH 1/2] dt-bindings: pinctrl: samsung: google,gs101-pinctrl needs a clock
Posted by André Draszik 1 year, 7 months ago
On Thu, 2024-04-25 at 20:18 +0200, Krzysztof Kozlowski wrote:
> On 25/04/2024 20:15, Krzysztof Kozlowski wrote:
> > > +      properties:
> > > +        compatible:
> > > +          contains:
> > > +            const: google,gs101-pinctrl
> > > +    then:
> > > +      required:
> > > +        - clocks
> > > +        - clock-names
> > 
> > else:
> >   properties:
> >     clocks: false
> >     clock-names: false
> > 
> > but anyway this is all a bit fragile, because pinctrl is not a driver
> > and you rely on initcall ordering.
> 
> It is a driver, although initcall ordering is still there. Anyway, it's
> the first soc requiring clock for pinctrl

If I see it right, E850 has similar gates, and like on gs101 they're currently
also all marked as CLK_IGNORE_UNUSED in the e850 clock driver with a comment that
a driver update is needed. I've added Sam.

Cheers,
Andre'
Re: [PATCH 1/2] dt-bindings: pinctrl: samsung: google,gs101-pinctrl needs a clock
Posted by Krzysztof Kozlowski 1 year, 7 months ago
On 26/04/2024 12:54, André Draszik wrote:
> On Thu, 2024-04-25 at 20:18 +0200, Krzysztof Kozlowski wrote:
>> On 25/04/2024 20:15, Krzysztof Kozlowski wrote:
>>>> +      properties:
>>>> +        compatible:
>>>> +          contains:
>>>> +            const: google,gs101-pinctrl
>>>> +    then:
>>>> +      required:
>>>> +        - clocks
>>>> +        - clock-names
>>>
>>> else:
>>>   properties:
>>>     clocks: false
>>>     clock-names: false
>>>
>>> but anyway this is all a bit fragile, because pinctrl is not a driver
>>> and you rely on initcall ordering.
>>
>> It is a driver, although initcall ordering is still there. Anyway, it's
>> the first soc requiring clock for pinctrl
> 
> If I see it right, E850 has similar gates, and like on gs101 they're currently
> also all marked as CLK_IGNORE_UNUSED in the e850 clock driver with a comment that
> a driver update is needed. I've added Sam.

Cool, so this should solve also Sam's problem. Sam, can you test the
patchset in spare time?

Best regards,
Krzysztof