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

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

Commit Message

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

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

Comments

Krzysztof Kozlowski Feb. 10, 2023, 1:03 p.m. UTC | #1
On 10/02/2023 13:17, Sergio Paracuellos wrote:
> MT7621 SoC provides a system controller node for accessing to some registers.
> Add a phandle in this node to avoid using MIPS related arch operations and
> includes in watchdog driver code.
> 
> Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
> ---
>  .../devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml  | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml b/Documentation/devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml
> index b2b17fdf4..cc701e920 100644
> --- a/Documentation/devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml
> +++ b/Documentation/devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml
> @@ -19,6 +19,12 @@ properties:
>    reg:
>      maxItems: 1
>  
> +  ralink,sysctl:

Thanks for the changes. I did not notice it before - isn't Ralink part
of Mediatek now? Also compatible is mediatek, not "ralink"?



Best regards,
Krzysztof
  
Sergio Paracuellos Feb. 10, 2023, 1:14 p.m. UTC | #2
On Fri, Feb 10, 2023 at 2:03 PM Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:
>
> On 10/02/2023 13:17, Sergio Paracuellos wrote:
> > MT7621 SoC provides a system controller node for accessing to some registers.
> > Add a phandle in this node to avoid using MIPS related arch operations and
> > includes in watchdog driver code.
> >
> > Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
> > ---
> >  .../devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml  | 7 +++++++
> >  1 file changed, 7 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml b/Documentation/devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml
> > index b2b17fdf4..cc701e920 100644
> > --- a/Documentation/devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml
> > +++ b/Documentation/devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml
> > @@ -19,6 +19,12 @@ properties:
> >    reg:
> >      maxItems: 1
> >
> > +  ralink,sysctl:
>
> Thanks for the changes. I did not notice it before - isn't Ralink part
> of Mediatek now? Also compatible is mediatek, not "ralink"?

Yes, it is. I was using the same prefix as for the memory controller
syscon phandler inside the 'sysc' node [0].

I have no problems at all in changing this to 'mediatek' if preferred.

Thanks,
    Sergio Paracuellos

[0]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/mips/boot/dts/ralink/mt7621.dtsi#n67
>
>
>
> Best regards,
> Krzysztof
>
  
Krzysztof Kozlowski Feb. 10, 2023, 1:35 p.m. UTC | #3
On 10/02/2023 14:14, Sergio Paracuellos wrote:
> On Fri, Feb 10, 2023 at 2:03 PM Krzysztof Kozlowski
> <krzysztof.kozlowski@linaro.org> wrote:
>>
>> On 10/02/2023 13:17, Sergio Paracuellos wrote:
>>> MT7621 SoC provides a system controller node for accessing to some registers.
>>> Add a phandle in this node to avoid using MIPS related arch operations and
>>> includes in watchdog driver code.
>>>
>>> Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
>>> ---
>>>  .../devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml  | 7 +++++++
>>>  1 file changed, 7 insertions(+)
>>>
>>> diff --git a/Documentation/devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml b/Documentation/devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml
>>> index b2b17fdf4..cc701e920 100644
>>> --- a/Documentation/devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml
>>> +++ b/Documentation/devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml
>>> @@ -19,6 +19,12 @@ properties:
>>>    reg:
>>>      maxItems: 1
>>>
>>> +  ralink,sysctl:
>>
>> Thanks for the changes. I did not notice it before - isn't Ralink part
>> of Mediatek now? Also compatible is mediatek, not "ralink"?
> 
> Yes, it is. I was using the same prefix as for the memory controller
> syscon phandler inside the 'sysc' node [0].
> 
> I have no problems at all in changing this to 'mediatek' if preferred.
> 

Yes, mediatek as already used in this binding is preferred.

Best regards,
Krzysztof
  
Sergio Paracuellos Feb. 10, 2023, 2:22 p.m. UTC | #4
On Fri, Feb 10, 2023 at 2:35 PM Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:
>
> On 10/02/2023 14:14, Sergio Paracuellos wrote:
> > On Fri, Feb 10, 2023 at 2:03 PM Krzysztof Kozlowski
> > <krzysztof.kozlowski@linaro.org> wrote:
> >>
> >> On 10/02/2023 13:17, Sergio Paracuellos wrote:
> >>> MT7621 SoC provides a system controller node for accessing to some registers.
> >>> Add a phandle in this node to avoid using MIPS related arch operations and
> >>> includes in watchdog driver code.
> >>>
> >>> Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
> >>> ---
> >>>  .../devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml  | 7 +++++++
> >>>  1 file changed, 7 insertions(+)
> >>>
> >>> diff --git a/Documentation/devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml b/Documentation/devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml
> >>> index b2b17fdf4..cc701e920 100644
> >>> --- a/Documentation/devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml
> >>> +++ b/Documentation/devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml
> >>> @@ -19,6 +19,12 @@ properties:
> >>>    reg:
> >>>      maxItems: 1
> >>>
> >>> +  ralink,sysctl:
> >>
> >> Thanks for the changes. I did not notice it before - isn't Ralink part
> >> of Mediatek now? Also compatible is mediatek, not "ralink"?
> >
> > Yes, it is. I was using the same prefix as for the memory controller
> > syscon phandler inside the 'sysc' node [0].
> >
> > I have no problems at all in changing this to 'mediatek' if preferred.
> >
>
> Yes, mediatek as already used in this binding is preferred.

Sure, I will do it and send v3. Let's wait for some other review
comments in the rest of the patches and will send all them together.

>
> 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..cc701e920 100644
--- a/Documentation/devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml
+++ b/Documentation/devicetree/bindings/watchdog/mediatek,mt7621-wdt.yaml
@@ -19,6 +19,12 @@  properties:
   reg:
     maxItems: 1
 
+  ralink,sysctl:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description:
+      phandle to system controller 'sysc' syscon node which
+      controls system registers
+
 required:
   - compatible
   - reg
@@ -30,4 +36,5 @@  examples:
     watchdog@100 {
       compatible = "mediatek,mt7621-wdt";
       reg = <0x100 0x100>;
+      ralink,sysctl = <&sysc>;
     };