Loading drivers/power/supply/qcom/battery.h +2 −1 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2017, 2019 The Linux Foundation. All rights reserved. * Copyright (c) 2017, 2019-2020 The Linux Foundation. All rights reserved. */ #ifndef __BATTERY_H Loading @@ -10,6 +10,7 @@ struct charger_param { u32 fcc_step_delay_ms; u32 fcc_step_size_ua; u32 smb_version; u32 hvdcp2_max_icl_ua; u32 hvdcp3_max_icl_ua; u32 forced_main_fcc; }; Loading drivers/power/supply/qcom/qpnp-smb5.c +5 −0 Original line number Diff line number Diff line Loading @@ -600,6 +600,11 @@ static int smb5_parse_dt_misc(struct smb5 *chip, struct device_node *node) if (chg->chg_param.hvdcp3_max_icl_ua <= 0) chg->chg_param.hvdcp3_max_icl_ua = MICRO_3PA; of_property_read_u32(node, "qcom,hvdcp2-max-icl-ua", &chg->chg_param.hvdcp2_max_icl_ua); if (chg->chg_param.hvdcp2_max_icl_ua <= 0) chg->chg_param.hvdcp2_max_icl_ua = MICRO_3PA; return 0; } Loading drivers/power/supply/qcom/smb5-lib.c +8 −1 Original line number Diff line number Diff line Loading @@ -5522,16 +5522,23 @@ static void smblib_handle_hvdcp_3p0_auth_done(struct smb_charger *chg, static void smblib_handle_hvdcp_check_timeout(struct smb_charger *chg, bool rising, bool qc_charger) { u32 hvdcp_ua = 0; if (rising) { if (qc_charger) { hvdcp_ua = (chg->real_charger_type == POWER_SUPPLY_TYPE_USB_HVDCP) ? chg->chg_param.hvdcp2_max_icl_ua : HVDCP_CURRENT_UA; /* enable HDC and ICL irq for QC2/3 charger */ vote(chg->limited_irq_disable_votable, CHARGER_TYPE_VOTER, false, 0); vote(chg->hdc_irq_disable_votable, CHARGER_TYPE_VOTER, false, 0); vote(chg->usb_icl_votable, SW_ICL_MAX_VOTER, true, HVDCP_CURRENT_UA); hvdcp_ua); } else { /* A plain DCP, enforce DCP ICL if specified */ vote(chg->usb_icl_votable, DCP_VOTER, Loading Loading
drivers/power/supply/qcom/battery.h +2 −1 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2017, 2019 The Linux Foundation. All rights reserved. * Copyright (c) 2017, 2019-2020 The Linux Foundation. All rights reserved. */ #ifndef __BATTERY_H Loading @@ -10,6 +10,7 @@ struct charger_param { u32 fcc_step_delay_ms; u32 fcc_step_size_ua; u32 smb_version; u32 hvdcp2_max_icl_ua; u32 hvdcp3_max_icl_ua; u32 forced_main_fcc; }; Loading
drivers/power/supply/qcom/qpnp-smb5.c +5 −0 Original line number Diff line number Diff line Loading @@ -600,6 +600,11 @@ static int smb5_parse_dt_misc(struct smb5 *chip, struct device_node *node) if (chg->chg_param.hvdcp3_max_icl_ua <= 0) chg->chg_param.hvdcp3_max_icl_ua = MICRO_3PA; of_property_read_u32(node, "qcom,hvdcp2-max-icl-ua", &chg->chg_param.hvdcp2_max_icl_ua); if (chg->chg_param.hvdcp2_max_icl_ua <= 0) chg->chg_param.hvdcp2_max_icl_ua = MICRO_3PA; return 0; } Loading
drivers/power/supply/qcom/smb5-lib.c +8 −1 Original line number Diff line number Diff line Loading @@ -5522,16 +5522,23 @@ static void smblib_handle_hvdcp_3p0_auth_done(struct smb_charger *chg, static void smblib_handle_hvdcp_check_timeout(struct smb_charger *chg, bool rising, bool qc_charger) { u32 hvdcp_ua = 0; if (rising) { if (qc_charger) { hvdcp_ua = (chg->real_charger_type == POWER_SUPPLY_TYPE_USB_HVDCP) ? chg->chg_param.hvdcp2_max_icl_ua : HVDCP_CURRENT_UA; /* enable HDC and ICL irq for QC2/3 charger */ vote(chg->limited_irq_disable_votable, CHARGER_TYPE_VOTER, false, 0); vote(chg->hdc_irq_disable_votable, CHARGER_TYPE_VOTER, false, 0); vote(chg->usb_icl_votable, SW_ICL_MAX_VOTER, true, HVDCP_CURRENT_UA); hvdcp_ua); } else { /* A plain DCP, enforce DCP ICL if specified */ vote(chg->usb_icl_votable, DCP_VOTER, Loading