Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c6ff3a72 authored by Jack Pham's avatar Jack Pham
Browse files

usb: phy-msm-usb: Fix reporting of POWER_SUPPLY_PROP_PRESENT



Currently when querying the usb power_supply property for PROP_PRESENT
it returns the value given by PROP_ONLINE, which indicates whether
the USB peripheral has enumerated or not. This is incorrect and should
instead reflect the state of the USB cable connection (VBUS indication)
irrespective of enumeration state.

Change-Id: I8292cbad36fd4a88e97d97f0c350a21d924bca10
Signed-off-by: default avatarJack Pham <jackp@codeaurora.org>
parent 0cabfa0f
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -3701,8 +3701,10 @@ static int otg_power_get_property_usb(struct power_supply *psy,
	case POWER_SUPPLY_PROP_CURRENT_MAX:
		val->intval = motg->current_max;
		break;
	/* Reflect USB enumeration */
	case POWER_SUPPLY_PROP_PRESENT:
		val->intval = !!test_bit(B_SESS_VLD, &motg->inputs);
		break;
	/* Reflect USB enumeration */
	case POWER_SUPPLY_PROP_ONLINE:
		val->intval = motg->online;
		break;