12eb4d8dcSEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0 22eb4d8dcSEmmanuel Vadot%YAML 1.2 32eb4d8dcSEmmanuel Vadot--- 4b97ee269SEmmanuel Vadot$id: http://devicetree.org/schemas/power/supply/maxim,max17040.yaml# 5b97ee269SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 62eb4d8dcSEmmanuel Vadot 72eb4d8dcSEmmanuel Vadottitle: Maxim 17040 fuel gauge series 82eb4d8dcSEmmanuel Vadot 92eb4d8dcSEmmanuel Vadotmaintainers: 102eb4d8dcSEmmanuel Vadot - Sebastian Reichel <sre@kernel.org> 112eb4d8dcSEmmanuel Vadot 122eb4d8dcSEmmanuel VadotallOf: 132eb4d8dcSEmmanuel Vadot - $ref: power-supply.yaml# 142eb4d8dcSEmmanuel Vadot 152eb4d8dcSEmmanuel Vadotproperties: 162eb4d8dcSEmmanuel Vadot compatible: 172eb4d8dcSEmmanuel Vadot enum: 182eb4d8dcSEmmanuel Vadot - maxim,max17040 192eb4d8dcSEmmanuel Vadot - maxim,max17041 202eb4d8dcSEmmanuel Vadot - maxim,max17043 212eb4d8dcSEmmanuel Vadot - maxim,max17044 222eb4d8dcSEmmanuel Vadot - maxim,max17048 232eb4d8dcSEmmanuel Vadot - maxim,max17049 242eb4d8dcSEmmanuel Vadot - maxim,max17058 252eb4d8dcSEmmanuel Vadot - maxim,max17059 262eb4d8dcSEmmanuel Vadot - maxim,max77836-battery 272eb4d8dcSEmmanuel Vadot 282eb4d8dcSEmmanuel Vadot reg: 292eb4d8dcSEmmanuel Vadot maxItems: 1 302eb4d8dcSEmmanuel Vadot 312eb4d8dcSEmmanuel Vadot maxim,alert-low-soc-level: 322eb4d8dcSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 332eb4d8dcSEmmanuel Vadot minimum: 1 342eb4d8dcSEmmanuel Vadot maximum: 32 352eb4d8dcSEmmanuel Vadot description: | 362eb4d8dcSEmmanuel Vadot The alert threshold that sets the state of charge level (%) where an interrupt is generated. 372eb4d8dcSEmmanuel Vadot If skipped the power up default value of 4 (%) will be used. 382eb4d8dcSEmmanuel Vadot 392eb4d8dcSEmmanuel Vadot maxim,double-soc: 402eb4d8dcSEmmanuel Vadot type: boolean 412eb4d8dcSEmmanuel Vadot description: | 422eb4d8dcSEmmanuel Vadot Certain devices return double the capacity. 432eb4d8dcSEmmanuel Vadot Specify this to divide the reported value in 2 and thus normalize it. 442eb4d8dcSEmmanuel Vadot SoC == State of Charge == Capacity. 452eb4d8dcSEmmanuel Vadot 462eb4d8dcSEmmanuel Vadot maxim,rcomp: 47e67e8565SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint8-array 48e67e8565SEmmanuel Vadot minItems: 1 49e67e8565SEmmanuel Vadot maxItems: 2 502eb4d8dcSEmmanuel Vadot description: | 512eb4d8dcSEmmanuel Vadot A value to compensate readings for various battery chemistries and operating temperatures. 522eb4d8dcSEmmanuel Vadot max17040,41 have 2 byte rcomp, default to 0x97 0x00. 532eb4d8dcSEmmanuel Vadot All other devices have one byte rcomp, default to 0x97. 542eb4d8dcSEmmanuel Vadot 552eb4d8dcSEmmanuel Vadot interrupts: 562eb4d8dcSEmmanuel Vadot maxItems: 1 572eb4d8dcSEmmanuel Vadot 582eb4d8dcSEmmanuel Vadot wakeup-source: 592eb4d8dcSEmmanuel Vadot type: boolean 602eb4d8dcSEmmanuel Vadot description: | 612eb4d8dcSEmmanuel Vadot Use this property to use alert low SoC level interrupt as wake up source. 622eb4d8dcSEmmanuel Vadot 632eb4d8dcSEmmanuel Vadotrequired: 642eb4d8dcSEmmanuel Vadot - compatible 652eb4d8dcSEmmanuel Vadot - reg 662eb4d8dcSEmmanuel Vadot 678cc087a1SEmmanuel VadotunevaluatedProperties: false 682eb4d8dcSEmmanuel Vadot 692eb4d8dcSEmmanuel Vadotexamples: 702eb4d8dcSEmmanuel Vadot - | 71*fac71e4eSEmmanuel Vadot i2c { 722eb4d8dcSEmmanuel Vadot #address-cells = <1>; 732eb4d8dcSEmmanuel Vadot #size-cells = <0>; 742eb4d8dcSEmmanuel Vadot 752eb4d8dcSEmmanuel Vadot battery@36 { 762eb4d8dcSEmmanuel Vadot compatible = "maxim,max17048"; 772eb4d8dcSEmmanuel Vadot reg = <0x36>; 782eb4d8dcSEmmanuel Vadot maxim,rcomp = /bits/ 8 <0x56>; 792eb4d8dcSEmmanuel Vadot maxim,alert-low-soc-level = <10>; 802eb4d8dcSEmmanuel Vadot maxim,double-soc; 812eb4d8dcSEmmanuel Vadot }; 822eb4d8dcSEmmanuel Vadot }; 832eb4d8dcSEmmanuel Vadot - | 842eb4d8dcSEmmanuel Vadot #include <dt-bindings/interrupt-controller/irq.h> 85*fac71e4eSEmmanuel Vadot i2c { 862eb4d8dcSEmmanuel Vadot #address-cells = <1>; 872eb4d8dcSEmmanuel Vadot #size-cells = <0>; 882eb4d8dcSEmmanuel Vadot 892eb4d8dcSEmmanuel Vadot battery@36 { 902eb4d8dcSEmmanuel Vadot compatible = "maxim,max77836-battery"; 912eb4d8dcSEmmanuel Vadot reg = <0x36>; 922eb4d8dcSEmmanuel Vadot maxim,alert-low-soc-level = <10>; 932eb4d8dcSEmmanuel Vadot interrupt-parent = <&gpio7>; 945956d97fSEmmanuel Vadot interrupts = <2 IRQ_TYPE_LEVEL_LOW>; 952eb4d8dcSEmmanuel Vadot wakeup-source; 962eb4d8dcSEmmanuel Vadot }; 972eb4d8dcSEmmanuel Vadot }; 98