Loading Documentation/devicetree/bindings/power/supply/qcom/qpnp-fg-gen4.txt 0 → 100644 +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", }; }; Documentation/devicetree/bindings/power/supply/qcom/qpnp-qnovo5.txt 0 → 100644 +40 −0 Original line number Diff line number Diff line QPNP Qnovo5 pulse engine QPNP Qnovo5 is a PBS based pulse charging engine which works in tandem with the QPNP SMB5 Charger device. It configures the QPNP SMB5 charger to charge/discharge as per pulse characteristics. The QPNP Qnovo5 pulse engine has a single peripheral assigned to it. Properties: - compatible: Usage: required Value type: <string> Definition: It must be "qcom,qpnp-qnovo5". - reg: Usage: required Value type: <u32> Definition: Specifies the base address of the module. Qnovo5 is using a SDAM peripheral so this is the address of the SDAM module being used. - interrupts: Usage: required Value type: <prop-encoded-array> Definition: Specifies the interrupt associated with Qnovo5. - interrupt-names: Usage: required Value type: <string> Definition: Specifies the interrupt name for Qnovo5. There is only one interrupt named as "ptrain-done". Example: qcom,qpnp-qnovo@b000 { compatible = "qcom,qpnp-qnovo5"; reg = <0xb000 0x100>; interrupts = <0x2 0xb0 0x1 IRQ_TYPE_NONE>; interrupt-names = "ptrain-done"; }; drivers/power/supply/qcom/Kconfig +19 −0 Original line number Diff line number Diff line Loading @@ -27,4 +27,23 @@ config SMB1390_CHARGE_PUMP_PSY Technologies, Inc.’s family of standalone chargers to enable a high current, low profile Li+ battery charging system. config SMB1355_SLAVE_CHARGER tristate "SMB1355 Slave Battery Charger" depends on MFD_I2C_PMIC help Say Y to include support for SMB1355 Battery Charger. SMB1355 is a single phase 5A battery charger. The driver supports charger enable/disable. The driver reports the charger status via the power supply framework. A charger status change triggers an IRQ via the device STAT pin. config QPNP_QNOVO5 bool "QPNP QNOVO5 driver" depends on MFD_SPMI_PMIC help Say Y here to enable the Qnovo5 PBS-based pulse charging engine. Qnovo5 driver accepts pulse parameters via sysfs entries and programs the hardware module. It also allows userspace code to read diagnostics of voltage and current measured during certain phases of the pulses. endmenu drivers/power/supply/qcom/Makefile +2 −0 Original line number Diff line number Diff line Loading @@ -2,3 +2,5 @@ obj-$(CONFIG_QPNP_SMB5) += step-chg-jeita.o battery.o qpnp-smb5.o smb5-lib.o pmic-voter.o storm-watch.o schgm-flash.o obj-$(CONFIG_SMB1390_CHARGE_PUMP_PSY) += smb1390-charger-psy.o pmic-voter.o obj-$(CONFIG_SMB1355_SLAVE_CHARGER) += smb1355-charger.o pmic-voter.o obj-$(CONFIG_QPNP_QNOVO5) += qpnp-qnovo5.o battery.o pmic-voter.o Loading
Documentation/devicetree/bindings/power/supply/qcom/qpnp-fg-gen4.txt 0 → 100644 +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", }; };
Documentation/devicetree/bindings/power/supply/qcom/qpnp-qnovo5.txt 0 → 100644 +40 −0 Original line number Diff line number Diff line QPNP Qnovo5 pulse engine QPNP Qnovo5 is a PBS based pulse charging engine which works in tandem with the QPNP SMB5 Charger device. It configures the QPNP SMB5 charger to charge/discharge as per pulse characteristics. The QPNP Qnovo5 pulse engine has a single peripheral assigned to it. Properties: - compatible: Usage: required Value type: <string> Definition: It must be "qcom,qpnp-qnovo5". - reg: Usage: required Value type: <u32> Definition: Specifies the base address of the module. Qnovo5 is using a SDAM peripheral so this is the address of the SDAM module being used. - interrupts: Usage: required Value type: <prop-encoded-array> Definition: Specifies the interrupt associated with Qnovo5. - interrupt-names: Usage: required Value type: <string> Definition: Specifies the interrupt name for Qnovo5. There is only one interrupt named as "ptrain-done". Example: qcom,qpnp-qnovo@b000 { compatible = "qcom,qpnp-qnovo5"; reg = <0xb000 0x100>; interrupts = <0x2 0xb0 0x1 IRQ_TYPE_NONE>; interrupt-names = "ptrain-done"; };
drivers/power/supply/qcom/Kconfig +19 −0 Original line number Diff line number Diff line Loading @@ -27,4 +27,23 @@ config SMB1390_CHARGE_PUMP_PSY Technologies, Inc.’s family of standalone chargers to enable a high current, low profile Li+ battery charging system. config SMB1355_SLAVE_CHARGER tristate "SMB1355 Slave Battery Charger" depends on MFD_I2C_PMIC help Say Y to include support for SMB1355 Battery Charger. SMB1355 is a single phase 5A battery charger. The driver supports charger enable/disable. The driver reports the charger status via the power supply framework. A charger status change triggers an IRQ via the device STAT pin. config QPNP_QNOVO5 bool "QPNP QNOVO5 driver" depends on MFD_SPMI_PMIC help Say Y here to enable the Qnovo5 PBS-based pulse charging engine. Qnovo5 driver accepts pulse parameters via sysfs entries and programs the hardware module. It also allows userspace code to read diagnostics of voltage and current measured during certain phases of the pulses. endmenu
drivers/power/supply/qcom/Makefile +2 −0 Original line number Diff line number Diff line Loading @@ -2,3 +2,5 @@ obj-$(CONFIG_QPNP_SMB5) += step-chg-jeita.o battery.o qpnp-smb5.o smb5-lib.o pmic-voter.o storm-watch.o schgm-flash.o obj-$(CONFIG_SMB1390_CHARGE_PUMP_PSY) += smb1390-charger-psy.o pmic-voter.o obj-$(CONFIG_SMB1355_SLAVE_CHARGER) += smb1355-charger.o pmic-voter.o obj-$(CONFIG_QPNP_QNOVO5) += qpnp-qnovo5.o battery.o pmic-voter.o