xref: /linux/Documentation/devicetree/bindings/power/supply/sc27xx-fg.yaml (revision 84e85359f4999a439aa12e04bf0ae9e13e00fc66)
189919370SSebastian Reichel# SPDX-License-Identifier: GPL-2.0
289919370SSebastian Reichel%YAML 1.2
389919370SSebastian Reichel---
41ea78ec5SKrzysztof Kozlowski$id: http://devicetree.org/schemas/power/supply/sc27xx-fg.yaml#
51ea78ec5SKrzysztof Kozlowski$schema: http://devicetree.org/meta-schemas/core.yaml#
689919370SSebastian Reichel
7*84e85359SKrzysztof Kozlowskititle: Spreadtrum SC27XX PMICs Fuel Gauge Unit Power Supply
889919370SSebastian Reichel
989919370SSebastian Reichelmaintainers:
1089919370SSebastian Reichel  - Sebastian Reichel <sre@kernel.org>
1189919370SSebastian Reichel
1289919370SSebastian ReichelallOf:
1389919370SSebastian Reichel  - $ref: power-supply.yaml#
1489919370SSebastian Reichel
1589919370SSebastian Reichelproperties:
1689919370SSebastian Reichel  compatible:
1789919370SSebastian Reichel    enum:
1889919370SSebastian Reichel      - sprd,sc2720-fgu
1989919370SSebastian Reichel      - sprd,sc2721-fgu
2089919370SSebastian Reichel      - sprd,sc2723-fgu
2189919370SSebastian Reichel      - sprd,sc2730-fgu
2289919370SSebastian Reichel      - sprd,sc2731-fgu
2389919370SSebastian Reichel
2489919370SSebastian Reichel  reg:
2589919370SSebastian Reichel    maxItems: 1
2689919370SSebastian Reichel
2789919370SSebastian Reichel  battery-detect-gpios:
2889919370SSebastian Reichel    maxItems: 1
2989919370SSebastian Reichel
3089919370SSebastian Reichel  io-channels:
3189919370SSebastian Reichel    items:
3289919370SSebastian Reichel      - description: Battery Temperature ADC
3389919370SSebastian Reichel      - description: Battery Charge Voltage ADC
3489919370SSebastian Reichel
3589919370SSebastian Reichel  io-channel-names:
3689919370SSebastian Reichel    items:
3789919370SSebastian Reichel      - const: bat-temp
3889919370SSebastian Reichel      - const: charge-vol
3989919370SSebastian Reichel
4089919370SSebastian Reichel  nvmem-cells:
4189919370SSebastian Reichel    maxItems: 1
4289919370SSebastian Reichel    description: Calibration cells provided by eFuse device
4389919370SSebastian Reichel
4489919370SSebastian Reichel  nvmem-cell-names:
4589919370SSebastian Reichel    const: fgu_calib
4689919370SSebastian Reichel
4789919370SSebastian Reichel  sprd,calib-resistance-micro-ohms:
4889919370SSebastian Reichel    description: real resistance of coulomb counter chip in micro Ohms
4989919370SSebastian Reichel
5089919370SSebastian Reichel  monitored-battery: true
5189919370SSebastian Reichel
5289919370SSebastian Reichelrequired:
5389919370SSebastian Reichel  - compatible
5489919370SSebastian Reichel  - reg
5589919370SSebastian Reichel  - battery-detect-gpios
5689919370SSebastian Reichel  - io-channels
5789919370SSebastian Reichel  - io-channel-names
5889919370SSebastian Reichel  - nvmem-cells
5989919370SSebastian Reichel  - nvmem-cell-names
6089919370SSebastian Reichel  - sprd,calib-resistance-micro-ohms
6189919370SSebastian Reichel  - monitored-battery
6289919370SSebastian Reichel
6389919370SSebastian ReicheladditionalProperties: false
6489919370SSebastian Reichel
6589919370SSebastian Reichelexamples:
6689919370SSebastian Reichel  - |
6789919370SSebastian Reichel    #include <dt-bindings/gpio/gpio.h>
6889919370SSebastian Reichel    bat: battery {
6989919370SSebastian Reichel      compatible = "simple-battery";
7089919370SSebastian Reichel      charge-full-design-microamp-hours = <1900000>;
7189919370SSebastian Reichel      constant-charge-voltage-max-microvolt = <4350000>;
7289919370SSebastian Reichel      ocv-capacity-celsius = <20>;
7389919370SSebastian Reichel      ocv-capacity-table-0 = <4185000 100>, <4113000 95>, <4066000 90>,
7489919370SSebastian Reichel                             <4022000 85>, <3983000 80>, <3949000 75>,
7589919370SSebastian Reichel                             <3917000 70>, <3889000 65>, <3864000 60>,
7689919370SSebastian Reichel                             <3835000 55>, <3805000 50>, <3787000 45>,
7789919370SSebastian Reichel                             <3777000 40>, <3773000 35>, <3770000 30>,
7889919370SSebastian Reichel                             <3765000 25>, <3752000 20>, <3724000 15>,
7989919370SSebastian Reichel                             <3680000 10>, <3605000 5>, <3400000 0>;
8089919370SSebastian Reichel                             // ...
8189919370SSebastian Reichel    };
8289919370SSebastian Reichel
8389919370SSebastian Reichel    pmic {
8489919370SSebastian Reichel      #address-cells = <1>;
8589919370SSebastian Reichel      #size-cells = <0>;
8689919370SSebastian Reichel
8789919370SSebastian Reichel      battery@a00 {
8889919370SSebastian Reichel        compatible = "sprd,sc2731-fgu";
8989919370SSebastian Reichel        reg = <0xa00>;
9089919370SSebastian Reichel        battery-detect-gpios = <&pmic_eic 9 GPIO_ACTIVE_HIGH>;
9189919370SSebastian Reichel        io-channels = <&pmic_adc 5>, <&pmic_adc 14>;
9289919370SSebastian Reichel        io-channel-names = "bat-temp", "charge-vol";
9389919370SSebastian Reichel        nvmem-cells = <&fgu_calib>;
9489919370SSebastian Reichel        nvmem-cell-names = "fgu_calib";
9589919370SSebastian Reichel        monitored-battery = <&bat>;
9689919370SSebastian Reichel        sprd,calib-resistance-micro-ohms = <21500>;
9789919370SSebastian Reichel      };
9889919370SSebastian Reichel    };
99