Battery driver for CW2015 shuntless fuel gauge by CellWise.

Schema identifier ($id): "http://devicetree.org/schemas/power/supply/cw2015_battery.yaml#"

Schema dialect ($schema): "http://devicetree.org/meta-schemas/core.yaml#"

Maintainers (maintainers): "Tobias Schramm <t.schramm@manjaro.org>"

The driver can utilize information from a simple-battery linked via a phandle in monitored-battery. If specified the driver uses the charge-full-design-microamp-hours property of the battery.

All of these rules must match (allOf) #

Rule 1 #

Shared schema rule ($ref): power-supply.yaml#

Properties and child nodes (properties) #

compatible — required here #

Exact value (const): "cellwise,cw2015"

reg — required here #

Maximum number of items (maxItems): 1

cellwise,battery-profile — not listed as required here #

This property specifies characteristics of the battery used. The format of this binary blob is kept secret by CellWise. The only way to obtain it is to mail two batteries to a test facility of CellWise and receive back a test report with the binary blob.

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint8-array

Minimum number of items (minItems): 64

Maximum number of items (maxItems): 64

cellwise,monitor-interval-ms — not listed as required here #

Specifies the interval in milliseconds gauge values are polled at

Minimum value (minimum): 250

power-supplies — not listed as required here #

Minimum number of items (minItems): 1

Maximum number of items (maxItems): 8

monitored-battery — not listed as required here #

true — No constraints added by this property rule.

Required in this object (required): "compatible", "reg"

Properties not matched by properties or patternProperties in this schema (additionalProperties) #

false

Not allowed by this rule.

Examples (examples) #

i2c {
    #address-cells = <1>;
    #size-cells = <0>;

    cw2015@62 {
        compatible = "cellwise,cw2015";
        reg = <0x62>;
        cellwise,battery-profile = /bits/ 8 <
            0x17 0x67 0x80 0x73 0x6E 0x6C 0x6B 0x63
            0x77 0x51 0x5C 0x58 0x50 0x4C 0x48 0x36
            0x15 0x0C 0x0C 0x19 0x5B 0x7D 0x6F 0x69
            0x69 0x5B 0x0C 0x29 0x20 0x40 0x52 0x59
            0x57 0x56 0x54 0x4F 0x3B 0x1F 0x7F 0x17
            0x06 0x1A 0x30 0x5A 0x85 0x93 0x96 0x2D
            0x48 0x77 0x9C 0xB3 0x80 0x52 0x94 0xCB
            0x2F 0x00 0x64 0xA5 0xB5 0x11 0xF0 0x11
       >;
       cellwise,monitor-interval-ms = <5000>;
       monitored-battery = <&bat>;
       power-supplies = <&mains_charger>, <&usb_charger>;
   };
};

Source notes #

Annotations retained from the schema source

Line 1: SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)

Line 44: Should be enough

Edit this page