Loading Documentation/devicetree/bindings/power/supply/qcom/qpnp-smb5.txt 0 → 100644 +310 −0 Original line number Diff line number Diff line Qualcomm Technologies, Inc. SMB5 Charger Specific Bindings SMB5 Charger is an efficient programmable battery charger capable of charging a high-capacity lithium-ion battery over micro-USB or USB Type-C ultrafast with Quick Charge 2.0, Quick Charge 3.0, and USB Power Delivery support. Wireless charging features full A4WP Rezence 1.2, WPC 1.2, and PMA support. ======================= Required Node Structure ======================= SMB5 Charger must be described in two levels of devices nodes. =============================== First Level Node - SMB5 Charger =============================== Charger specific properties: - compatible Usage: required Value type: <string> Definition: "qcom,qpnp-smb5". - qcom,pmic-revid Usage: required Value type: phandle Definition: Should specify the phandle of PMI's revid module. This is used to identify the PMI subtype. - qcom,batteryless-platform Usage: optional Value type: <empty> Definition: Boolean flag which indicates that the platform does not have a battery, and therefore charging should be disabled. In addition battery properties will be faked such that the device assumes normal operation. - qcom,fcc-max-ua Usage: optional Value type: <u32> Definition: Specifies the maximum fast charge current in micro-amps. If the value is not present, 1Amp is used as default. - qcom,fv-max-uv Usage: optional Value type: <u32> Definition: Specifies the maximum float voltage in micro-volts. If the value is not present, 4.35V is used as default. - qcom,usb-icl-ua Usage: optional Value type: <u32> Definition: Specifies the USB input current limit in micro-amps. If the value is not present, 1.5Amps is used as default. - qcom,usb-ocl-ua Usage: optional Value type: <u32> Definition: Specifies the OTG output current limit in micro-amps. If the value is not present, 1.5Amps is used as default. - qcom,dc-icl-ua Usage: optional Value type: <u32> Definition: Specifies the DC input current limit in micro-amps. - qcom,boost-threshold-ua Usage: optional Value type: <u32> Definition: Specifies the boost current threshold in micro-amps. If the value is not present, 100mA is used as default. - qcom,thermal-mitigation Usage: optional Value type: Array of <u32> Definition: Array of fast charge current limit values for different system thermal mitigation levels. This should be a flat array that denotes the maximum charge current in mA for each thermal level. - qcom,float-option Usage: optional Value type: <u32> Definition: Configures how the charger behaves when a float charger is detected by APSD. 1 - Treat as a DCP. 2 - Treat as a SDP. 3 - Disable charging. 4 - Suspend USB input. - qcom,hvdcp-disable Usage: optional Value type: <empty> Definition: Specifies if hvdcp charging is to be enabled or not. If this property is not specified hvdcp will be enabled. If this property is specified, hvdcp 2.0 detection will still happen but the adapter won't be asked to switch to a higher voltage point. - qcom,chg-inhibit-threshold-mv Usage: optional Value type: <u32> Definition: Charge inhibit threshold in milli-volts. Charging will be inhibited when the battery voltage is within this threshold from Vfloat at charger insertion. If this is not specified then charge inhibit will be disabled by default. Allowed values are: 50, 100, 200, 300. - qcom,auto-recharge-soc Usage: optional Value type: <empty> Definition: Specifies if automatic recharge needs to be based off battery SOC. If this property is not specified, then auto recharge will be based off battery voltage. - qcom,micro-usb Usage: optional Value type: <empty> Definition: Boolean flag which indicates that the platform only support micro usb port. - qcom,suspend-input-on-debug-batt Usage: optional Value type: <empty> Definition: Boolean flag which when present enables input suspend for debug battery. - qcom,min-freq-khz Usage: optional Value type: <u32> Definition: Specifies the minimum charger buck/boost switching frequency in KHz. It overrides the min frequency defined for the charger. - qcom,max-freq-khz Usage: optional Value type: <u32> Definition: Specifies the maximum charger buck/boost switching frequency in KHz. It overrides the max frequency defined for the charger. - qcom,otg-deglitch-time-ms Usage: optional Value type: <u32> Definition: Specifies the deglitch interval for OTG detection. If the value is not present, 50 msec is used as default. - qcom,step-charging-enable Usage: optional Value type: bool Definition: Boolean flag which when present enables step-charging. - qcom,wd-bark-time-secs Usage: optional Value type: <u32> Definition: WD bark-timeout in seconds. The possible values are 16, 32, 64, 128. If not defined it defaults to 64. - qcom,sw-jeita-enable Usage: optional Value type: bool Definition: Boolean flag which when present enables sw compensation for jeita. - qcom,battery-data Usage: optional Value type: <phandle> Definition: Specifies the phandle of the node which contains the battery profiles supported on the device. This is only specified when step charging and sw-jeita configurations are desired to be get from these properties defined in battery profile: qcom,step-chg-ranges, qcom,jeita-fcc-ranges, qcom,jeita-fv-ranges. ============================================= Second Level Nodes - SMB5 Charger Peripherals ============================================= Peripheral specific properties: - reg Usage: required Value type: <prop-encoded-array> Definition: Address and size of the peripheral's register block. - interrupts Usage: required Value type: <prop-encoded-array> Definition: Peripheral interrupt specifier. - interrupt-names Usage: required Value type: <stringlist> Definition: Interrupt names. This list must match up 1-to-1 with the interrupts specified in the 'interrupts' property. ======= Example ======= pmi8998_charger: qcom,qpnp-smb5 { compatible = "qcom,qpnp-smb5"; #address-cells = <1>; #size-cells = <1>; dpdm-supply = <&qusb_phy0>; qcom,chgr@1000 { reg = <0x1000 0x100>; interrupts = <0x2 0x10 0x0 IRQ_TYPE_NONE>, <0x2 0x10 0x1 IRQ_TYPE_NONE>, <0x2 0x10 0x2 IRQ_TYPE_NONE>, <0x2 0x10 0x3 IRQ_TYPE_NONE>, <0x2 0x10 0x4 IRQ_TYPE_NONE>; interrupt-names = "chg-error", "chg-state-change", "step-chg-state-change", "step-chg-soc-update-fail", "step-chg-soc-update-request"; }; qcom,otg@1100 { reg = <0x1100 0x100>; interrupts = <0x2 0x11 0x0 IRQ_TYPE_NONE>, <0x2 0x11 0x1 IRQ_TYPE_NONE>, <0x2 0x11 0x2 IRQ_TYPE_NONE>, <0x2 0x11 0x3 IRQ_TYPE_NONE>; interrupt-names = "otg-fail", "otg-overcurrent", "otg-oc-dis-sw-sts", "testmode-change-detect"; }; qcom,bat-if@1200 { reg = <0x1200 0x100>; interrupts = <0x2 0x12 0x0 IRQ_TYPE_NONE>, <0x2 0x12 0x1 IRQ_TYPE_NONE>, <0x2 0x12 0x2 IRQ_TYPE_NONE>, <0x2 0x12 0x3 IRQ_TYPE_NONE>, <0x2 0x12 0x4 IRQ_TYPE_NONE>, <0x2 0x12 0x5 IRQ_TYPE_NONE>; interrupt-names = "bat-temp", "bat-ocp", "bat-ov", "bat-low", "bat-therm-or-id-missing", "bat-terminal-missing"; }; qcom,usb-chgpth@1300 { reg = <0x1300 0x100>; interrupts = <0x2 0x13 0x0 IRQ_TYPE_NONE>, <0x2 0x13 0x1 IRQ_TYPE_NONE>, <0x2 0x13 0x2 IRQ_TYPE_NONE>, <0x2 0x13 0x3 IRQ_TYPE_NONE>, <0x2 0x13 0x4 IRQ_TYPE_NONE>, <0x2 0x13 0x5 IRQ_TYPE_NONE>, <0x2 0x13 0x6 IRQ_TYPE_NONE>, <0x2 0x13 0x7 IRQ_TYPE_NONE>; interrupt-names = "usbin-collapse", "usbin-lt-3p6v", "usbin-uv", "usbin-ov", "usbin-plugin", "usbin-src-change", "usbin-icl-change", "type-c-change"; }; qcom,dc-chgpth@1400 { reg = <0x1400 0x100>; interrupts = <0x2 0x14 0x0 IRQ_TYPE_NONE>, <0x2 0x14 0x1 IRQ_TYPE_NONE>, <0x2 0x14 0x2 IRQ_TYPE_NONE>, <0x2 0x14 0x3 IRQ_TYPE_NONE>, <0x2 0x14 0x4 IRQ_TYPE_NONE>, <0x2 0x14 0x5 IRQ_TYPE_NONE>, <0x2 0x14 0x6 IRQ_TYPE_NONE>; interrupt-names = "dcin-collapse", "dcin-lt-3p6v", "dcin-uv", "dcin-ov", "dcin-plugin", "div2-en-dg", "dcin-icl-change"; }; qcom,chgr-misc@1600 { reg = <0x1600 0x100>; interrupts = <0x2 0x16 0x0 IRQ_TYPE_NONE>, <0x2 0x16 0x1 IRQ_TYPE_NONE>, <0x2 0x16 0x2 IRQ_TYPE_NONE>, <0x2 0x16 0x3 IRQ_TYPE_NONE>, <0x2 0x16 0x4 IRQ_TYPE_NONE>, <0x2 0x16 0x5 IRQ_TYPE_NONE>, <0x2 0x16 0x6 IRQ_TYPE_NONE>, <0x2 0x16 0x7 IRQ_TYPE_NONE>; interrupt-names = "wdog-snarl", "wdog-bark", "aicl-fail", "aicl-done", "high-duty-cycle", "input-current-limiting", "temperature-change", "switcher-power-ok"; }; }; arch/arm64/configs/sdm855-perf_defconfig +1 −0 Original line number Diff line number Diff line Loading @@ -283,6 +283,7 @@ CONFIG_POWER_RESET_QCOM=y CONFIG_QCOM_DLOAD_MODE=y CONFIG_POWER_RESET_XGENE=y CONFIG_POWER_RESET_SYSCON=y CONFIG_QPNP_SMB5=y CONFIG_THERMAL=y CONFIG_QCOM_SPMI_TEMP_ALARM=y CONFIG_THERMAL_TSENS=y Loading arch/arm64/configs/sdm855_defconfig +1 −0 Original line number Diff line number Diff line Loading @@ -292,6 +292,7 @@ CONFIG_POWER_RESET_QCOM=y CONFIG_QCOM_DLOAD_MODE=y CONFIG_POWER_RESET_XGENE=y CONFIG_POWER_RESET_SYSCON=y CONFIG_QPNP_SMB5=y CONFIG_THERMAL=y CONFIG_QCOM_SPMI_TEMP_ALARM=y CONFIG_THERMAL_TSENS=y Loading drivers/platform/msm/qpnp-revid.c +1 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,7 @@ static const char *const pmic_names[] = { [PM8937_SUBTYPE] = "PM8937", [PM660L_SUBTYPE] = "PM660L", [PM660_SUBTYPE] = "PM660", [PMI632_SUBTYPE] = "PMI632", [PMI8937_SUBTYPE] = "PMI8937", [PM855_SUBTYPE] = "PM855", [PM855B_SUBTYPE] = "PM855B", Loading drivers/power/supply/qcom/Kconfig +13 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,19 @@ config QPNP_SMB2 VBUS and VCONN regulators are registered for supporting OTG, and powered Type-C cables respectively. config QPNP_SMB5 tristate "SMB5 Battery Charger" depends on MFD_SPMI_PMIC help Say Y to enables support for the SMB5 charging peripheral. The QPNP SMB5 charger driver supports the charger peripheral present in the chip. The power supply framework is used to communicate battery and usb properties to userspace and other driver consumers such as fuel gauge, USB, and USB-PD. VBUS and VCONN regulators are registered for supporting OTG, and powered Type-C cables respectively. config SMB138X_CHARGER tristate "SMB138X Battery Charger" depends on MFD_I2C_PMIC Loading Loading
Documentation/devicetree/bindings/power/supply/qcom/qpnp-smb5.txt 0 → 100644 +310 −0 Original line number Diff line number Diff line Qualcomm Technologies, Inc. SMB5 Charger Specific Bindings SMB5 Charger is an efficient programmable battery charger capable of charging a high-capacity lithium-ion battery over micro-USB or USB Type-C ultrafast with Quick Charge 2.0, Quick Charge 3.0, and USB Power Delivery support. Wireless charging features full A4WP Rezence 1.2, WPC 1.2, and PMA support. ======================= Required Node Structure ======================= SMB5 Charger must be described in two levels of devices nodes. =============================== First Level Node - SMB5 Charger =============================== Charger specific properties: - compatible Usage: required Value type: <string> Definition: "qcom,qpnp-smb5". - qcom,pmic-revid Usage: required Value type: phandle Definition: Should specify the phandle of PMI's revid module. This is used to identify the PMI subtype. - qcom,batteryless-platform Usage: optional Value type: <empty> Definition: Boolean flag which indicates that the platform does not have a battery, and therefore charging should be disabled. In addition battery properties will be faked such that the device assumes normal operation. - qcom,fcc-max-ua Usage: optional Value type: <u32> Definition: Specifies the maximum fast charge current in micro-amps. If the value is not present, 1Amp is used as default. - qcom,fv-max-uv Usage: optional Value type: <u32> Definition: Specifies the maximum float voltage in micro-volts. If the value is not present, 4.35V is used as default. - qcom,usb-icl-ua Usage: optional Value type: <u32> Definition: Specifies the USB input current limit in micro-amps. If the value is not present, 1.5Amps is used as default. - qcom,usb-ocl-ua Usage: optional Value type: <u32> Definition: Specifies the OTG output current limit in micro-amps. If the value is not present, 1.5Amps is used as default. - qcom,dc-icl-ua Usage: optional Value type: <u32> Definition: Specifies the DC input current limit in micro-amps. - qcom,boost-threshold-ua Usage: optional Value type: <u32> Definition: Specifies the boost current threshold in micro-amps. If the value is not present, 100mA is used as default. - qcom,thermal-mitigation Usage: optional Value type: Array of <u32> Definition: Array of fast charge current limit values for different system thermal mitigation levels. This should be a flat array that denotes the maximum charge current in mA for each thermal level. - qcom,float-option Usage: optional Value type: <u32> Definition: Configures how the charger behaves when a float charger is detected by APSD. 1 - Treat as a DCP. 2 - Treat as a SDP. 3 - Disable charging. 4 - Suspend USB input. - qcom,hvdcp-disable Usage: optional Value type: <empty> Definition: Specifies if hvdcp charging is to be enabled or not. If this property is not specified hvdcp will be enabled. If this property is specified, hvdcp 2.0 detection will still happen but the adapter won't be asked to switch to a higher voltage point. - qcom,chg-inhibit-threshold-mv Usage: optional Value type: <u32> Definition: Charge inhibit threshold in milli-volts. Charging will be inhibited when the battery voltage is within this threshold from Vfloat at charger insertion. If this is not specified then charge inhibit will be disabled by default. Allowed values are: 50, 100, 200, 300. - qcom,auto-recharge-soc Usage: optional Value type: <empty> Definition: Specifies if automatic recharge needs to be based off battery SOC. If this property is not specified, then auto recharge will be based off battery voltage. - qcom,micro-usb Usage: optional Value type: <empty> Definition: Boolean flag which indicates that the platform only support micro usb port. - qcom,suspend-input-on-debug-batt Usage: optional Value type: <empty> Definition: Boolean flag which when present enables input suspend for debug battery. - qcom,min-freq-khz Usage: optional Value type: <u32> Definition: Specifies the minimum charger buck/boost switching frequency in KHz. It overrides the min frequency defined for the charger. - qcom,max-freq-khz Usage: optional Value type: <u32> Definition: Specifies the maximum charger buck/boost switching frequency in KHz. It overrides the max frequency defined for the charger. - qcom,otg-deglitch-time-ms Usage: optional Value type: <u32> Definition: Specifies the deglitch interval for OTG detection. If the value is not present, 50 msec is used as default. - qcom,step-charging-enable Usage: optional Value type: bool Definition: Boolean flag which when present enables step-charging. - qcom,wd-bark-time-secs Usage: optional Value type: <u32> Definition: WD bark-timeout in seconds. The possible values are 16, 32, 64, 128. If not defined it defaults to 64. - qcom,sw-jeita-enable Usage: optional Value type: bool Definition: Boolean flag which when present enables sw compensation for jeita. - qcom,battery-data Usage: optional Value type: <phandle> Definition: Specifies the phandle of the node which contains the battery profiles supported on the device. This is only specified when step charging and sw-jeita configurations are desired to be get from these properties defined in battery profile: qcom,step-chg-ranges, qcom,jeita-fcc-ranges, qcom,jeita-fv-ranges. ============================================= Second Level Nodes - SMB5 Charger Peripherals ============================================= Peripheral specific properties: - reg Usage: required Value type: <prop-encoded-array> Definition: Address and size of the peripheral's register block. - interrupts Usage: required Value type: <prop-encoded-array> Definition: Peripheral interrupt specifier. - interrupt-names Usage: required Value type: <stringlist> Definition: Interrupt names. This list must match up 1-to-1 with the interrupts specified in the 'interrupts' property. ======= Example ======= pmi8998_charger: qcom,qpnp-smb5 { compatible = "qcom,qpnp-smb5"; #address-cells = <1>; #size-cells = <1>; dpdm-supply = <&qusb_phy0>; qcom,chgr@1000 { reg = <0x1000 0x100>; interrupts = <0x2 0x10 0x0 IRQ_TYPE_NONE>, <0x2 0x10 0x1 IRQ_TYPE_NONE>, <0x2 0x10 0x2 IRQ_TYPE_NONE>, <0x2 0x10 0x3 IRQ_TYPE_NONE>, <0x2 0x10 0x4 IRQ_TYPE_NONE>; interrupt-names = "chg-error", "chg-state-change", "step-chg-state-change", "step-chg-soc-update-fail", "step-chg-soc-update-request"; }; qcom,otg@1100 { reg = <0x1100 0x100>; interrupts = <0x2 0x11 0x0 IRQ_TYPE_NONE>, <0x2 0x11 0x1 IRQ_TYPE_NONE>, <0x2 0x11 0x2 IRQ_TYPE_NONE>, <0x2 0x11 0x3 IRQ_TYPE_NONE>; interrupt-names = "otg-fail", "otg-overcurrent", "otg-oc-dis-sw-sts", "testmode-change-detect"; }; qcom,bat-if@1200 { reg = <0x1200 0x100>; interrupts = <0x2 0x12 0x0 IRQ_TYPE_NONE>, <0x2 0x12 0x1 IRQ_TYPE_NONE>, <0x2 0x12 0x2 IRQ_TYPE_NONE>, <0x2 0x12 0x3 IRQ_TYPE_NONE>, <0x2 0x12 0x4 IRQ_TYPE_NONE>, <0x2 0x12 0x5 IRQ_TYPE_NONE>; interrupt-names = "bat-temp", "bat-ocp", "bat-ov", "bat-low", "bat-therm-or-id-missing", "bat-terminal-missing"; }; qcom,usb-chgpth@1300 { reg = <0x1300 0x100>; interrupts = <0x2 0x13 0x0 IRQ_TYPE_NONE>, <0x2 0x13 0x1 IRQ_TYPE_NONE>, <0x2 0x13 0x2 IRQ_TYPE_NONE>, <0x2 0x13 0x3 IRQ_TYPE_NONE>, <0x2 0x13 0x4 IRQ_TYPE_NONE>, <0x2 0x13 0x5 IRQ_TYPE_NONE>, <0x2 0x13 0x6 IRQ_TYPE_NONE>, <0x2 0x13 0x7 IRQ_TYPE_NONE>; interrupt-names = "usbin-collapse", "usbin-lt-3p6v", "usbin-uv", "usbin-ov", "usbin-plugin", "usbin-src-change", "usbin-icl-change", "type-c-change"; }; qcom,dc-chgpth@1400 { reg = <0x1400 0x100>; interrupts = <0x2 0x14 0x0 IRQ_TYPE_NONE>, <0x2 0x14 0x1 IRQ_TYPE_NONE>, <0x2 0x14 0x2 IRQ_TYPE_NONE>, <0x2 0x14 0x3 IRQ_TYPE_NONE>, <0x2 0x14 0x4 IRQ_TYPE_NONE>, <0x2 0x14 0x5 IRQ_TYPE_NONE>, <0x2 0x14 0x6 IRQ_TYPE_NONE>; interrupt-names = "dcin-collapse", "dcin-lt-3p6v", "dcin-uv", "dcin-ov", "dcin-plugin", "div2-en-dg", "dcin-icl-change"; }; qcom,chgr-misc@1600 { reg = <0x1600 0x100>; interrupts = <0x2 0x16 0x0 IRQ_TYPE_NONE>, <0x2 0x16 0x1 IRQ_TYPE_NONE>, <0x2 0x16 0x2 IRQ_TYPE_NONE>, <0x2 0x16 0x3 IRQ_TYPE_NONE>, <0x2 0x16 0x4 IRQ_TYPE_NONE>, <0x2 0x16 0x5 IRQ_TYPE_NONE>, <0x2 0x16 0x6 IRQ_TYPE_NONE>, <0x2 0x16 0x7 IRQ_TYPE_NONE>; interrupt-names = "wdog-snarl", "wdog-bark", "aicl-fail", "aicl-done", "high-duty-cycle", "input-current-limiting", "temperature-change", "switcher-power-ok"; }; };
arch/arm64/configs/sdm855-perf_defconfig +1 −0 Original line number Diff line number Diff line Loading @@ -283,6 +283,7 @@ CONFIG_POWER_RESET_QCOM=y CONFIG_QCOM_DLOAD_MODE=y CONFIG_POWER_RESET_XGENE=y CONFIG_POWER_RESET_SYSCON=y CONFIG_QPNP_SMB5=y CONFIG_THERMAL=y CONFIG_QCOM_SPMI_TEMP_ALARM=y CONFIG_THERMAL_TSENS=y Loading
arch/arm64/configs/sdm855_defconfig +1 −0 Original line number Diff line number Diff line Loading @@ -292,6 +292,7 @@ CONFIG_POWER_RESET_QCOM=y CONFIG_QCOM_DLOAD_MODE=y CONFIG_POWER_RESET_XGENE=y CONFIG_POWER_RESET_SYSCON=y CONFIG_QPNP_SMB5=y CONFIG_THERMAL=y CONFIG_QCOM_SPMI_TEMP_ALARM=y CONFIG_THERMAL_TSENS=y Loading
drivers/platform/msm/qpnp-revid.c +1 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,7 @@ static const char *const pmic_names[] = { [PM8937_SUBTYPE] = "PM8937", [PM660L_SUBTYPE] = "PM660L", [PM660_SUBTYPE] = "PM660", [PMI632_SUBTYPE] = "PMI632", [PMI8937_SUBTYPE] = "PMI8937", [PM855_SUBTYPE] = "PM855", [PM855B_SUBTYPE] = "PM855B", Loading
drivers/power/supply/qcom/Kconfig +13 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,19 @@ config QPNP_SMB2 VBUS and VCONN regulators are registered for supporting OTG, and powered Type-C cables respectively. config QPNP_SMB5 tristate "SMB5 Battery Charger" depends on MFD_SPMI_PMIC help Say Y to enables support for the SMB5 charging peripheral. The QPNP SMB5 charger driver supports the charger peripheral present in the chip. The power supply framework is used to communicate battery and usb properties to userspace and other driver consumers such as fuel gauge, USB, and USB-PD. VBUS and VCONN regulators are registered for supporting OTG, and powered Type-C cables respectively. config SMB138X_CHARGER tristate "SMB138X Battery Charger" depends on MFD_I2C_PMIC Loading