[1/3] dt-bindings: watchdog: mt7621-wdt: add phandle to access system controller registers

Message ID 20230210065621.598120-2-sergio.paracuellos@gmail.com
State New
Headers
Series watchdog: mt7621-wdt: avoid globals and arch dependencies |

Commit Message

Sergio Paracuellos Feb. 10, 2023, 6:56 a.m. UTC
  MT7621 SoC provides a system controller node for accessing to some registers.
Add a phandle to this node to avoid using MIPS related arch operations and
includes in watchdog driver code.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 .../bindings/watchdog/mediatek,mt7621-wdt.yaml       | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
  

Comments

Krzysztof Kozlowski Feb. 10, 2023, 10:59 a.m. UTC | #1
On 10/02/2023 07:56, Sergio Paracuellos wrote:
> MT7621 SoC provides a system controller node for accessing to some registers.
> Add a phandle to this node to avoid using MIPS related arch operations and

I don't understand this part. You claim you add a phandle to this node,
but your binding suggest you add here a phandle to other node.

> includes in watchdog driver code.
> 
> Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
> ---
>  .../bindings/watchdog/mediatek,mt7621-wdt.yaml       | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml b/Documentation/devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml
> index b2b17fdf4..3c545065f 100644
> --- a/Documentation/devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml
> +++ b/Documentation/devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml
> @@ -14,11 +14,18 @@ allOf:
>  
>  properties:
>    compatible:
> -    const: mediatek,mt7621-wdt
> +    items:
> +      - const: mediatek,mt7621-wdt
> +      - const: syscon
>  
>    reg:
>      maxItems: 1
>  
> +  ralink,sysctl:
> +    $ref: /schemas/types.yaml#/definitions/phandle
> +    description:
> +      phandle of syscon used to control system registers

This needs to be more specific - which syscon? It also does not fit your
commit msg.


Best regards,
Krzysztof
  
Sergio Paracuellos Feb. 10, 2023, 11:22 a.m. UTC | #2
Hi Krzysztof,

On Fri, Feb 10, 2023 at 11:59 AM Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:
>
> On 10/02/2023 07:56, Sergio Paracuellos wrote:
> > MT7621 SoC provides a system controller node for accessing to some registers.
> > Add a phandle to this node to avoid using MIPS related arch operations and
>
> I don't understand this part. You claim you add a phandle to this node,
> but your binding suggest you add here a phandle to other node.

Probably my English is not the best here :-). Yes, you are right, I
just want to add a phandle to the 'sysc' node in the current node.

>
> > includes in watchdog driver code.
> >
> > Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
> > ---
> >  .../bindings/watchdog/mediatek,mt7621-wdt.yaml       | 12 ++++++++++--
> >  1 file changed, 10 insertions(+), 2 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml b/Documentation/devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml
> > index b2b17fdf4..3c545065f 100644
> > --- a/Documentation/devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml
> > +++ b/Documentation/devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml
> > @@ -14,11 +14,18 @@ allOf:
> >
> >  properties:
> >    compatible:
> > -    const: mediatek,mt7621-wdt
> > +    items:
> > +      - const: mediatek,mt7621-wdt
> > +      - const: syscon
> >
> >    reg:
> >      maxItems: 1
> >
> > +  ralink,sysctl:
> > +    $ref: /schemas/types.yaml#/definitions/phandle
> > +    description:
> > +      phandle of syscon used to control system registers
>
> This needs to be more specific - which syscon? It also does not fit your
> commit msg.

Sure. How about "phandle to system controller 'sysc' syscon node which
controls system registers".

>
>
> Best regards,
> Krzysztof
>

Thanks,
    Sergio Paracuellos
  
Krzysztof Kozlowski Feb. 10, 2023, 11:27 a.m. UTC | #3
On 10/02/2023 12:22, Sergio Paracuellos wrote:
> Hi Krzysztof,
> 
> On Fri, Feb 10, 2023 at 11:59 AM Krzysztof Kozlowski
> <krzysztof.kozlowski@linaro.org> wrote:
>>
>> On 10/02/2023 07:56, Sergio Paracuellos wrote:
>>> MT7621 SoC provides a system controller node for accessing to some registers.
>>> Add a phandle to this node to avoid using MIPS related arch operations and
>>
>> I don't understand this part. You claim you add a phandle to this node,
>> but your binding suggest you add here a phandle to other node.
> 
> Probably my English is not the best here :-). Yes, you are right, I
> just want to add a phandle to the 'sysc' node in the current node.

Then why do you need syscon compatible here?

Best regards,
Krzysztof
  
Sergio Paracuellos Feb. 10, 2023, 11:38 a.m. UTC | #4
On Fri, Feb 10, 2023 at 12:27 PM Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:
>
> On 10/02/2023 12:22, Sergio Paracuellos wrote:
> > Hi Krzysztof,
> >
> > On Fri, Feb 10, 2023 at 11:59 AM Krzysztof Kozlowski
> > <krzysztof.kozlowski@linaro.org> wrote:
> >>
> >> On 10/02/2023 07:56, Sergio Paracuellos wrote:
> >>> MT7621 SoC provides a system controller node for accessing to some registers.
> >>> Add a phandle to this node to avoid using MIPS related arch operations and
> >>
> >> I don't understand this part. You claim you add a phandle to this node,
> >> but your binding suggest you add here a phandle to other node.
> >
> > Probably my English is not the best here :-). Yes, you are right, I
> > just want to add a phandle to the 'sysc' node in the current node.
>
> Then why do you need syscon compatible here?

Clear now. Will drop that in v2.

>
> Best regards,
> Krzysztof
>

Thanks,
    Sergio Paracuellos
  

Patch

diff --git a/Documentation/devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml b/Documentation/devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml
index b2b17fdf4..3c545065f 100644
--- a/Documentation/devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml
+++ b/Documentation/devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml
@@ -14,11 +14,18 @@  allOf:
 
 properties:
   compatible:
-    const: mediatek,mt7621-wdt
+    items:
+      - const: mediatek,mt7621-wdt
+      - const: syscon
 
   reg:
     maxItems: 1
 
+  ralink,sysctl:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description:
+      phandle of syscon used to control system registers
+
 required:
   - compatible
   - reg
@@ -28,6 +35,7 @@  additionalProperties: false
 examples:
   - |
     watchdog@100 {
-      compatible = "mediatek,mt7621-wdt";
+      compatible = "mediatek,mt7621-wdt", "syscon";
       reg = <0x100 0x100>;
+      ralink,sysctl = <&sysc>;
     };