Loading Documentation/devicetree/bindings/power/supply/qcom/smb1390-charger.txt 0 → 100644 +73 −0 Original line number Diff line number Diff line Qualcomm Technologies, Inc. SMB1390 Charger Specific Bindings SMB1390 charge pump is paired with QTI family of standalone chargers to enable a high current, high efficiency Li+ battery charging system. ======================= Required Node Structure ======================= SMB1390 Charger must be described in two levels of device nodes. ================================== First Level Node - SMB1390 Charger ================================== Charger specific properties: - compatible Usage: required Value type: <string> Definition: "qcom,smb1390-charger". - qcom,pmic-revid Usage: required Value type: phandle Definition: Should specify the phandle of SMB's revid module. This is used to identify the SMB subtype. - qcom,channel-num Usage: required Value type: <u32> Definition: Specifies the ADC channel number for reading die temperature. ================================================ Second Level Nodes - SMB1390 Charger Peripherals ================================================ Peripheral specific properties: - 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 ======= smb1390_charger: qcom,charge_pump { compatible = "qcom,smb1390-charger"; qcom,pmic-revid = <&smb1390_revid>; qcom,channel-num = <15> interrupt-parent = <&smb1390>; qcom,smb-vadc = <&pm8998_vadc>; status = "disabled"; qcom,core { interrupts = <0x10 0x0 IRQ_TYPE_EDGE_RISING>, <0x10 0x1 IRQ_TYPE_EDGE_RISING>, <0x10 0x2 IRQ_TYPE_EDGE_RISING>, <0x10 0x3 IRQ_TYPE_EDGE_RISING>, <0x10 0x4 IRQ_TYPE_EDGE_RISING>; interrupt-names = "switcher-off-window", "switcher-off-fault", "vph-ov-soft", "ilim", "temp-alarm"; }; }; drivers/power/supply/power_supply_sysfs.c +1 −0 Original line number Diff line number Diff line Loading @@ -327,6 +327,7 @@ static struct device_attribute power_supply_attrs[] = { POWER_SUPPLY_ATTR(batt_profile_version), POWER_SUPPLY_ATTR(batt_full_current), POWER_SUPPLY_ATTR(recharge_soc), POWER_SUPPLY_ATTR(toggle_stat), /* Local extensions of type int64_t */ POWER_SUPPLY_ATTR(charge_counter_ext), /* Properties of type `const char *' */ Loading drivers/power/supply/qcom/Kconfig +8 −0 Original line number Diff line number Diff line Loading @@ -124,4 +124,12 @@ config QPNP_QG to determine the battery state-of-charge (SOC) and supports other battery management features. config SMB1390_CHARGE_PUMP tristate "SMB1390 Charge Pump" depends on MFD_I2C_PMIC help Say Y to include support for SMB1390 Charge Pump. SMB1390 is a div2 charge pump capable of delivering 6A charge current with very high efficiency. endmenu drivers/power/supply/qcom/Makefile +1 −0 Original line number Diff line number Diff line Loading @@ -10,3 +10,4 @@ obj-$(CONFIG_QPNP_QG) += qpnp-qg.o pmic-voter.o qg-util.o qg-soc.o qg-sdam.o qg obj-$(CONFIG_QPNP_QNOVO) += qpnp-qnovo.o battery.o obj-$(CONFIG_QPNP_TYPEC) += qpnp-typec.o 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) += smb1390-charger.o pmic-voter.o drivers/power/supply/qcom/qpnp-smb2.c +25 −0 Original line number Diff line number Diff line Loading @@ -716,6 +716,7 @@ static enum power_supply_property smb2_usb_main_props[] = { POWER_SUPPLY_PROP_INPUT_VOLTAGE_SETTLED, POWER_SUPPLY_PROP_FCC_DELTA, POWER_SUPPLY_PROP_CURRENT_MAX, POWER_SUPPLY_PROP_TOGGLE_STAT, /* * TODO move the TEMP and TEMP_MAX properties here, * and update the thermal balancer to look here Loading Loading @@ -753,6 +754,9 @@ static int smb2_usb_main_get_prop(struct power_supply *psy, case POWER_SUPPLY_PROP_CURRENT_MAX: rc = smblib_get_icl_current(chg, &val->intval); break; case POWER_SUPPLY_PROP_TOGGLE_STAT: val->intval = 0; break; default: pr_debug("get prop %d is not supported in usb-main\n", psp); rc = -EINVAL; Loading Loading @@ -783,6 +787,9 @@ static int smb2_usb_main_set_prop(struct power_supply *psy, case POWER_SUPPLY_PROP_CURRENT_MAX: rc = smblib_set_icl_current(chg, val->intval); break; case POWER_SUPPLY_PROP_TOGGLE_STAT: rc = smblib_toggle_stat(chg, val->intval); break; default: pr_err("set prop %d is not supported\n", psp); rc = -EINVAL; Loading @@ -792,6 +799,23 @@ static int smb2_usb_main_set_prop(struct power_supply *psy, return rc; } static int smb2_usb_main_prop_is_writeable(struct power_supply *psy, enum power_supply_property psp) { int rc; switch (psp) { case POWER_SUPPLY_PROP_TOGGLE_STAT: rc = 1; break; default: rc = 0; break; } return rc; } static const struct power_supply_desc usb_main_psy_desc = { .name = "main", .type = POWER_SUPPLY_TYPE_MAIN, Loading @@ -799,6 +823,7 @@ static const struct power_supply_desc usb_main_psy_desc = { .num_properties = ARRAY_SIZE(smb2_usb_main_props), .get_property = smb2_usb_main_get_prop, .set_property = smb2_usb_main_set_prop, .property_is_writeable = smb2_usb_main_prop_is_writeable, }; static int smb2_init_usb_main_psy(struct smb2 *chip) Loading Loading
Documentation/devicetree/bindings/power/supply/qcom/smb1390-charger.txt 0 → 100644 +73 −0 Original line number Diff line number Diff line Qualcomm Technologies, Inc. SMB1390 Charger Specific Bindings SMB1390 charge pump is paired with QTI family of standalone chargers to enable a high current, high efficiency Li+ battery charging system. ======================= Required Node Structure ======================= SMB1390 Charger must be described in two levels of device nodes. ================================== First Level Node - SMB1390 Charger ================================== Charger specific properties: - compatible Usage: required Value type: <string> Definition: "qcom,smb1390-charger". - qcom,pmic-revid Usage: required Value type: phandle Definition: Should specify the phandle of SMB's revid module. This is used to identify the SMB subtype. - qcom,channel-num Usage: required Value type: <u32> Definition: Specifies the ADC channel number for reading die temperature. ================================================ Second Level Nodes - SMB1390 Charger Peripherals ================================================ Peripheral specific properties: - 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 ======= smb1390_charger: qcom,charge_pump { compatible = "qcom,smb1390-charger"; qcom,pmic-revid = <&smb1390_revid>; qcom,channel-num = <15> interrupt-parent = <&smb1390>; qcom,smb-vadc = <&pm8998_vadc>; status = "disabled"; qcom,core { interrupts = <0x10 0x0 IRQ_TYPE_EDGE_RISING>, <0x10 0x1 IRQ_TYPE_EDGE_RISING>, <0x10 0x2 IRQ_TYPE_EDGE_RISING>, <0x10 0x3 IRQ_TYPE_EDGE_RISING>, <0x10 0x4 IRQ_TYPE_EDGE_RISING>; interrupt-names = "switcher-off-window", "switcher-off-fault", "vph-ov-soft", "ilim", "temp-alarm"; }; };
drivers/power/supply/power_supply_sysfs.c +1 −0 Original line number Diff line number Diff line Loading @@ -327,6 +327,7 @@ static struct device_attribute power_supply_attrs[] = { POWER_SUPPLY_ATTR(batt_profile_version), POWER_SUPPLY_ATTR(batt_full_current), POWER_SUPPLY_ATTR(recharge_soc), POWER_SUPPLY_ATTR(toggle_stat), /* Local extensions of type int64_t */ POWER_SUPPLY_ATTR(charge_counter_ext), /* Properties of type `const char *' */ Loading
drivers/power/supply/qcom/Kconfig +8 −0 Original line number Diff line number Diff line Loading @@ -124,4 +124,12 @@ config QPNP_QG to determine the battery state-of-charge (SOC) and supports other battery management features. config SMB1390_CHARGE_PUMP tristate "SMB1390 Charge Pump" depends on MFD_I2C_PMIC help Say Y to include support for SMB1390 Charge Pump. SMB1390 is a div2 charge pump capable of delivering 6A charge current with very high efficiency. endmenu
drivers/power/supply/qcom/Makefile +1 −0 Original line number Diff line number Diff line Loading @@ -10,3 +10,4 @@ obj-$(CONFIG_QPNP_QG) += qpnp-qg.o pmic-voter.o qg-util.o qg-soc.o qg-sdam.o qg obj-$(CONFIG_QPNP_QNOVO) += qpnp-qnovo.o battery.o obj-$(CONFIG_QPNP_TYPEC) += qpnp-typec.o 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) += smb1390-charger.o pmic-voter.o
drivers/power/supply/qcom/qpnp-smb2.c +25 −0 Original line number Diff line number Diff line Loading @@ -716,6 +716,7 @@ static enum power_supply_property smb2_usb_main_props[] = { POWER_SUPPLY_PROP_INPUT_VOLTAGE_SETTLED, POWER_SUPPLY_PROP_FCC_DELTA, POWER_SUPPLY_PROP_CURRENT_MAX, POWER_SUPPLY_PROP_TOGGLE_STAT, /* * TODO move the TEMP and TEMP_MAX properties here, * and update the thermal balancer to look here Loading Loading @@ -753,6 +754,9 @@ static int smb2_usb_main_get_prop(struct power_supply *psy, case POWER_SUPPLY_PROP_CURRENT_MAX: rc = smblib_get_icl_current(chg, &val->intval); break; case POWER_SUPPLY_PROP_TOGGLE_STAT: val->intval = 0; break; default: pr_debug("get prop %d is not supported in usb-main\n", psp); rc = -EINVAL; Loading Loading @@ -783,6 +787,9 @@ static int smb2_usb_main_set_prop(struct power_supply *psy, case POWER_SUPPLY_PROP_CURRENT_MAX: rc = smblib_set_icl_current(chg, val->intval); break; case POWER_SUPPLY_PROP_TOGGLE_STAT: rc = smblib_toggle_stat(chg, val->intval); break; default: pr_err("set prop %d is not supported\n", psp); rc = -EINVAL; Loading @@ -792,6 +799,23 @@ static int smb2_usb_main_set_prop(struct power_supply *psy, return rc; } static int smb2_usb_main_prop_is_writeable(struct power_supply *psy, enum power_supply_property psp) { int rc; switch (psp) { case POWER_SUPPLY_PROP_TOGGLE_STAT: rc = 1; break; default: rc = 0; break; } return rc; } static const struct power_supply_desc usb_main_psy_desc = { .name = "main", .type = POWER_SUPPLY_TYPE_MAIN, Loading @@ -799,6 +823,7 @@ static const struct power_supply_desc usb_main_psy_desc = { .num_properties = ARRAY_SIZE(smb2_usb_main_props), .get_property = smb2_usb_main_get_prop, .set_property = smb2_usb_main_set_prop, .property_is_writeable = smb2_usb_main_prop_is_writeable, }; static int smb2_init_usb_main_psy(struct smb2 *chip) Loading