diff mbox series

[2/3] mips: dts: ralink: mt7621: add phandle to system controller node for watchdog

Message ID 20230210065621.598120-3-sergio.paracuellos@gmail.com (mailing list archive)
State Superseded
Headers show
Series watchdog: mt7621-wdt: avoid globals and arch dependencies | expand

Commit Message

Sergio Paracuellos Feb. 10, 2023, 6:56 a.m. UTC
To allow to access system controller registers from watchdog driver code
add a phandle in the watchdog 'wdt' node. This avoid using arch dependent
operations in driver code.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 arch/mips/boot/dts/ralink/mt7621.dtsi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Krzysztof Kozlowski Feb. 10, 2023, 11 a.m. UTC | #1
On 10/02/2023 07:56, Sergio Paracuellos wrote:
> To allow to access system controller registers from watchdog driver code
> add a phandle in the watchdog 'wdt' node. This avoid using arch dependent

??? This does not make sense.

> operations in driver code.
> 
> Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
> ---
>  arch/mips/boot/dts/ralink/mt7621.dtsi | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/mips/boot/dts/ralink/mt7621.dtsi b/arch/mips/boot/dts/ralink/mt7621.dtsi
> index 5ca40fd21..ebee23a2b 100644
> --- a/arch/mips/boot/dts/ralink/mt7621.dtsi
> +++ b/arch/mips/boot/dts/ralink/mt7621.dtsi
> @@ -71,8 +71,9 @@ sysc: syscon@0 {
>  		};
>  
>  		wdt: wdt@100 {
> -			compatible = "mediatek,mt7621-wdt";
> +			compatible = "mediatek,mt7621-wdt", "syscon";

Why do you need syscon?

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

On Fri, Feb 10, 2023 at 12:00 PM Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:
>
> On 10/02/2023 07:56, Sergio Paracuellos wrote:
> > To allow to access system controller registers from watchdog driver code
> > add a phandle in the watchdog 'wdt' node. This avoid using arch dependent
>
> ??? This does not make sense.

What do you mean? The commit message itself? I need the phandle to
'sysc' system controller node for accessing reset status registers
inside the watchdog driver code.

>
> > operations in driver code.
> >
> > Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
> > ---
> >  arch/mips/boot/dts/ralink/mt7621.dtsi | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/arch/mips/boot/dts/ralink/mt7621.dtsi b/arch/mips/boot/dts/ralink/mt7621.dtsi
> > index 5ca40fd21..ebee23a2b 100644
> > --- a/arch/mips/boot/dts/ralink/mt7621.dtsi
> > +++ b/arch/mips/boot/dts/ralink/mt7621.dtsi
> > @@ -71,8 +71,9 @@ sysc: syscon@0 {
> >               };
> >
> >               wdt: wdt@100 {
> > -                     compatible = "mediatek,mt7621-wdt";
> > +                     compatible = "mediatek,mt7621-wdt", "syscon";
>
> Why do you need syscon?

True, will drop, thanks!

>
> Best regards,
> Krzysztof
>

Best regards,
    Sergio Paracuellos
Krzysztof Kozlowski Feb. 10, 2023, 11:31 a.m. UTC | #3
On 10/02/2023 12:29, Sergio Paracuellos wrote:
> Hi Krzysztof,
> 
> On Fri, Feb 10, 2023 at 12:00 PM Krzysztof Kozlowski
> <krzysztof.kozlowski@linaro.org> wrote:
>>
>> On 10/02/2023 07:56, Sergio Paracuellos wrote:
>>> To allow to access system controller registers from watchdog driver code
>>> add a phandle in the watchdog 'wdt' node. This avoid using arch dependent
>>
>> ??? This does not make sense.
> 
> What do you mean? The commit message itself? I need the phandle to
> 'sysc' system controller node for accessing reset status registers
> inside the watchdog driver code.

The message makes sense. The message for the code does not make anymore.
I meant, you want to access system controller registers from watchdog,
so you add syscon to watchdog...

Best regards,
Krzysztof
Sergio Paracuellos Feb. 10, 2023, 11:37 a.m. UTC | #4
On Fri, Feb 10, 2023 at 12:31 PM Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:
>
> On 10/02/2023 12:29, Sergio Paracuellos wrote:
> > Hi Krzysztof,
> >
> > On Fri, Feb 10, 2023 at 12:00 PM Krzysztof Kozlowski
> > <krzysztof.kozlowski@linaro.org> wrote:
> >>
> >> On 10/02/2023 07:56, Sergio Paracuellos wrote:
> >>> To allow to access system controller registers from watchdog driver code
> >>> add a phandle in the watchdog 'wdt' node. This avoid using arch dependent
> >>
> >> ??? This does not make sense.
> >
> > What do you mean? The commit message itself? I need the phandle to
> > 'sysc' system controller node for accessing reset status registers
> > inside the watchdog driver code.
>
> The message makes sense. The message for the code does not make anymore.
> I meant, you want to access system controller registers from watchdog,
> so you add syscon to watchdog...

I got your point now, thanks. Will remove the syscon compatible from
the watchdog node.

>
> Best regards,
> Krzysztof
>
Best regards,
   Sergio Paracuellos
diff mbox series

Patch

diff --git a/arch/mips/boot/dts/ralink/mt7621.dtsi b/arch/mips/boot/dts/ralink/mt7621.dtsi
index 5ca40fd21..ebee23a2b 100644
--- a/arch/mips/boot/dts/ralink/mt7621.dtsi
+++ b/arch/mips/boot/dts/ralink/mt7621.dtsi
@@ -71,8 +71,9 @@  sysc: syscon@0 {
 		};
 
 		wdt: wdt@100 {
-			compatible = "mediatek,mt7621-wdt";
+			compatible = "mediatek,mt7621-wdt", "syscon";
 			reg = <0x100 0x100>;
+			ralink,sysctl = <&sysc>;
 		};
 
 		gpio: gpio@600 {