power: qpnp-smb2: Unset ONLINE for UNKNOWN USB charger type

Currently, USB power_supply POWER_SUPPLY_PROP_ONLINE property will be
set if the charger type is POWER_SUPPLY_TYPE_UNKNOWN which is not
expected. Unset ONLINE for UNKNOWN USB charger type.

CRs-Fixed: 2065139
Change-Id: Ibc40ee62b2d95c319a7fe34b17813c2b57518f67
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
This commit is contained in:
Fenglin Wu 2017-06-22 12:30:33 +08:00
parent 560a996da5
commit dd1a56d034

View file

@ -461,6 +461,8 @@ static int smb2_usb_get_prop(struct power_supply *psy,
val->intval = 0;
else
val->intval = 1;
if (chg->real_charger_type == POWER_SUPPLY_TYPE_UNKNOWN)
val->intval = 0;
break;
case POWER_SUPPLY_PROP_VOLTAGE_MIN:
val->intval = chg->voltage_min_uv;