From b6d95239152517aa60f9a48befd572199aff5b06 Mon Sep 17 00:00:00 2001 From: Umang Chheda Date: Tue, 28 May 2024 14:29:04 +0530 Subject: [PATCH] dt-bindings: power: supply: Add DT bindings for QBG Add device tree bindings for QBG driver. Change-Id: Ibef732b3fbefc4e52348277a0c2e0577a437fd87 Signed-off-by: Ayyagari Ushasreevalli Signed-off-by: Umang Chheda --- bindings/power/supply/qcom/qcom-qbg.yaml | 125 +++++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 bindings/power/supply/qcom/qcom-qbg.yaml diff --git a/bindings/power/supply/qcom/qcom-qbg.yaml b/bindings/power/supply/qcom/qcom-qbg.yaml new file mode 100644 index 00000000..13ce9e2c --- /dev/null +++ b/bindings/power/supply/qcom/qcom-qbg.yaml @@ -0,0 +1,125 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/power/supply/qcom/qcom-qbg.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm Technologies, Inc. Battery Gauge (QBG) + +maintainers: + - Kamal Wadhwa + +description: | + Qualcomm Technologies, Inc. Battery Gauge (QBG) uses the periodic samples of + battery voltage and current to determine the battery state-of-charge (SOC) + and supports other battery management features. + +properties: + compatible: + const: qcom,qbg + + reg: + description: Base address of QBG MAIN peripheral. + maxItems: 1 + + interrupts: + description: Specifies the interrupts for nvmem devices used by QBG. + maxItems: 1 + + interrupt-names: + description: Specifies the interrupt names for nvmem devices used by QBG. + items: + - const: qbg-sdam + $ref: /schemas/types.yaml#/definitions/string-array + + qcom,num-data-sdams: + $ref: /schemas/types.yaml#/definitions/uint32 + description: Number of SDAMs used for storing QBG FIFO data. + + qcom,sdam-base: + $ref: /schemas/types.yaml#/definitions/uint32 + description: Base address of QBG SDAM peripheral. + + qcom,vbat-cutoff-mv: + $ref: /schemas/types.yaml#/definitions/uint32 + description: | + The battery voltage threshold (in mV) at which the battery + power cuts off. The SOC is forced to 0 when battery voltage reaches + this value. + default: 3100 + + qcom,ibat-cutoff-ma: + $ref: /schemas/types.yaml#/definitions/uint32 + description: The battery current threshold (in mA) at which the battery + power cuts off. The SOC is forced to 0 when battery current reaches + this value. + default: 150 + + qcom,vph-min-mv: + $ref: /schemas/types.yaml#/definitions/uint32 + description: Minimum sustainable system power (in mV). + default: 2700 + + qcom,iterm-ma: + $ref: /schemas/types.yaml#/definitions/uint32 + description: The battery current (in mA) at which the QBG algorithm + converges the SOC to 100% during charging and can be used to terminate + charging. + default: 100 + + qcom,rconn-mohm: + $ref: /schemas/types.yaml#/definitions/uint32 + description: Resistance of the battery connector in mOhms. + default: 0 + + qcom,vbatt-empty-threshold-mv: + $ref: /schemas/types.yaml#/definitions/uint32 + description: Vbatt empty threshold in mv at which QBG generates low Vbatt + interrupt. + default: 0 + + nvmem-cell-names: + items: + - const: qbg_debug_mask_low + - const: qbg_debug_mask_high + - const: skip_esr_state + + nvmem-cells: + description: | + Use nvmem cell device to indicate SDAM register. + qbg_debug_mask_low/qbg_debug_mask_high used to store the qbg debug mask + qbg_debug_mask_low/qbg_debug_mask_high not used then will not write or + read qbg debug mask. + skip_esr_state used to get GPS de-modulating status. + skip_esr_state not used will not get GPS de-modulating status and + will not enter esr state. + + maxItems: 3 + +required: + - compatible + - reg + - interrupt-names + - interrupts + - qcom,num-data-sdams + - qcom,sdam-base + +additionalProperties: False + +examples: + - | + #include + qcom,pm5100@0 { + #address-cells = <1>; + #size-cells = <0>; + + qbg@4f00 { + compatible = "qcom,qbg"; + reg = <0x4f00>; + interrupt-names = "qbg-sdam"; + interrupts = <0x0 0x76 0x1 IRQ_TYPE_EDGE_RISING>; + qcom,num-data-sdams = <6>; + qcom,sdam-base = <0x7600>; + }; + }; +...