Merge "power: qpnp-smb5: add property to show fake charging status"

This commit is contained in:
qctecmdr
2020-07-03 01:30:47 -07:00
committed by Gerrit - the friendly Code Review server
3 changed files with 16 additions and 0 deletions

View File

@@ -549,6 +549,9 @@ static int smb5_parse_dt(struct smb5 *chip)
chg->suspend_input_on_debug_batt = of_property_read_bool(node,
"qcom,suspend-input-on-debug-batt");
chg->fake_chg_status_on_debug_batt = of_property_read_bool(node,
"qcom,fake-chg-status-on-debug-batt");
rc = of_property_read_u32(node, "qcom,otg-deglitch-time-ms",
&chg->otg_delay_ms);
if (rc < 0)

View File

@@ -1954,6 +1954,18 @@ int smblib_get_prop_batt_status(struct smb_charger *chg,
u8 stat;
int rc, suspend = 0;
if (chg->fake_chg_status_on_debug_batt) {
rc = smblib_get_prop_from_bms(chg,
POWER_SUPPLY_PROP_DEBUG_BATTERY, &pval);
if (rc < 0) {
pr_err_ratelimited("Couldn't get debug battery prop rc=%d\n",
rc);
} else if (pval.intval == 1) {
val->intval = POWER_SUPPLY_STATUS_UNKNOWN;
return 0;
}
}
if (chg->dbc_usbov) {
rc = smblib_get_prop_usb_present(chg, &pval);
if (rc < 0) {

View File

@@ -514,6 +514,7 @@ struct smb_charger {
int connector_type;
bool otg_en;
bool suspend_input_on_debug_batt;
bool fake_chg_status_on_debug_batt;
int default_icl_ua;
int otg_cl_ua;
bool uusb_apsd_rerun_done;