USB: pd: Send PS_RDY within tNewSrc after PS_RDY received
USBPD spec mentions max time within which device that transitions from sink power role to source needs to send PS_RDY message after PS_RDY received from other device as part of PR_SWAP. Currently USB PD driver is taking time around 380msec i.e greater than tNewSrc (275msec) and resulting in USB PD complaince test "2.2.3.1.2 Procedure/Checks for Tester (Source) Originated Swap" failure. Fix it by waiting only till VBUS voltage reaches VSafe5Vmin. Change-Id: I3138e6d31ba964507230fe5f914aaaf2e261647d Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
This commit is contained in:
parent
de5fd0b3ce
commit
16683815e8
1 changed files with 16 additions and 1 deletions
|
@ -1826,6 +1826,22 @@ enable_reg:
|
||||||
else
|
else
|
||||||
pd->vbus_enabled = true;
|
pd->vbus_enabled = true;
|
||||||
|
|
||||||
|
count = 10;
|
||||||
|
/*
|
||||||
|
* Check to make sure VBUS voltage reaches above Vsafe5Vmin (4.75v)
|
||||||
|
* before proceeding.
|
||||||
|
*/
|
||||||
|
while (count--) {
|
||||||
|
ret = power_supply_get_property(pd->usb_psy,
|
||||||
|
POWER_SUPPLY_PROP_VOLTAGE_NOW, &val);
|
||||||
|
if (ret || val.intval >= 4750000) /*vsafe5Vmin*/
|
||||||
|
break;
|
||||||
|
usleep_range(10000, 12000); /* Delay between two reads */
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ret)
|
||||||
|
msleep(100); /* Delay to wait for VBUS ramp up if read fails */
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2747,7 +2763,6 @@ static void usbpd_sm(struct work_struct *w)
|
||||||
|
|
||||||
case PE_PRS_SNK_SRC_SOURCE_ON:
|
case PE_PRS_SNK_SRC_SOURCE_ON:
|
||||||
enable_vbus(pd);
|
enable_vbus(pd);
|
||||||
msleep(200); /* allow time VBUS ramp-up, must be < tNewSrc */
|
|
||||||
|
|
||||||
ret = pd_send_msg(pd, MSG_PS_RDY, NULL, 0, SOP_MSG);
|
ret = pd_send_msg(pd, MSG_PS_RDY, NULL, 0, SOP_MSG);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue