Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e756dfd3 authored by Guru Das Srinagesh's avatar Guru Das Srinagesh
Browse files

dt-bindings: qcom: qpnp-fg-gen4: Add snapshot



Add snapshot of the dt-bindings of the qpnp-fg-gen4 driver as of
msm-4.14 'commit 7e16ff6cdde5 ("defconfig: qcs405: enable WLAN configs
for 32-bit QCS405")'.

Change-Id: I4113f0736ca44f09a9d73656d84b3ff015a2bf26
Signed-off-by: default avatarGuru Das Srinagesh <gurus@codeaurora.org>
parent 128869ff
Loading
Loading
Loading
Loading
+469 −0
Original line number Diff line number Diff line
Qualcomm Technologies, Inc. PMIC Fuel Gauge Gen4 Device

QTI PMIC FG Gen4 device provides interface to the clients to read properties
related to the battery. Its main function is to retrieve the State of Charge
(SOC), in percentage scale representing the amount of charge left in the
battery.

=======================
Required Node Structure
=======================

FG Gen4 device must be described in two levels of device nodes.  The first
level describes the FG Gen4 device.  The second level describes one or more
peripherals managed by FG Gen4 driver. All the peripheral specific parameters
such as base address, interrupts etc., should be under second level node.

====================================
First Level Node - FG Gen4 device
====================================

- compatible
	Usage:      required
	Value type: <string>
	Definition: Should be "qcom,fg-gen4".

- qcom,pmic-revid
	Usage:      required
	Value type: <phandle>
	Definition: Should specify the phandle of PMIC revid module. This is
		    used to identify the PMIC subtype.

- qcom,fg-cutoff-voltage
	Usage:      optional
	Value type: <u32>
	Definition: The voltage (in mV) where the fuel gauge will steer the SOC
		    to be zero. For example, if the cutoff voltage is set to
		    3400mv, the fuel gauge will try to count SoC so that the
		    battery SOC will be 0 when it is 3400 mV. If this property
		    is not specified, then the default value used will be
		    3000 mV.

- qcom,fg-empty-voltage
	Usage:      optional
	Value type: <u32>
	Definition: The voltage threshold (in mV) based on which the empty soc
		    interrupt will be triggered. When the empty soc interrupt
		    fires, battery soc will be set to 0 and the userspace will
		    be notified via the power supply framework. The userspace
		    will read 0% soc and immediately shutdown. If this property
		    is not specified, then the default value used will be
		    2812 mV.

- qcom,fg-sys-term-current
	Usage:      optional
	Value type: <u32>
	Definition: Battery current (in mA) at which the fuel gauge will try to
		    scale towards 100%. When the charge current goes above this
		    the SOC should be at 100%. If this property is not
		    specified, then the default value used will be -125 mA.
		    This value has to be specified in negative values for
		    the charging current.

- qcom,fg-cutoff-current
	Usage:      optional
	Value type: <u32>
	Definition: Minimum Battery current (in mA) used for cutoff SOC
		    estimate. If this property is not specified, then a default
		    value of 200 mA will be applied.

- qcom,fg-delta-soc-thr
	Usage:      optional
	Value type: <u32>
	Definition: Percentage of SOC increase upon which the delta monotonic &
		    battery SOC interrupts will be triggered. If this property
		    is not specified, then the default value will be 1.
		    Possible values are in the range of 0 to 12.

- qcom,fg-esr-timer-chg-fast
	Usage:      optional
	Value type: <prop-encoded-array>
	Definition: Number of cycles between ESR pulses while the battery is
		    charging for fast calibration. Array of 2 elements if
		    specified.
		    Element 0 - Retry value for timer
		    Element 1 - Maximum value for timer

- qcom,fg-esr-timer-dischg-fast
	Usage:      optional
	Value type: <prop-encoded-array>
	Definition: Number of cycles between ESR pulses while the battery is
		    discharging for fast calibration. Array of 2 elements if
		    specified.
		    Element 0 - Retry value for timer
		    Element 1 - Maximum value for timer

- qcom,fg-esr-timer-chg-slow
	Usage:      optional
	Value type: <prop-encoded-array>
	Definition: Number of cycles between ESR pulses while the battery is
		    charging for default calibration. Array of 2 elements if
		    specified.
		    Element 0 - Retry value for timer
		    Element 1 - Maximum value for timer

- qcom,fg-esr-timer-dischg-slow
	Usage:      optional
	Value type: <prop-encoded-array>
	Definition: Number of cycles between ESR pulses while the battery is
		    discharging for default calibration. Array of 2 elements if
		    specified.
		    Element 0 - Retry value for timer
		    Element 1 - Maximum value for timer

- qcom,fg-esr-cal-soc-thresh
	Usage:      optional
	Value type: <prop-encoded-array>
	Definition: SOC thresholds applied when ESR fast calibration is done.
		    Array of 2 elements if specified. This should be specified
		    if ESR fast calibration algorithm is needed.
		    Element 0 - Minimum SOC threshold in percentage
		    Element 1 - Maximum SOC threshold in percentage

- qcom,fg-esr-cal-temp-thresh
	Usage:      optional
	Value type: <prop-encoded-array>
	Definition: Battery temperature thresholds applied when ESR fast
		    calibration is done. Array of 2 elements if specified.
		    This should be specified if ESR fast calibration algorithm
		    is needed.
		    Element 0 - Minimum temperature threshold in Celsius
		    Element 1 - Maximum temperature threshold in Celsius

- qcom,fg-delta-esr-disable-count
	Usage:      optional
	Value type: <u32>
	Definition: Value after which delta ESR interrupt will be disabled.
		    This is applicable only when ESR fast calibration is
		    enabled. Default value is 10.

- qcom,fg-delta-esr-thr
	Usage:      optional
	Value type: <u32>
	Definition: Threshold for delta ESR interrupt in uOhms. Default value
		    is 1832. If ESR fast calibration algorithm is enabled, this
		    will be overridden with a maximum value.

- qcom,fg-esr-filter-factor
	Usage:      optional
	Value type: <u32>
	Definition: ESR filter factor used in ESR fast calibration algorithm.
		    This factor will be used when ESR correction delta is
		    applied after the calculation. Default value is 2.

- qcom,fg-esr-pulse-thresh-ma
	Usage:      optional
	Value type: <u32>
	Definition: ESR pulse qualification threshold in mA. If this is not
		    specified, a default value of 110 mA will be configured.
		    Allowed values are from 1 to 1000.

- qcom,fg-esr-meas-curr-ma
	Usage:      optional
	Value type: <u32>
	Definition: ESR measurement current in mA. If this is not specified,
		    a default value of 120 mA will be configured. Allowed
		    values are 60, 120, 180 and 240.

- qcom,fg-batt-temp-delta
	Usage:      optional
	Value type: <u32>
	Definition: Battery temperature delta interrupt threshold. Possible
		    values are: 0, 1, 2 and 3. Unit is in Kelvin or Celsius.

- qcom,fg-batt-temp-cold-thresh
	Usage:      optional
	Value type: <u32>
	Definition: Battery temperature cold interrupt threshold. Allowed
		    values are from -128 to 127. Unit is in Kelvin or Celsius.

- qcom,fg-batt-temp-hot-thresh
	Usage:      optional
	Value type: <u32>
	Definition: Battery temperature hot interrupt threshold. Allowed
		    values are from -128 to 127. Unit is in Kelvin or Celsius.

- qcom,fg-batt-temp-hyst
	Usage:      optional
	Value type: <u32>
	Definition: Battery temperature hysteresis threshold. This will be
		    applicable only if the cold and hot thresholds are
		    specified. Possible values are: 0, 1, 2 and 3. Unit is in
		    Kelvin or Celsius.

- qcom,fg-force-load-profile
	Usage:      optional
	Value type: <empty>
	Definition: If set, battery profile will be force loaded if the profile
		    loaded earlier by bootloader doesn't match with the profile
		    available in the device tree.

- qcom,cl-start-capacity
	Usage:      optional
	Value type: <u32>
	Definition: Battery SOC threshold to start the capacity learning.
		    If this is not specified, then the default value used
		    will be 15. Unit is in percentage.

- qcom,cl-min-temp
	Usage:      optional
	Value type: <u32>
	Definition: Lower limit of battery temperature to start the capacity
		    learning. If this is not specified, then the default value
		    used will be 150 (15 C). Unit is in decidegC.

- qcom,cl-max-temp
	Usage:      optional
	Value type: <u32>
	Definition: Upper limit of battery temperature to start the capacity
		    learning. If this is not specified, then the default value
		    used will be 500 (50 C). Unit is in decidegC.

- qcom,cl-max-increment
	Usage:      optional
	Value type: <u32>
	Definition: Maximum capacity increment allowed per capacity learning
		    cycle. If this is not specified, then the default value
		    used will be 5 (0.5%). Unit is in decipercentage.

- qcom,cl-max-decrement
	Usage:      optional
	Value type: <u32>
	Definition: Maximum capacity decrement allowed per capacity learning
		    cycle. If this is not specified, then the default value
		    used will be 100 (10%). Unit is in decipercentage.

- qcom,cl-min-limit
	Usage:      optional
	Value type: <u32>
	Definition: Minimum limit that the capacity cannot go below in a
		    capacity learning cycle. If this is not specified, then
		    the default value is 0. Unit is in decipercentage.

- qcom,cl-max-limit
	Usage:      optional
	Value type: <u32>
	Definition: Maximum limit that the capacity cannot go above in a
		    capacity learning cycle. If this is not specified, then
		    the default value is 0. Unit is in decipercentage.

- qcom,hold-soc-while-full
	Usage:      optional
	Value type: <empty>
	Definition: A boolean property that when defined holds SOC at 100% when
		    the battery is full.

- qcom,linearize-soc
	Usage:      optional
	Value type: <empty>
	Definition: A boolean property that when defined linearizes SOC when
		    the SOC drops after charge termination monotonically to
		    improve the user experience. This is applicable only if
		    "qcom,hold-soc-while-full" is specified.

- qcom,ki-coeff-soc-dischg
	Usage:      optional
	Value type: <prop-encoded-array>
	Definition: Array of monotonic SOC threshold values to change the ki
		    coefficient for medium discharge current during discharge.
		    This should be defined in the ascending order and in the
		    range of 0-100. Array limit is set to 3.

- qcom,ki-coeff-low-dischg
	Usage:      optional
	Value type: <prop-encoded-array>
	Definition: Array of ki coefficient values for low discharge current
		    during discharge. These values will be applied when the
		    monotonic SOC goes below the SOC threshold specified under
		    qcom,ki-coeff-soc-dischg. Array limit is set to 3. This
		    property should be specified if qcom,ki-coeff-soc-dischg
		    is specified to make it fully functional. Value has no
		    unit. Allowed range is 62 to 15564 in micro units.

- qcom,ki-coeff-med-dischg
	Usage:      optional
	Value type: <prop-encoded-array>
	Definition: Array of ki coefficient values for medium discharge current
		    during discharge. These values will be applied when the
		    monotonic SOC goes below the SOC threshold specified under
		    qcom,ki-coeff-soc-dischg. Array limit is set to 3. This
		    property should be specified if qcom,ki-coeff-soc-dischg
		    is specified to make it fully functional. Value has no
		    unit. Allowed range is 62 to 15564 in micro units.

- qcom,ki-coeff-hi-dischg
	Usage:      optional
	Value type: <prop-encoded-array>
	Definition: Array of ki coefficient values for high discharge current
		    during discharge. These values will be applied when the
		    monotonic SOC goes below the SOC threshold specified under
		    qcom,ki-coeff-soc-dischg. Array limit is set to 3. This
		    property should be specified if qcom,ki-coeff-soc-dischg
		    is specified to make it fully functional. Value has no
		    unit. Allowed range is 62 to 15564 in micro units.

- qcom,ki-coeff-low-chg
	Usage:      optional
	Value type: <u32>
	Definition: ki coefficient value for low charge current during
		    charging. Value has no unit. Allowed range is 62 to 15564
		    in micro units.

- qcom,ki-coeff-med-chg
	Usage:      optional
	Value type: <u32>
	Definition: ki coefficient value for medium charge current during
		    charging. Value has no unit. Allowed range is 62 to 15564
		    in micro units.

- qcom,ki-coeff-hi-chg
	Usage:      optional
	Value type: <u32>
	Definition: ki coefficient value for high charge current during
		    charging. Value has no unit. Allowed range is 62 to 15564
		    in micro units.

- qcom,ki-coeff-full-dischg
	Usage:      optional
	Value type: <prop-encoded-array>
	Definition: Array of Ki coefficient full SOC values that needs to be
		    applied during discharging. If not specified, a value of
		    0 will be set.
		    Allowed range is from 62 to 15564.
		    Element 0 - Ki coefficient for full SOC in room temperature
		    Element 1 - Ki coefficient for full SOC in low temperature

- qcom,fg-rconn-uohms
	Usage:      optional
	Value type: <u32>
	Definition: Battery connector resistance (Rconn) in microohms. If it's
		    already configured in bootloader, then it will not be
		    configured again by GEN4 FG driver.

- qcom,slope-limit-temp-threshold
	Usage:      optional
	Value type: <u32>
	Definition: Battery temperature threshold to decide when slope limit
		    coefficients should be applied along with charging status.
		    Unit is in decidegC.

- qcom,slope-limit-coeffs
	Usage:      optional
	Value type: <prop-encoded-array>
	Definition: A list of integers which holds the slope limit coefficients
		    in the following order. Allowed size is 4. Possible values
		    are from 123 to 31128. Unit is in micro-percentage.
		    Element 0 - Low temperature discharging
		    Element 1 - Low temperature charging
		    Element 2 - High temperature discharging
		    Element 3 - High temperature charging
		    These coefficients have to be specified along with the
		    property "qcom,slope-limit-temp-threshold" to make dynamic
		    slope limit adjustment functional.

- qcom,rapid-soc-dec-en
	Usage:      optional
	Value type: <empty>
	Definition: A boolean property that when defined enables rapid SOC
		    decrease when the battery SOC is low but not converging to
		    zero with battery voltage dropping rapidly below Vcutoff.

- qcom,five-pin-battery
	Usage:      optional
	Value type: <empty>
	Definition: A boolean property that when specified indicates that a
		    five pin battery is used. Based on this, time to full
		    calculations would use the Rbatt calculated properly.

==========================================================
Second Level Nodes - Peripherals managed by FG Gen4 driver
==========================================================
- reg
	Usage:      required
	Value type: <prop-encoded-array>
	Definition: Addresses and sizes for the specified peripheral

- interrupts
	Usage:      optional
	Value type: <prop-encoded-array>
	Definition: Interrupt mapping as per the interrupt encoding

- interrupt-names
	Usage:      optional
	Value type: <stringlist>
	Definition: Interrupt names.  This list must match up 1-to-1 with the
		    interrupts specified in the 'interrupts' property.

========
Example
========

pm8150b_fg: qpnp,fg {
	compatible = "qcom,fg-gen4";
	#address-cells = <1>;
	#size-cells = <1>;
	qcom,pmic-revid = <&pm8150b_revid>;
	status = "okay";

	qcom,fg-batt-soc@4000 {
		status = "okay";
		reg = <0x4000 0x100>;
		interrupts = <0x2 0x40 0x0 IRQ_TYPE_EDGE_BOTH>,
			     <0x2 0x40 0x1 IRQ_TYPE_EDGE_BOTH>,
			     <0x2 0x40 0x2 IRQ_TYPE_EDGE_RISING>,
			     <0x2 0x40 0x3 IRQ_TYPE_EDGE_RISING>,
			     <0x2 0x40 0x4 IRQ_TYPE_EDGE_BOTH>,
			     <0x2 0x40 0x5 IRQ_TYPE_EDGE_RISING>,
			     <0x2 0x40 0x6 IRQ_TYPE_EDGE_BOTH>,
			     <0x2 0x40 0x7 IRQ_TYPE_EDGE_BOTH>;
		interrupt-names = "soc-update",
				  "soc-ready",
				  "bsoc-delta",
				  "msoc-delta",
				  "msoc-low",
				  "msoc-empty",
				  "msoc-high",
				  "msoc-full";

	};

	qcom,fg-batt-info@4100 {
		status = "okay";
		reg = <0x4100 0x100>;
		interrupts = <0x2 0x41 0x0 IRQ_TYPE_EDGE_BOTH>,
			     <0x2 0x41 0x1 IRQ_TYPE_EDGE_BOTH>,
			     <0x2 0x41 0x3 IRQ_TYPE_EDGE_BOTH>;
		interrupt-names = "vbatt-low",
				  "vbatt-pred-delta",
				  "esr-delta";
	};

	qcom,adc-rr@4200 {
		status = "okay";
		reg = <0x4200 0x100>;
		interrupts = <0x2 0x42 0x0 IRQ_TYPE_EDGE_BOTH>,
			     <0x2 0x42 0x1 IRQ_TYPE_EDGE_BOTH>,
			     <0x2 0x42 0x2 IRQ_TYPE_EDGE_BOTH>,
			     <0x2 0x42 0x3 IRQ_TYPE_EDGE_BOTH>,
			     <0x2 0x42 0x4 IRQ_TYPE_EDGE_BOTH>;
		interrupt-names = "batt-missing",
				  "batt-id",
				  "batt-temp-delta",
				  "batt-temp-hot",
				  "batt-temp-cold";
	};

	qcom,fg-memif@4300 {
		status = "okay";
		reg = <0x4300 0x100>;
		interrupts = <0x2 0x43 0x0 IRQ_TYPE_EDGE_BOTH>,
			     <0x2 0x43 0x1 IRQ_TYPE_EDGE_BOTH>,
			     <0x2 0x43 0x2 IRQ_TYPE_EDGE_BOTH>,
			     <0x2 0x43 0x3 IRQ_TYPE_EDGE_BOTH>,
		interrupt-names = "ima-rdy",
				  "ima-xcp",
				  "dma-xcp",
				  "dma-grant",
	};

};