diff mbox series

[2/2] dt-bindings: regulator: pca9450: add restart handler priority

Message ID 20240419083104.3329252-3-h.assmann@pengutronix.de
State Changes Requested
Headers show
Series regulator: pca9450: enable restart handler for I2C | expand

Checks

Context Check Description
robh/checkpatch success
robh/patch-applied success
robh/dtbs-check warning build log
robh/dt-meta-schema success

Commit Message

Holger Assmann April 19, 2024, 8:31 a.m. UTC
This is an optional property. If set, the pca9450 will be registered as
a reset device with the chosen priority level.

Signed-off-by: Holger Assmann <h.assmann@pengutronix.de>
---
 .../devicetree/bindings/regulator/nxp,pca9450-regulator.yaml   | 3 +++
 1 file changed, 3 insertions(+)

Comments

Krzysztof Kozlowski April 19, 2024, 1:39 p.m. UTC | #1
On 19/04/2024 10:31, Holger Assmann wrote:
> This is an optional property. If set, the pca9450 will be registered as
> a reset device with the chosen priority level.
> 
> Signed-off-by: Holger Assmann <h.assmann@pengutronix.de>

Please use subject prefixes matching the subsystem. You can get them for
example with `git log --oneline -- DIRECTORY_OR_FILE` on the directory
your patch is touching.

> ---
>  .../devicetree/bindings/regulator/nxp,pca9450-regulator.yaml   | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml b/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml
> index 3d469b8e97748..7cc2d6636cf52 100644
> --- a/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml
> +++ b/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml
> @@ -35,6 +35,9 @@ properties:
>    interrupts:
>      maxItems: 1
>  
> +  priority:
> +    $ref: /schemas/power/reset/restart-handler.yaml#

You defined object, which is not explained in commit msg. This code does
not look correct or it does not implement what you said.

Please look at existing code - do you see anything like this? No, there
is no such code and this should raise question.

You probably want to annotate that device is a restart handler?

Best regards,
Krzysztof
Holger Assmann April 22, 2024, 8:24 a.m. UTC | #2
Hello Krzysztof,

also thanks for the feedback on this one.

Am 19.04.24 um 15:39 schrieb Krzysztof Kozlowski:
> 
> Please use subject prefixes matching the subsystem. You can get them for
> example with `git log --oneline -- DIRECTORY_OR_FILE` on the directory
> your patch is touching.

Short note: I did that prior submitting, but I did it directly for the
yaml-file and not for the directory - Those do not look the same
regarding their prefix scheme.

I will change it for my v2 and use a subject like for the directory.


> 
>> ---
>>  .../devicetree/bindings/regulator/nxp,pca9450-regulator.yaml   | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml b/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml
>> index 3d469b8e97748..7cc2d6636cf52 100644
>> --- a/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml
>> +++ b/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml
>> @@ -35,6 +35,9 @@ properties:
>>    interrupts:
>>      maxItems: 1
>>  
>> +  priority:
>> +    $ref: /schemas/power/reset/restart-handler.yaml#
> 
> You defined object, which is not explained in commit msg. This code does
> not look correct or it does not implement what you said.
> 
> Please look at existing code - do you see anything like this? No, there
> is no such code and this should raise question.

I am a bit lost on that one to be honest.

The only other instances where a "priority" for restart handling is
described are "gpio-poweroff.yaml" and "syscon-reboot.yaml". These files
are dedicated documentation for the reset bindings, so I tried to
transfer the respective entry over for my commit.

Do you suggest I should replace

+  priority:
+    $ref: /schemas/power/reset/restart-handler.yaml#

with

+allOf:
+  - $ref: /schemas/power/reset/restart-handler.yaml#

in order to properly include the context for the restart handling?
Running dt_binding_check does not indicate an issue with any of those two.


> 
> You probably want to annotate that device is a restart handler?

You mean by adding to the "description" part of the file?


Kind regards,
Holger
Krzysztof Kozlowski April 22, 2024, 5:57 p.m. UTC | #3
On 22/04/2024 10:24, Holger Assmann wrote:
> Hello Krzysztof,
> 
> also thanks for the feedback on this one.
> 
> Am 19.04.24 um 15:39 schrieb Krzysztof Kozlowski:
>>
>> Please use subject prefixes matching the subsystem. You can get them for
>> example with `git log --oneline -- DIRECTORY_OR_FILE` on the directory
>> your patch is touching.
> 
> Short note: I did that prior submitting, but I did it directly for the
> yaml-file and not for the directory - Those do not look the same
> regarding their prefix scheme.

No, if you run it per file or per directory, prefix is the same. Starts with regulator, doesn't it?

> 
> I will change it for my v2 and use a subject like for the directory.

regulator: dt-bindings: nxp,pca9450: add foo bar


> 
> 
>>
>>> ---
>>>  .../devicetree/bindings/regulator/nxp,pca9450-regulator.yaml   | 3 +++
>>>  1 file changed, 3 insertions(+)
>>>
>>> diff --git a/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml b/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml
>>> index 3d469b8e97748..7cc2d6636cf52 100644
>>> --- a/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml
>>> +++ b/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml
>>> @@ -35,6 +35,9 @@ properties:
>>>    interrupts:
>>>      maxItems: 1
>>>  
>>> +  priority:
>>> +    $ref: /schemas/power/reset/restart-handler.yaml#
>>
>> You defined object, which is not explained in commit msg. This code does
>> not look correct or it does not implement what you said.
>>
>> Please look at existing code - do you see anything like this? No, there
>> is no such code and this should raise question.
> 
> I am a bit lost on that one to be honest.
> 
> The only other instances where a "priority" for restart handling is
> described are "gpio-poweroff.yaml" and "syscon-reboot.yaml". These files
> are dedicated documentation for the reset bindings, so I tried to
> transfer the respective entry over for my commit.

Where do you see such syntax?

> 
> Do you suggest I should replace
> 
> +  priority:
> +    $ref: /schemas/power/reset/restart-handler.yaml#

I don't understand what you want to express with such syntax. That's why I suggested you to look for existing examples. There is no such code as above, so you are the first one to add it. And then the obvious question: why are you doing things quite different than others? That's pretty often a hint that something is odd.

> 
> with
> 
> +allOf:
> +  - $ref: /schemas/power/reset/restart-handler.yaml#
> 
> in order to properly include the context for the restart handling?
> Running dt_binding_check does not indicate an issue with any of those two.

Again, what do you want to achieve?

> 
> 
>>
>> You probably want to annotate that device is a restart handler?
> 
> You mean by adding to the "description" part of the file?

No. What do you want to achieve?

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml b/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml
index 3d469b8e97748..7cc2d6636cf52 100644
--- a/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml
+++ b/Documentation/devicetree/bindings/regulator/nxp,pca9450-regulator.yaml
@@ -35,6 +35,9 @@  properties:
   interrupts:
     maxItems: 1
 
+  priority:
+    $ref: /schemas/power/reset/restart-handler.yaml#
+
   regulators:
     type: object
     description: |