add lpd and vbus present state

Save lpd and vbus present state in charger info data
structure.

Change-Id: Ic2ee432ff24669ae9d9412c8efdc58297fecb40c
Signed-off-by: yanyh2 <yanyh2@motorola.com>
Reviewed-on: https://gerrit.mot.com/2061925
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
yanyh2 2021-09-08 16:38:57 +08:00 • committed by Yonghua Yan
commit 6949e07285

View file

@ -45,6 +45,8 @@
#define OEM_BM_ULOG_SIZE 4096
#define VBUS_MIN_MV 4000
static bool debug_enabled;
module_param(debug_enabled, bool, 0600);
MODULE_PARM_DESC(debug_enabled, "Enable debug for qti glink charger driver");
@ -472,6 +474,9 @@ static int qti_charger_get_chg_info(void *data, struct mmi_charger_info *chg_inf
if (!chg->chg_info.chrg_present &&
chg->chg_info.chrg_type != 0)
chg->chg_info.chrg_present = 1;
chg->chg_info.vbus_present = chg->chg_info.chrg_mv > VBUS_MIN_MV;
chg->chg_info.lpd_present = chg->lpd_info.lpd_present;
memcpy(chg_info, &chg->chg_info, sizeof(struct mmi_charger_info));
if (chrg_type != chg->chg_info.chrg_type ||