max77818-charger: add check for OTG mode when returning status_ex property
Ignore POGO connection state when in OTG mode, as the charger driver always reports CHGIN OK (aka. connected) when charger_mode = OTG Supplypull/10/head
parent
3e0b6b929a
commit
e2b3b99c8a
|
@ -598,8 +598,15 @@ static int max77818_charger_get_property(struct power_supply *psy,
|
||||||
val->intval = chg->charger_mode;
|
val->intval = chg->charger_mode;
|
||||||
break;
|
break;
|
||||||
case POWER_SUPPLY_PROP_STATUS_EX:
|
case POWER_SUPPLY_PROP_STATUS_EX:
|
||||||
val->intval = (max77818_charger_chgin_present(chg) |
|
if (chg->charger_mode == POWER_SUPPLY_MODE_OTG_SUPPLY)
|
||||||
(max77818_charger_wcin_present(chg) << 1));
|
/* Charger device reports CHGIN OK in OTG mode anyway,
|
||||||
|
* so just ignore this and report WCIN status only when
|
||||||
|
* in OTG mode (charging is off anyway)
|
||||||
|
*/
|
||||||
|
val->intval = (max77818_charger_wcin_present(chg) << 1);
|
||||||
|
else
|
||||||
|
val->intval = (max77818_charger_chgin_present(chg) |
|
||||||
|
(max77818_charger_wcin_present(chg) << 1));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
|
|
Loading…
Reference in New Issue