12eb4d8dcSEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0 22eb4d8dcSEmmanuel Vadot%YAML 1.2 32eb4d8dcSEmmanuel Vadot--- 4b97ee269SEmmanuel Vadot$id: http://devicetree.org/schemas/power/supply/sc27xx-fg.yaml# 5b97ee269SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 62eb4d8dcSEmmanuel Vadot 7*8bab661aSEmmanuel Vadottitle: Spreadtrum SC27XX PMICs Fuel Gauge Unit Power Supply 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 - sprd,sc2720-fgu 192eb4d8dcSEmmanuel Vadot - sprd,sc2721-fgu 202eb4d8dcSEmmanuel Vadot - sprd,sc2723-fgu 212eb4d8dcSEmmanuel Vadot - sprd,sc2730-fgu 222eb4d8dcSEmmanuel Vadot - sprd,sc2731-fgu 232eb4d8dcSEmmanuel Vadot 242eb4d8dcSEmmanuel Vadot reg: 252eb4d8dcSEmmanuel Vadot maxItems: 1 262eb4d8dcSEmmanuel Vadot 272eb4d8dcSEmmanuel Vadot battery-detect-gpios: 282eb4d8dcSEmmanuel Vadot maxItems: 1 292eb4d8dcSEmmanuel Vadot 302eb4d8dcSEmmanuel Vadot io-channels: 312eb4d8dcSEmmanuel Vadot items: 322eb4d8dcSEmmanuel Vadot - description: Battery Temperature ADC 332eb4d8dcSEmmanuel Vadot - description: Battery Charge Voltage ADC 342eb4d8dcSEmmanuel Vadot 352eb4d8dcSEmmanuel Vadot io-channel-names: 362eb4d8dcSEmmanuel Vadot items: 372eb4d8dcSEmmanuel Vadot - const: bat-temp 382eb4d8dcSEmmanuel Vadot - const: charge-vol 392eb4d8dcSEmmanuel Vadot 402eb4d8dcSEmmanuel Vadot nvmem-cells: 412eb4d8dcSEmmanuel Vadot maxItems: 1 422eb4d8dcSEmmanuel Vadot description: Calibration cells provided by eFuse device 432eb4d8dcSEmmanuel Vadot 442eb4d8dcSEmmanuel Vadot nvmem-cell-names: 452eb4d8dcSEmmanuel Vadot const: fgu_calib 462eb4d8dcSEmmanuel Vadot 472eb4d8dcSEmmanuel Vadot sprd,calib-resistance-micro-ohms: 482eb4d8dcSEmmanuel Vadot description: real resistance of coulomb counter chip in micro Ohms 492eb4d8dcSEmmanuel Vadot 502eb4d8dcSEmmanuel Vadot monitored-battery: true 512eb4d8dcSEmmanuel Vadot 522eb4d8dcSEmmanuel Vadotrequired: 532eb4d8dcSEmmanuel Vadot - compatible 542eb4d8dcSEmmanuel Vadot - reg 552eb4d8dcSEmmanuel Vadot - battery-detect-gpios 562eb4d8dcSEmmanuel Vadot - io-channels 572eb4d8dcSEmmanuel Vadot - io-channel-names 582eb4d8dcSEmmanuel Vadot - nvmem-cells 592eb4d8dcSEmmanuel Vadot - nvmem-cell-names 602eb4d8dcSEmmanuel Vadot - sprd,calib-resistance-micro-ohms 612eb4d8dcSEmmanuel Vadot - monitored-battery 622eb4d8dcSEmmanuel Vadot 632eb4d8dcSEmmanuel VadotadditionalProperties: false 642eb4d8dcSEmmanuel Vadot 652eb4d8dcSEmmanuel Vadotexamples: 662eb4d8dcSEmmanuel Vadot - | 672eb4d8dcSEmmanuel Vadot #include <dt-bindings/gpio/gpio.h> 682eb4d8dcSEmmanuel Vadot bat: battery { 692eb4d8dcSEmmanuel Vadot compatible = "simple-battery"; 702eb4d8dcSEmmanuel Vadot charge-full-design-microamp-hours = <1900000>; 712eb4d8dcSEmmanuel Vadot constant-charge-voltage-max-microvolt = <4350000>; 722eb4d8dcSEmmanuel Vadot ocv-capacity-celsius = <20>; 732eb4d8dcSEmmanuel Vadot ocv-capacity-table-0 = <4185000 100>, <4113000 95>, <4066000 90>, 742eb4d8dcSEmmanuel Vadot <4022000 85>, <3983000 80>, <3949000 75>, 752eb4d8dcSEmmanuel Vadot <3917000 70>, <3889000 65>, <3864000 60>, 762eb4d8dcSEmmanuel Vadot <3835000 55>, <3805000 50>, <3787000 45>, 772eb4d8dcSEmmanuel Vadot <3777000 40>, <3773000 35>, <3770000 30>, 782eb4d8dcSEmmanuel Vadot <3765000 25>, <3752000 20>, <3724000 15>, 792eb4d8dcSEmmanuel Vadot <3680000 10>, <3605000 5>, <3400000 0>; 802eb4d8dcSEmmanuel Vadot // ... 812eb4d8dcSEmmanuel Vadot }; 822eb4d8dcSEmmanuel Vadot 832eb4d8dcSEmmanuel Vadot pmic { 842eb4d8dcSEmmanuel Vadot #address-cells = <1>; 852eb4d8dcSEmmanuel Vadot #size-cells = <0>; 862eb4d8dcSEmmanuel Vadot 872eb4d8dcSEmmanuel Vadot battery@a00 { 882eb4d8dcSEmmanuel Vadot compatible = "sprd,sc2731-fgu"; 892eb4d8dcSEmmanuel Vadot reg = <0xa00>; 902eb4d8dcSEmmanuel Vadot battery-detect-gpios = <&pmic_eic 9 GPIO_ACTIVE_HIGH>; 912eb4d8dcSEmmanuel Vadot io-channels = <&pmic_adc 5>, <&pmic_adc 14>; 922eb4d8dcSEmmanuel Vadot io-channel-names = "bat-temp", "charge-vol"; 932eb4d8dcSEmmanuel Vadot nvmem-cells = <&fgu_calib>; 942eb4d8dcSEmmanuel Vadot nvmem-cell-names = "fgu_calib"; 952eb4d8dcSEmmanuel Vadot monitored-battery = <&bat>; 962eb4d8dcSEmmanuel Vadot sprd,calib-resistance-micro-ohms = <21500>; 972eb4d8dcSEmmanuel Vadot }; 982eb4d8dcSEmmanuel Vadot }; 99