Clear vbus present if wireless charger present

Clear vbus present if wireless charger present, as there is no
wired usb charger connected.

Change-Id: I2020465813d65b4c359070de90ba70f63867b18c
Signed-off-by: Yonghua Yan <yanyh2@motorola.com>
Reviewed-on: https://gerrit.mot.com/2728335
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
Yonghua Yan 2023-09-01 21:44:48 +08:00
commit 3170fa52ec
3 changed files with 12 additions and 4 deletions

View file

@ -736,8 +736,15 @@ static int qti_charger_get_chg_info(void *data, struct mmi_charger_info *chg_inf
if (!info.chrg_present && info.chrg_type != 0)
chg->chg_info.chrg_present = 1;
chg->chg_info.chrg_otg_enabled = info.chrg_otg_enabled;
chg->chg_info.vbus_present = chg->chg_info.chrg_mv > VBUS_MIN_MV;
if (chg->wls_psy) {
union power_supply_propval val;
rc = power_supply_get_property(chg->wls_psy,
POWER_SUPPLY_PROP_ONLINE, &val);
if (!rc && val.intval)
chg->chg_info.vbus_present = false;
}
chg->chg_info.chrg_otg_enabled = info.chrg_otg_enabled;
chg->chg_info.lpd_present = chg->lpd_info.lpd_present;
memcpy(chg_info, &chg->chg_info, sizeof(struct mmi_charger_info));

View file

@ -1525,13 +1525,14 @@ static int sc760x_charger_get_chg_info(void *data, struct mmi_charger_info *chg_
chg->chg_info.chrg_mv = state.vbus_adc / 1000;
chg->chg_info.chrg_ma = state.ibus_adc / 1000;
chg->chg_info.chrg_type = get_charger_type(chg->sc);
chg->chg_info.vbus_present = state.online;
if (chg->chg_info.chrg_type == POWER_SUPPLY_USB_TYPE_UNKNOWN &&
is_wls_online(chg->sc)) {
chg->chg_info.chrg_type = 0xFF;
chg->chg_info.vbus_present = false;
}
chg->chg_info.chrg_present = state.online;
chg->chg_info.vbus_present = state.online;
chg->chg_info.chrg_pmax_mw = 0;
memcpy(chg_info, &chg->chg_info, sizeof(struct mmi_charger_info));

View file

@ -2400,13 +2400,13 @@ static int sgm4154x_charger_get_chg_info(void *data, struct mmi_charger_info *ch
chg->chg_info.chrg_mv = state.vbus_adc / 1000;
chg->chg_info.chrg_ma = state.ibus_adc / 1000;
chg->chg_info.chrg_type = get_charger_type(chg->sgm);
chg->chg_info.vbus_present = state.vbus_gd;
if (chg->chg_info.chrg_type == POWER_SUPPLY_USB_TYPE_UNKNOWN &&
is_wls_online(chg->sgm)) {
chg->chg_info.chrg_type = SGM4154x_WLS_TYPE;
chg->chg_info.vbus_present = false;
}
chg->chg_info.chrg_present = state.online;
chg->chg_info.vbus_present = state.vbus_gd;
if (state.ibus_limit > 0) {
ret = sgm4154x_get_input_curr_lim(chg->sgm);