linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dt-bindings: power: supply: expect specific type for monitored-battery
@ 2022-10-28 23:12 Krzysztof Kozlowski
  2022-10-31 19:26 ` Rob Herring
  0 siblings, 1 reply; 4+ messages in thread
From: Krzysztof Kozlowski @ 2022-10-28 23:12 UTC (permalink / raw)
  To: Sebastian Reichel, Rob Herring, Krzysztof Kozlowski, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Pali Rohár, Andrew F. Davis,
	Artur Rojek, Matti Vaittinen, Markus Laine, Mikko Mutanen,
	linux-pm, devicetree, linux-kernel
  Cc: Krzysztof Kozlowski

Core schema does not define type of monitored-battery, so the schemas
are expected to reference proper type.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 Documentation/devicetree/bindings/power/supply/bq27xxx.yaml    | 2 +-
 .../devicetree/bindings/power/supply/ingenic,battery.yaml      | 1 +
 .../devicetree/bindings/power/supply/rohm,bd99954.yaml         | 1 +
 .../devicetree/bindings/power/supply/sc2731-charger.yaml       | 2 +-
 Documentation/devicetree/bindings/power/supply/sc27xx-fg.yaml  | 3 ++-
 5 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/power/supply/bq27xxx.yaml b/Documentation/devicetree/bindings/power/supply/bq27xxx.yaml
index 65fc6049efc1..b04c86ed0f58 100644
--- a/Documentation/devicetree/bindings/power/supply/bq27xxx.yaml
+++ b/Documentation/devicetree/bindings/power/supply/bq27xxx.yaml
@@ -59,6 +59,7 @@ properties:
     description: integer, I2C address of the fuel gauge.
 
   monitored-battery:
+    $ref: /schemas/types.yaml#/definitions/phandle
     description: |
        phandle of battery characteristics node.
        The fuel gauge uses the following battery properties:
@@ -66,7 +67,6 @@ properties:
        - charge-full-design-microamp-hours
        - voltage-min-design-microvolt
        Both or neither of the *-full-design-*-hours properties must be set.
-       See Documentation/devicetree/bindings/power/supply/battery.yaml
 
   power-supplies: true
 
diff --git a/Documentation/devicetree/bindings/power/supply/ingenic,battery.yaml b/Documentation/devicetree/bindings/power/supply/ingenic,battery.yaml
index 46527038bf22..8bdacc30e9d8 100644
--- a/Documentation/devicetree/bindings/power/supply/ingenic,battery.yaml
+++ b/Documentation/devicetree/bindings/power/supply/ingenic,battery.yaml
@@ -27,6 +27,7 @@ properties:
     const: battery
 
   monitored-battery:
+    $ref: /schemas/types.yaml#/definitions/phandle
     description: >
       phandle to a "simple-battery" compatible node.
 
diff --git a/Documentation/devicetree/bindings/power/supply/rohm,bd99954.yaml b/Documentation/devicetree/bindings/power/supply/rohm,bd99954.yaml
index 24b06957b4ca..ad97d0ac9438 100644
--- a/Documentation/devicetree/bindings/power/supply/rohm,bd99954.yaml
+++ b/Documentation/devicetree/bindings/power/supply/rohm,bd99954.yaml
@@ -121,6 +121,7 @@ properties:
   monitored-battery:
     description:
       phandle of battery characteristics devicetree node
+    $ref: /schemas/types.yaml#/definitions/phandle
 
   rohm,vsys-regulation-microvolt:
     description: system specific lower limit for system voltage.
diff --git a/Documentation/devicetree/bindings/power/supply/sc2731-charger.yaml b/Documentation/devicetree/bindings/power/supply/sc2731-charger.yaml
index eeb043f9bb4f..4a1ca7288a3b 100644
--- a/Documentation/devicetree/bindings/power/supply/sc2731-charger.yaml
+++ b/Documentation/devicetree/bindings/power/supply/sc2731-charger.yaml
@@ -24,11 +24,11 @@ properties:
     description: phandle to the USB phy
 
   monitored-battery:
+    $ref: /schemas/types.yaml#/definitions/phandle
     description: |
       The charger uses the following battery properties
       - charge-term-current-microamp: current for charge termination phase.
       - constant-charge-voltage-max-microvolt: maximum constant input voltage.
-      See Documentation/devicetree/bindings/power/supply/battery.yaml
 
 additionalProperties: false
 
diff --git a/Documentation/devicetree/bindings/power/supply/sc27xx-fg.yaml b/Documentation/devicetree/bindings/power/supply/sc27xx-fg.yaml
index d90a838a1744..8af5957800c0 100644
--- a/Documentation/devicetree/bindings/power/supply/sc27xx-fg.yaml
+++ b/Documentation/devicetree/bindings/power/supply/sc27xx-fg.yaml
@@ -47,7 +47,8 @@ properties:
   sprd,calib-resistance-micro-ohms:
     description: real resistance of coulomb counter chip in micro Ohms
 
-  monitored-battery: true
+  monitored-battery:
+    $ref: /schemas/types.yaml#/definitions/phandle
 
 required:
   - compatible
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] dt-bindings: power: supply: expect specific type for monitored-battery
  2022-10-28 23:12 [PATCH] dt-bindings: power: supply: expect specific type for monitored-battery Krzysztof Kozlowski
@ 2022-10-31 19:26 ` Rob Herring
  2022-10-31 22:56   ` Sebastian Reichel
  0 siblings, 1 reply; 4+ messages in thread
From: Rob Herring @ 2022-10-31 19:26 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Sebastian Reichel, Krzysztof Kozlowski, Orson Zhai, Baolin Wang,
	Chunyan Zhang, Pali Rohár, Andrew F. Davis, Artur Rojek,
	Matti Vaittinen, Markus Laine, Mikko Mutanen, linux-pm,
	devicetree, linux-kernel

On Fri, Oct 28, 2022 at 07:12:55PM -0400, Krzysztof Kozlowski wrote:
> Core schema does not define type of monitored-battery, so the schemas
> are expected to reference proper type.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  Documentation/devicetree/bindings/power/supply/bq27xxx.yaml    | 2 +-
>  .../devicetree/bindings/power/supply/ingenic,battery.yaml      | 1 +
>  .../devicetree/bindings/power/supply/rohm,bd99954.yaml         | 1 +
>  .../devicetree/bindings/power/supply/sc2731-charger.yaml       | 2 +-
>  Documentation/devicetree/bindings/power/supply/sc27xx-fg.yaml  | 3 ++-
>  5 files changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/power/supply/bq27xxx.yaml b/Documentation/devicetree/bindings/power/supply/bq27xxx.yaml
> index 65fc6049efc1..b04c86ed0f58 100644
> --- a/Documentation/devicetree/bindings/power/supply/bq27xxx.yaml
> +++ b/Documentation/devicetree/bindings/power/supply/bq27xxx.yaml
> @@ -59,6 +59,7 @@ properties:
>      description: integer, I2C address of the fuel gauge.
>  
>    monitored-battery:
> +    $ref: /schemas/types.yaml#/definitions/phandle
>      description: |
>         phandle of battery characteristics node.
>         The fuel gauge uses the following battery properties:
> @@ -66,7 +67,6 @@ properties:
>         - charge-full-design-microamp-hours
>         - voltage-min-design-microvolt
>         Both or neither of the *-full-design-*-hours properties must be set.
> -       See Documentation/devicetree/bindings/power/supply/battery.yaml
>  
>    power-supplies: true
>  
> diff --git a/Documentation/devicetree/bindings/power/supply/ingenic,battery.yaml b/Documentation/devicetree/bindings/power/supply/ingenic,battery.yaml
> index 46527038bf22..8bdacc30e9d8 100644
> --- a/Documentation/devicetree/bindings/power/supply/ingenic,battery.yaml
> +++ b/Documentation/devicetree/bindings/power/supply/ingenic,battery.yaml
> @@ -27,6 +27,7 @@ properties:
>      const: battery
>  
>    monitored-battery:
> +    $ref: /schemas/types.yaml#/definitions/phandle

We should not have a type definition multiple times for the same 
property. We need to add a common schema defining the type instead.

Rob

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] dt-bindings: power: supply: expect specific type for monitored-battery
  2022-10-31 19:26 ` Rob Herring
@ 2022-10-31 22:56   ` Sebastian Reichel
  2022-11-02 17:45     ` Krzysztof Kozlowski
  0 siblings, 1 reply; 4+ messages in thread
From: Sebastian Reichel @ 2022-10-31 22:56 UTC (permalink / raw)
  To: Rob Herring
  Cc: Krzysztof Kozlowski, Krzysztof Kozlowski, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Pali Rohár, Andrew F. Davis,
	Artur Rojek, Matti Vaittinen, Markus Laine, Mikko Mutanen,
	linux-pm, devicetree, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2569 bytes --]

Hi,

On Mon, Oct 31, 2022 at 02:26:17PM -0500, Rob Herring wrote:
> On Fri, Oct 28, 2022 at 07:12:55PM -0400, Krzysztof Kozlowski wrote:
> > Core schema does not define type of monitored-battery, so the schemas
> > are expected to reference proper type.
> > 
> > Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > ---
> >  Documentation/devicetree/bindings/power/supply/bq27xxx.yaml    | 2 +-
> >  .../devicetree/bindings/power/supply/ingenic,battery.yaml      | 1 +
> >  .../devicetree/bindings/power/supply/rohm,bd99954.yaml         | 1 +
> >  .../devicetree/bindings/power/supply/sc2731-charger.yaml       | 2 +-
> >  Documentation/devicetree/bindings/power/supply/sc27xx-fg.yaml  | 3 ++-
> >  5 files changed, 6 insertions(+), 3 deletions(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/power/supply/bq27xxx.yaml b/Documentation/devicetree/bindings/power/supply/bq27xxx.yaml
> > index 65fc6049efc1..b04c86ed0f58 100644
> > --- a/Documentation/devicetree/bindings/power/supply/bq27xxx.yaml
> > +++ b/Documentation/devicetree/bindings/power/supply/bq27xxx.yaml
> > @@ -59,6 +59,7 @@ properties:
> >      description: integer, I2C address of the fuel gauge.
> >  
> >    monitored-battery:
> > +    $ref: /schemas/types.yaml#/definitions/phandle
> >      description: |
> >         phandle of battery characteristics node.
> >         The fuel gauge uses the following battery properties:
> > @@ -66,7 +67,6 @@ properties:
> >         - charge-full-design-microamp-hours
> >         - voltage-min-design-microvolt
> >         Both or neither of the *-full-design-*-hours properties must be set.
> > -       See Documentation/devicetree/bindings/power/supply/battery.yaml
> >  
> >    power-supplies: true
> >  
> > diff --git a/Documentation/devicetree/bindings/power/supply/ingenic,battery.yaml b/Documentation/devicetree/bindings/power/supply/ingenic,battery.yaml
> > index 46527038bf22..8bdacc30e9d8 100644
> > --- a/Documentation/devicetree/bindings/power/supply/ingenic,battery.yaml
> > +++ b/Documentation/devicetree/bindings/power/supply/ingenic,battery.yaml
> > @@ -27,6 +27,7 @@ properties:
> >      const: battery
> >  
> >    monitored-battery:
> > +    $ref: /schemas/types.yaml#/definitions/phandle
> 
> We should not have a type definition multiple times for the same 
> property. We need to add a common schema defining the type instead.

I suppose monitored-battery should become part of
Documentation/devicetree/bindings/power/supply/power-supply.yaml

-- Sebastian

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] dt-bindings: power: supply: expect specific type for monitored-battery
  2022-10-31 22:56   ` Sebastian Reichel
@ 2022-11-02 17:45     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 4+ messages in thread
From: Krzysztof Kozlowski @ 2022-11-02 17:45 UTC (permalink / raw)
  To: Sebastian Reichel, Rob Herring
  Cc: Krzysztof Kozlowski, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Pali Rohár, Andrew F. Davis, Artur Rojek, Matti Vaittinen,
	Markus Laine, Mikko Mutanen, linux-pm, devicetree, linux-kernel

On 31/10/2022 18:56, Sebastian Reichel wrote:
> Hi,
> 
> On Mon, Oct 31, 2022 at 02:26:17PM -0500, Rob Herring wrote:
>> On Fri, Oct 28, 2022 at 07:12:55PM -0400, Krzysztof Kozlowski wrote:
>>> Core schema does not define type of monitored-battery, so the schemas
>>> are expected to reference proper type.
>>>
>>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>> ---
>>>  Documentation/devicetree/bindings/power/supply/bq27xxx.yaml    | 2 +-
>>>  .../devicetree/bindings/power/supply/ingenic,battery.yaml      | 1 +
>>>  .../devicetree/bindings/power/supply/rohm,bd99954.yaml         | 1 +
>>>  .../devicetree/bindings/power/supply/sc2731-charger.yaml       | 2 +-
>>>  Documentation/devicetree/bindings/power/supply/sc27xx-fg.yaml  | 3 ++-
>>>  5 files changed, 6 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/Documentation/devicetree/bindings/power/supply/bq27xxx.yaml b/Documentation/devicetree/bindings/power/supply/bq27xxx.yaml
>>> index 65fc6049efc1..b04c86ed0f58 100644
>>> --- a/Documentation/devicetree/bindings/power/supply/bq27xxx.yaml
>>> +++ b/Documentation/devicetree/bindings/power/supply/bq27xxx.yaml
>>> @@ -59,6 +59,7 @@ properties:
>>>      description: integer, I2C address of the fuel gauge.
>>>  
>>>    monitored-battery:
>>> +    $ref: /schemas/types.yaml#/definitions/phandle
>>>      description: |
>>>         phandle of battery characteristics node.
>>>         The fuel gauge uses the following battery properties:
>>> @@ -66,7 +67,6 @@ properties:
>>>         - charge-full-design-microamp-hours
>>>         - voltage-min-design-microvolt
>>>         Both or neither of the *-full-design-*-hours properties must be set.
>>> -       See Documentation/devicetree/bindings/power/supply/battery.yaml
>>>  
>>>    power-supplies: true
>>>  
>>> diff --git a/Documentation/devicetree/bindings/power/supply/ingenic,battery.yaml b/Documentation/devicetree/bindings/power/supply/ingenic,battery.yaml
>>> index 46527038bf22..8bdacc30e9d8 100644
>>> --- a/Documentation/devicetree/bindings/power/supply/ingenic,battery.yaml
>>> +++ b/Documentation/devicetree/bindings/power/supply/ingenic,battery.yaml
>>> @@ -27,6 +27,7 @@ properties:
>>>      const: battery
>>>  
>>>    monitored-battery:
>>> +    $ref: /schemas/types.yaml#/definitions/phandle
>>
>> We should not have a type definition multiple times for the same 
>> property. We need to add a common schema defining the type instead.
> 
> I suppose monitored-battery should become part of
> Documentation/devicetree/bindings/power/supply/power-supply.yaml

I'll send a v2.

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-11-02 17:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-28 23:12 [PATCH] dt-bindings: power: supply: expect specific type for monitored-battery Krzysztof Kozlowski
2022-10-31 19:26 ` Rob Herring
2022-10-31 22:56   ` Sebastian Reichel
2022-11-02 17:45     ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).