Loading Documentation/devicetree/bindings/power/supply/qcom/qpnp-smb2.txt +12 −0 Original line number Diff line number Diff line Loading @@ -169,6 +169,18 @@ Charger specific properties: Definition: Boolean flag which when present enables intput 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. ============================================= Second Level Nodes - SMB2 Charger Peripherals ============================================= Loading drivers/power/supply/qcom/qpnp-smb2.c +24 −0 Original line number Diff line number Diff line Loading @@ -244,6 +244,8 @@ struct smb_dt_props { int boost_threshold_ua; int fv_uv; int wipower_max_uw; int min_freq_khz; int max_freq_khz; u32 step_soc_threshold[STEP_CHARGING_MAX_STEPS - 1]; s32 step_cc_delta[STEP_CHARGING_MAX_STEPS]; struct device_node *revid_dev_node; Loading Loading @@ -338,6 +340,18 @@ static int smb2_parse_dt(struct smb2 *chip) if (rc < 0) chip->dt.boost_threshold_ua = MICRO_P1A; rc = of_property_read_u32(node, "qcom,min-freq-khz", &chip->dt.min_freq_khz); if (rc < 0) chip->dt.min_freq_khz = -EINVAL; rc = of_property_read_u32(node, "qcom,max-freq-khz", &chip->dt.max_freq_khz); if (rc < 0) chip->dt.max_freq_khz = -EINVAL; rc = of_property_read_u32(node, "qcom,wipower-max-uw", &chip->dt.wipower_max_uw); if (rc < 0) Loading Loading @@ -1438,6 +1452,16 @@ static int smb2_init_hw(struct smb2 *chip) smblib_get_charge_param(chg, &chg->param.dc_icl, &chip->dt.dc_icl_ua); if (chip->dt.min_freq_khz > 0) { chg->param.freq_buck.min_u = chip->dt.min_freq_khz; chg->param.freq_boost.min_u = chip->dt.min_freq_khz; } if (chip->dt.max_freq_khz > 0) { chg->param.freq_buck.max_u = chip->dt.max_freq_khz; chg->param.freq_boost.max_u = chip->dt.max_freq_khz; } /* set a slower soft start setting for OTG */ rc = smblib_masked_write(chg, DC_ENG_SSUPPLY_CFG2_REG, ENG_SSUPPLY_IVREF_OTG_SS_MASK, OTG_SS_SLOW); Loading drivers/power/supply/qcom/smb-lib.c +3 −1 Original line number Diff line number Diff line Loading @@ -3578,6 +3578,8 @@ static void typec_source_insertion(struct smb_charger *chg) && !is_client_vote_enabled(chg->usb_icl_votable, PD_VOTER) && !is_client_vote_enabled(chg->usb_icl_votable, USB_PSY_VOTER)) vote(chg->usb_icl_votable, LEGACY_UNKNOWN_VOTER, true, 100000); smblib_set_opt_freq_buck(chg, chg->chg_freq.freq_5V); } static void typec_sink_insertion(struct smb_charger *chg) Loading Loading @@ -3653,8 +3655,8 @@ static void smblib_handle_typec_insertion(struct smb_charger *chg, typec_source_removal(chg); typec_sink_insertion(chg); } else { typec_source_insertion(chg); typec_sink_removal(chg); typec_source_insertion(chg); } rp = smblib_get_prop_ufp_mode(chg); Loading Loading
Documentation/devicetree/bindings/power/supply/qcom/qpnp-smb2.txt +12 −0 Original line number Diff line number Diff line Loading @@ -169,6 +169,18 @@ Charger specific properties: Definition: Boolean flag which when present enables intput 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. ============================================= Second Level Nodes - SMB2 Charger Peripherals ============================================= Loading
drivers/power/supply/qcom/qpnp-smb2.c +24 −0 Original line number Diff line number Diff line Loading @@ -244,6 +244,8 @@ struct smb_dt_props { int boost_threshold_ua; int fv_uv; int wipower_max_uw; int min_freq_khz; int max_freq_khz; u32 step_soc_threshold[STEP_CHARGING_MAX_STEPS - 1]; s32 step_cc_delta[STEP_CHARGING_MAX_STEPS]; struct device_node *revid_dev_node; Loading Loading @@ -338,6 +340,18 @@ static int smb2_parse_dt(struct smb2 *chip) if (rc < 0) chip->dt.boost_threshold_ua = MICRO_P1A; rc = of_property_read_u32(node, "qcom,min-freq-khz", &chip->dt.min_freq_khz); if (rc < 0) chip->dt.min_freq_khz = -EINVAL; rc = of_property_read_u32(node, "qcom,max-freq-khz", &chip->dt.max_freq_khz); if (rc < 0) chip->dt.max_freq_khz = -EINVAL; rc = of_property_read_u32(node, "qcom,wipower-max-uw", &chip->dt.wipower_max_uw); if (rc < 0) Loading Loading @@ -1438,6 +1452,16 @@ static int smb2_init_hw(struct smb2 *chip) smblib_get_charge_param(chg, &chg->param.dc_icl, &chip->dt.dc_icl_ua); if (chip->dt.min_freq_khz > 0) { chg->param.freq_buck.min_u = chip->dt.min_freq_khz; chg->param.freq_boost.min_u = chip->dt.min_freq_khz; } if (chip->dt.max_freq_khz > 0) { chg->param.freq_buck.max_u = chip->dt.max_freq_khz; chg->param.freq_boost.max_u = chip->dt.max_freq_khz; } /* set a slower soft start setting for OTG */ rc = smblib_masked_write(chg, DC_ENG_SSUPPLY_CFG2_REG, ENG_SSUPPLY_IVREF_OTG_SS_MASK, OTG_SS_SLOW); Loading
drivers/power/supply/qcom/smb-lib.c +3 −1 Original line number Diff line number Diff line Loading @@ -3578,6 +3578,8 @@ static void typec_source_insertion(struct smb_charger *chg) && !is_client_vote_enabled(chg->usb_icl_votable, PD_VOTER) && !is_client_vote_enabled(chg->usb_icl_votable, USB_PSY_VOTER)) vote(chg->usb_icl_votable, LEGACY_UNKNOWN_VOTER, true, 100000); smblib_set_opt_freq_buck(chg, chg->chg_freq.freq_5V); } static void typec_sink_insertion(struct smb_charger *chg) Loading Loading @@ -3653,8 +3655,8 @@ static void smblib_handle_typec_insertion(struct smb_charger *chg, typec_source_removal(chg); typec_sink_insertion(chg); } else { typec_source_insertion(chg); typec_sink_removal(chg); typec_source_insertion(chg); } rp = smblib_get_prop_ufp_mode(chg); Loading