diff mbox series

[v2,4/5] dt-bindings: soc: loongson,ls2k-pmc: Allow syscon-reboot/syscon-poweroff as child

Message ID 38e811816c37a2d52374fa04864654ff1e9b4dc8.1693474728.git.zhoubinbin@loongson.cn
State Superseded
Headers show
Series soc: loongson: Fix some issues about loongson_pm2 | expand

Commit Message

Binbin Zhou Aug. 31, 2023, 11:43 a.m. UTC
The reboot and poweroff features are actually part of the Power
Management Unit system controller, thus allow them as its children,
instead of specifying as separate device nodes with syscon phandle.

Without it, the reboot/poweroff feature becomes unavailable.

Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
---
 .../soc/loongson/loongson,ls2k-pmc.yaml       | 26 +++++++++++++++++++
 1 file changed, 26 insertions(+)

Comments

Krzysztof Kozlowski Sept. 1, 2023, 9:06 a.m. UTC | #1
On 31/08/2023 13:43, Binbin Zhou wrote:
>  required:
>    - compatible
>    - reg
> @@ -54,4 +66,18 @@ examples:
>          interrupt-parent = <&liointc1>;
>          interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
>          loongson,suspend-address = <0x0 0x1c000500>;
> +
> +        syscon-reboot {
> +            compatible = "syscon-reboot";
> +            offset = <0x30>;
> +            mask = <0x1>;
> +        };
> +
> +        syscon-poweroff {
> +            compatible = "syscon-poweroff";
> +            regmap = <&pmc>;

???

This is a friendly reminder during the review process.

It seems my previous comments were not fully addressed. Maybe my
feedback got lost between the quotes, maybe you just forgot to apply it.
Please go back to the previous discussion and either implement all
requested changes or keep discussing them.

Thank you.

Best regards,
Krzysztof
Binbin Zhou Sept. 1, 2023, 9:27 a.m. UTC | #2
Hi Krzysztof:


On Fri, Sep 1, 2023 at 5:06 PM Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:
>
> On 31/08/2023 13:43, Binbin Zhou wrote:
> >  required:
> >    - compatible
> >    - reg
> > @@ -54,4 +66,18 @@ examples:
> >          interrupt-parent = <&liointc1>;
> >          interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
> >          loongson,suspend-address = <0x0 0x1c000500>;
> > +
> > +        syscon-reboot {
> > +            compatible = "syscon-reboot";
> > +            offset = <0x30>;
> > +            mask = <0x1>;
> > +        };
> > +
> > +        syscon-poweroff {
> > +            compatible = "syscon-poweroff";
> > +            regmap = <&pmc>;
>
> ???

I did notice that commit [1] changed "regmap" to "unrequired" for
"syscon-reboot", but "syscon-poweroff" did not do the same.
So, at least under the current "syscon-poweroff" rule, "regmap" is "required".

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/power/reset/syscon-poweroff.yaml?h=v6.5#n41

I had my doubts before, but seeing that some dts do have
"syscon-poweroff" as a separate node, I assumed there was a
difference.

commit[1]: 2140d68d69d4 dt-bindings: power: reset: Unrequired regmap
property in syscon-reboot node

Thanks.
Binbin
>
> This is a friendly reminder during the review process.
>
> It seems my previous comments were not fully addressed. Maybe my
> feedback got lost between the quotes, maybe you just forgot to apply it.
> Please go back to the previous discussion and either implement all
> requested changes or keep discussing them.
>
> Thank you.
>
> Best regards,
> Krzysztof
>
Krzysztof Kozlowski Sept. 1, 2023, 11:44 a.m. UTC | #3
On 01/09/2023 11:27, Binbin Zhou wrote:
> Hi Krzysztof:
> 
> 
> On Fri, Sep 1, 2023 at 5:06 PM Krzysztof Kozlowski
> <krzysztof.kozlowski@linaro.org> wrote:
>>
>> On 31/08/2023 13:43, Binbin Zhou wrote:
>>>  required:
>>>    - compatible
>>>    - reg
>>> @@ -54,4 +66,18 @@ examples:
>>>          interrupt-parent = <&liointc1>;
>>>          interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
>>>          loongson,suspend-address = <0x0 0x1c000500>;
>>> +
>>> +        syscon-reboot {
>>> +            compatible = "syscon-reboot";
>>> +            offset = <0x30>;
>>> +            mask = <0x1>;
>>> +        };
>>> +
>>> +        syscon-poweroff {
>>> +            compatible = "syscon-poweroff";
>>> +            regmap = <&pmc>;
>>
>> ???
> 
> I did notice that commit [1] changed "regmap" to "unrequired" for
> "syscon-reboot", but "syscon-poweroff" did not do the same.
> So, at least under the current "syscon-poweroff" rule, "regmap" is "required".
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/power/reset/syscon-poweroff.yaml?h=v6.5#n41
> 
> I had my doubts before, but seeing that some dts do have
> "syscon-poweroff" as a separate node, I assumed there was a
> difference.
> 
> commit[1]: 2140d68d69d4 dt-bindings: power: reset: Unrequired regmap
> property in syscon-reboot node
> 

You are right. I wonder why Serge did not change others.

Looks good, thanks for clarification.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml b/Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml
index c45f5e7fc0e6..510f6cb0f084 100644
--- a/Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml
+++ b/Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml
@@ -37,6 +37,18 @@  properties:
       addition, the PM need according to it to indicate that current
       SoC whether support Suspend To RAM.
 
+  syscon-poweroff:
+    $ref: /schemas/power/reset/syscon-poweroff.yaml#
+    type: object
+    description:
+      Node for power off method
+
+  syscon-reboot:
+    $ref: /schemas/power/reset/syscon-reboot.yaml#
+    type: object
+    description:
+      Node for reboot method
+
 required:
   - compatible
   - reg
@@ -54,4 +66,18 @@  examples:
         interrupt-parent = <&liointc1>;
         interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
         loongson,suspend-address = <0x0 0x1c000500>;
+
+        syscon-reboot {
+            compatible = "syscon-reboot";
+            offset = <0x30>;
+            mask = <0x1>;
+        };
+
+        syscon-poweroff {
+            compatible = "syscon-poweroff";
+            regmap = <&pmc>;
+            offset = <0x14>;
+            mask = <0x3c00>;
+            value = <0x3c00>;
+        };
     };