Loading Documentation/devicetree/bindings/power/supply/qcom/qpnp-smb5.txt +12 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,18 @@ Charger specific properties: addition battery properties will be faked such that the device assumes normal operation. - qcom,charger-temp-max Usage: optional Value type: <u32> Definition: Specifies the charger temp REG_H_THRESHOLD for PM8150B in deciDegC. If the value is not present, use the setting read from the device. - qcom,smb-temp-max Usage: optional Value type: <u32> Definition: Specifies the charger temp REG_H_THRESHOLD for SMB1355 in deciDegC. If the value is not present, use the setting read from the device. - qcom,fcc-max-ua Usage: optional Value type: <u32> Loading arch/arm64/boot/dts/qcom/pm8150b.dtsi +3 −0 Original line number Diff line number Diff line Loading @@ -169,6 +169,9 @@ qcom,pmic-revid = <&pm8150b_revid>; qcom,charger-temp-max = <800>; qcom,smb-temp-max = <800>; qcom,chgr@1000 { reg = <0x1000 0x100>; interrupts = Loading drivers/power/supply/qcom/qpnp-smb5.c +19 −5 Original line number Diff line number Diff line Loading @@ -376,6 +376,16 @@ static int smb5_parse_dt(struct smb5 *chip) } } rc = of_property_read_u32(node, "qcom,charger-temp-max", &chg->charger_temp_max); if (rc < 0) chg->charger_temp_max = -EINVAL; rc = of_property_read_u32(node, "qcom,smb-temp-max", &chg->smb_temp_max); if (rc < 0) chg->smb_temp_max = -EINVAL; rc = of_property_read_u32(node, "qcom,float-option", &chip->dt.float_option); if (!rc && (chip->dt.float_option < 0 || chip->dt.float_option > 4)) { Loading Loading @@ -1606,12 +1616,16 @@ static int smb5_init_hw(struct smb5 *chip) smblib_get_charge_param(chg, &chg->param.usb_icl, &chg->default_icl_ua); rc = smblib_get_thermal_threshold(chg, DIE_REG_H_THRESHOLD_MSB_REG, if (chg->charger_temp_max == -EINVAL) { rc = smblib_get_thermal_threshold(chg, DIE_REG_H_THRESHOLD_MSB_REG, &chg->charger_temp_max); if (rc < 0) { dev_err(chg->dev, "Couldn't get charger_temp_max rc=%d\n", rc); dev_err(chg->dev, "Couldn't get charger_temp_max rc=%d\n", rc); return rc; } } /* Disable SMB Temperature ADC INT */ rc = smblib_masked_write(chg, MISC_THERMREG_SRC_CFG_REG, Loading drivers/power/supply/qcom/smb5-lib.c +19 −11 Original line number Diff line number Diff line Loading @@ -3855,13 +3855,18 @@ static void pl_update_work(struct work_struct *work) pl_update_work); int rc; rc = smblib_get_thermal_threshold(chg, SMB_REG_H_THRESHOLD_MSB_REG, &prop_val.intval); if (chg->smb_temp_max == -EINVAL) { rc = smblib_get_thermal_threshold(chg, SMB_REG_H_THRESHOLD_MSB_REG, &chg->smb_temp_max); if (rc < 0) { dev_err(chg->dev, "Couldn't get charger_temp_max rc=%d\n", rc); dev_err(chg->dev, "Couldn't get charger_temp_max rc=%d\n", rc); return; } } prop_val.intval = chg->smb_temp_max; rc = power_supply_set_property(chg->pl.psy, POWER_SUPPLY_PROP_CHARGER_TEMP_MAX, &prop_val); Loading Loading @@ -4174,15 +4179,18 @@ int smblib_init(struct smb_charger *chg) } } if (chg->smb_temp_max == -EINVAL) { rc = smblib_get_thermal_threshold(chg, SMB_REG_H_THRESHOLD_MSB_REG, &prop_val.intval); &chg->smb_temp_max); if (rc < 0) { dev_err(chg->dev, "Couldn't get charger_temp_max rc=%d\n", rc); return rc; } } prop_val.intval = chg->smb_temp_max; rc = power_supply_set_property(chg->pl.psy, POWER_SUPPLY_PROP_CHARGER_TEMP_MAX, &prop_val); Loading drivers/power/supply/qcom/smb5-lib.h +1 −0 Original line number Diff line number Diff line Loading @@ -362,6 +362,7 @@ struct smb_charger { enum sink_src_mode sink_src_mode; bool jeita_configured; int charger_temp_max; int smb_temp_max; /* workaround flag */ u32 wa_flags; Loading Loading
Documentation/devicetree/bindings/power/supply/qcom/qpnp-smb5.txt +12 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,18 @@ Charger specific properties: addition battery properties will be faked such that the device assumes normal operation. - qcom,charger-temp-max Usage: optional Value type: <u32> Definition: Specifies the charger temp REG_H_THRESHOLD for PM8150B in deciDegC. If the value is not present, use the setting read from the device. - qcom,smb-temp-max Usage: optional Value type: <u32> Definition: Specifies the charger temp REG_H_THRESHOLD for SMB1355 in deciDegC. If the value is not present, use the setting read from the device. - qcom,fcc-max-ua Usage: optional Value type: <u32> Loading
arch/arm64/boot/dts/qcom/pm8150b.dtsi +3 −0 Original line number Diff line number Diff line Loading @@ -169,6 +169,9 @@ qcom,pmic-revid = <&pm8150b_revid>; qcom,charger-temp-max = <800>; qcom,smb-temp-max = <800>; qcom,chgr@1000 { reg = <0x1000 0x100>; interrupts = Loading
drivers/power/supply/qcom/qpnp-smb5.c +19 −5 Original line number Diff line number Diff line Loading @@ -376,6 +376,16 @@ static int smb5_parse_dt(struct smb5 *chip) } } rc = of_property_read_u32(node, "qcom,charger-temp-max", &chg->charger_temp_max); if (rc < 0) chg->charger_temp_max = -EINVAL; rc = of_property_read_u32(node, "qcom,smb-temp-max", &chg->smb_temp_max); if (rc < 0) chg->smb_temp_max = -EINVAL; rc = of_property_read_u32(node, "qcom,float-option", &chip->dt.float_option); if (!rc && (chip->dt.float_option < 0 || chip->dt.float_option > 4)) { Loading Loading @@ -1606,12 +1616,16 @@ static int smb5_init_hw(struct smb5 *chip) smblib_get_charge_param(chg, &chg->param.usb_icl, &chg->default_icl_ua); rc = smblib_get_thermal_threshold(chg, DIE_REG_H_THRESHOLD_MSB_REG, if (chg->charger_temp_max == -EINVAL) { rc = smblib_get_thermal_threshold(chg, DIE_REG_H_THRESHOLD_MSB_REG, &chg->charger_temp_max); if (rc < 0) { dev_err(chg->dev, "Couldn't get charger_temp_max rc=%d\n", rc); dev_err(chg->dev, "Couldn't get charger_temp_max rc=%d\n", rc); return rc; } } /* Disable SMB Temperature ADC INT */ rc = smblib_masked_write(chg, MISC_THERMREG_SRC_CFG_REG, Loading
drivers/power/supply/qcom/smb5-lib.c +19 −11 Original line number Diff line number Diff line Loading @@ -3855,13 +3855,18 @@ static void pl_update_work(struct work_struct *work) pl_update_work); int rc; rc = smblib_get_thermal_threshold(chg, SMB_REG_H_THRESHOLD_MSB_REG, &prop_val.intval); if (chg->smb_temp_max == -EINVAL) { rc = smblib_get_thermal_threshold(chg, SMB_REG_H_THRESHOLD_MSB_REG, &chg->smb_temp_max); if (rc < 0) { dev_err(chg->dev, "Couldn't get charger_temp_max rc=%d\n", rc); dev_err(chg->dev, "Couldn't get charger_temp_max rc=%d\n", rc); return; } } prop_val.intval = chg->smb_temp_max; rc = power_supply_set_property(chg->pl.psy, POWER_SUPPLY_PROP_CHARGER_TEMP_MAX, &prop_val); Loading Loading @@ -4174,15 +4179,18 @@ int smblib_init(struct smb_charger *chg) } } if (chg->smb_temp_max == -EINVAL) { rc = smblib_get_thermal_threshold(chg, SMB_REG_H_THRESHOLD_MSB_REG, &prop_val.intval); &chg->smb_temp_max); if (rc < 0) { dev_err(chg->dev, "Couldn't get charger_temp_max rc=%d\n", rc); return rc; } } prop_val.intval = chg->smb_temp_max; rc = power_supply_set_property(chg->pl.psy, POWER_SUPPLY_PROP_CHARGER_TEMP_MAX, &prop_val); Loading
drivers/power/supply/qcom/smb5-lib.h +1 −0 Original line number Diff line number Diff line Loading @@ -362,6 +362,7 @@ struct smb_charger { enum sink_src_mode sink_src_mode; bool jeita_configured; int charger_temp_max; int smb_temp_max; /* workaround flag */ u32 wa_flags; Loading