1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2%YAML 1.2 3--- 4$id: http://devicetree.org/schemas/power/supply/cw2015_battery.yaml# 5$schema: http://devicetree.org/meta-schemas/core.yaml# 6 7title: Battery driver for CW2015 shuntless fuel gauge by CellWise. 8 9maintainers: 10 - Tobias Schramm <t.schramm@manjaro.org> 11 12description: | 13 The driver can utilize information from a simple-battery linked via a 14 phandle in monitored-battery. If specified the driver uses the 15 charge-full-design-microamp-hours property of the battery. 16 17properties: 18 compatible: 19 const: cellwise,cw2015 20 21 reg: 22 maxItems: 1 23 24 cellwise,battery-profile: 25 description: | 26 This property specifies characteristics of the battery used. The format 27 of this binary blob is kept secret by CellWise. The only way to obtain 28 it is to mail two batteries to a test facility of CellWise and receive 29 back a test report with the binary blob. 30 $ref: /schemas/types.yaml#definitions/uint8-array 31 minItems: 64 32 maxItems: 64 33 34 cellwise,monitor-interval-ms: 35 description: 36 Specifies the interval in milliseconds gauge values are polled at 37 minimum: 250 38 39 power-supplies: 40 description: 41 Specifies supplies used for charging the battery connected to this gauge 42 $ref: /schemas/types.yaml#/definitions/phandle-array 43 minItems: 1 44 maxItems: 8 # Should be enough 45 46 monitored-battery: 47 description: 48 Specifies the phandle of a simple-battery connected to this gauge 49 $ref: /schemas/types.yaml#/definitions/phandle 50 51required: 52 - compatible 53 - reg 54 55examples: 56 - | 57 i2c { 58 #address-cells = <1>; 59 #size-cells = <0>; 60 61 cw2015@62 { 62 compatible = "cellwise,cw201x"; 63 reg = <0x62>; 64 cellwise,battery-profile = /bits/ 8 < 65 0x17 0x67 0x80 0x73 0x6E 0x6C 0x6B 0x63 66 0x77 0x51 0x5C 0x58 0x50 0x4C 0x48 0x36 67 0x15 0x0C 0x0C 0x19 0x5B 0x7D 0x6F 0x69 68 0x69 0x5B 0x0C 0x29 0x20 0x40 0x52 0x59 69 0x57 0x56 0x54 0x4F 0x3B 0x1F 0x7F 0x17 70 0x06 0x1A 0x30 0x5A 0x85 0x93 0x96 0x2D 71 0x48 0x77 0x9C 0xB3 0x80 0x52 0x94 0xCB 72 0x2F 0x00 0x64 0xA5 0xB5 0x11 0xF0 0x11 73 >; 74 cellwise,monitor-interval-ms = <5000>; 75 monitored-battery = <&bat>; 76 power-supplies = <&mains_charger>, <&usb_charger>; 77 }; 78 }; 79 80