xref: /linux/Documentation/devicetree/bindings/power/supply/sc27xx-fg.yaml (revision 3a39d672e7f48b8d6b91a09afa4b55352773b4b5)
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
784e85359SKrzysztof 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
30*17656d22SStanislav Jakubek  interrupts:
31*17656d22SStanislav Jakubek    maxItems: 1
32*17656d22SStanislav Jakubek
3389919370SSebastian Reichel  io-channels:
3489919370SSebastian Reichel    items:
3589919370SSebastian Reichel      - description: Battery Temperature ADC
3689919370SSebastian Reichel      - description: Battery Charge Voltage ADC
3789919370SSebastian Reichel
3889919370SSebastian Reichel  io-channel-names:
3989919370SSebastian Reichel    items:
4089919370SSebastian Reichel      - const: bat-temp
4189919370SSebastian Reichel      - const: charge-vol
4289919370SSebastian Reichel
4389919370SSebastian Reichel  nvmem-cells:
4489919370SSebastian Reichel    maxItems: 1
4589919370SSebastian Reichel    description: Calibration cells provided by eFuse device
4689919370SSebastian Reichel
4789919370SSebastian Reichel  nvmem-cell-names:
4889919370SSebastian Reichel    const: fgu_calib
4989919370SSebastian Reichel
5089919370SSebastian Reichel  sprd,calib-resistance-micro-ohms:
5189919370SSebastian Reichel    description: real resistance of coulomb counter chip in micro Ohms
5289919370SSebastian Reichel
5389919370SSebastian Reichel  monitored-battery: true
5489919370SSebastian Reichel
5589919370SSebastian Reichelrequired:
5689919370SSebastian Reichel  - compatible
5789919370SSebastian Reichel  - reg
5889919370SSebastian Reichel  - battery-detect-gpios
59*17656d22SStanislav Jakubek  - interrupts
6089919370SSebastian Reichel  - io-channels
6189919370SSebastian Reichel  - io-channel-names
6289919370SSebastian Reichel  - nvmem-cells
6389919370SSebastian Reichel  - nvmem-cell-names
6489919370SSebastian Reichel  - sprd,calib-resistance-micro-ohms
6589919370SSebastian Reichel  - monitored-battery
6689919370SSebastian Reichel
6789919370SSebastian ReicheladditionalProperties: false
6889919370SSebastian Reichel
6989919370SSebastian Reichelexamples:
7089919370SSebastian Reichel  - |
7189919370SSebastian Reichel    #include <dt-bindings/gpio/gpio.h>
7289919370SSebastian Reichel    bat: battery {
7389919370SSebastian Reichel      compatible = "simple-battery";
7489919370SSebastian Reichel      charge-full-design-microamp-hours = <1900000>;
7589919370SSebastian Reichel      constant-charge-voltage-max-microvolt = <4350000>;
7689919370SSebastian Reichel      ocv-capacity-celsius = <20>;
7789919370SSebastian Reichel      ocv-capacity-table-0 = <4185000 100>, <4113000 95>, <4066000 90>,
7889919370SSebastian Reichel                             <4022000 85>, <3983000 80>, <3949000 75>,
7989919370SSebastian Reichel                             <3917000 70>, <3889000 65>, <3864000 60>,
8089919370SSebastian Reichel                             <3835000 55>, <3805000 50>, <3787000 45>,
8189919370SSebastian Reichel                             <3777000 40>, <3773000 35>, <3770000 30>,
8289919370SSebastian Reichel                             <3765000 25>, <3752000 20>, <3724000 15>,
8389919370SSebastian Reichel                             <3680000 10>, <3605000 5>, <3400000 0>;
8489919370SSebastian Reichel                             // ...
8589919370SSebastian Reichel    };
8689919370SSebastian Reichel
8789919370SSebastian Reichel    pmic {
8889919370SSebastian Reichel      #address-cells = <1>;
8989919370SSebastian Reichel      #size-cells = <0>;
9089919370SSebastian Reichel
9189919370SSebastian Reichel      battery@a00 {
9289919370SSebastian Reichel        compatible = "sprd,sc2731-fgu";
9389919370SSebastian Reichel        reg = <0xa00>;
9489919370SSebastian Reichel        battery-detect-gpios = <&pmic_eic 9 GPIO_ACTIVE_HIGH>;
95*17656d22SStanislav Jakubek        interrupt-parent = <&sc2731_pmic>;
96*17656d22SStanislav Jakubek        interrupts = <4>;
9789919370SSebastian Reichel        io-channels = <&pmic_adc 5>, <&pmic_adc 14>;
9889919370SSebastian Reichel        io-channel-names = "bat-temp", "charge-vol";
9989919370SSebastian Reichel        nvmem-cells = <&fgu_calib>;
10089919370SSebastian Reichel        nvmem-cell-names = "fgu_calib";
10189919370SSebastian Reichel        monitored-battery = <&bat>;
10289919370SSebastian Reichel        sprd,calib-resistance-micro-ohms = <21500>;
10389919370SSebastian Reichel      };
10489919370SSebastian Reichel    };
105