[PATCH V4 1/3] dt-bindings: power: cw2015: add cw2215, cw2217, and cw2218

Chris Morgan macroalpha82 at gmail.com
Wed Nov 25 12:40:36 PST 2026


On Wed, Nov 25, 2026 at 01:01:06PM +0100, Krzysztof Kozlowski wrote:
> On 2026-11-24 13:13 -0600, Chris Morgan wrote:
> > From: Chris Morgan <macromorgan at hotmail.com>
> > 
> > Add bindings for the Cellwise cw2215/cw2217/cw2218 i2C interface
> > battery gauge. It is similar in function to the existing cw2015 but
> > with a different register layout. Each of the cw2215, cw2217 and cw2218
> > only really differ in the minor specs and the hardware ID they display
> > when queried. shunt-resistor-micro-ohms is a property in use for
> > multiple devices so not appending a vendor prefix to it.
> > 
> > Move the minItems and maxItems for the battery profile to a conditional
> > based on the compatible string, as the new monitors require 80 bytes of
> > firmware instead of 64 bytes.
> > 
> > Signed-off-by: Chris Morgan <macromorgan at hotmail.com>
> > ---
> >  .../bindings/power/supply/cw2015_battery.yaml | 41 ++++++++++++++++---
> >  1 file changed, 35 insertions(+), 6 deletions(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/power/supply/cw2015_battery.yaml b/Documentation/devicetree/bindings/power/supply/cw2015_battery.yaml
> > index f7bde324153d..992cd5f6a216 100644
> > --- a/Documentation/devicetree/bindings/power/supply/cw2015_battery.yaml
> > +++ b/Documentation/devicetree/bindings/power/supply/cw2015_battery.yaml
> > @@ -14,12 +14,13 @@ description: |
> >    phandle in monitored-battery. If specified the driver uses the
> >    charge-full-design-microamp-hours property of the battery.
> >  
> > -allOf:
> > -  - $ref: power-supply.yaml#
> > -
> >  properties:
> >    compatible:
> > -    const: cellwise,cw2015
> > +    enum:
> > +      - cellwise,cw2015
> > +      - cellwise,cw2215
> > +      - cellwise,cw2217
> > +      - cellwise,cw2218
> >  
> >    reg:
> >      maxItems: 1
> > @@ -31,8 +32,6 @@ properties:
> >        it is to mail two batteries to a test facility of CellWise and receive
> >        back a test report with the binary blob.
> >      $ref: /schemas/types.yaml#/definitions/uint8-array
> > -    minItems: 64
> > -    maxItems: 64
> 
> Nothing improved. Broadest constraints always stay here (explained also
> in writing bindings).
> 
> Best regards,
> Krzysztof
> 
> -- 
> Krzysztof Kozlowski <krzk at kernel.org>

I think I get it, sorry for being thick. So this would have 64 as the
minimum and 80 as the maximum, then further down for the cw2015 we'd
have 64 as both the min and max, and for the others we'd have 80 as the
min and max.

Thank you,
Chris

> 
> _______________________________________________
> Linux-rockchip mailing list
> Linux-rockchip at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-rockchip



More information about the Linux-rockchip mailing list