Commit 15e2d78
fwk: pd: fix profile restore when port role is swapped to source
When a port performs a Power Role Swap (PR_SWAP) and becomes
a source, previously, the code skipped profile evaluation for
all Source ports.
It may keep the other port limited to 1.5A output because the
previous logic only reduced the current on sink detection and
never restored it after a role change.
Behavior summary:
- [source, sink] → no change profile
- [source, nothing] → restore profile to default
- [source, source] → skip evaluation
This ensures correct power negotiation after PR_SWAP and
prevents the sink port from being stuck at 1.5A limit.
BRANCH=fwk-tulip-29169
BUG=https://app.clickup.com/t/86ev324ut
TEST= [Port1 (A device), Port2 (B device)]
1. Connect two pd device -> [3A, 1.5A]
2. A device connect AC [3A + AC, 1.5A] -> [SRC, keep 1.5A]
3. A device remove AC [SRC remove AC, 1.5A] -> [3A, keep 1.5A]
4. B device connect AC [3A, 1.5A + AC] -> [keep 3A, SRC]
5. B device remove AC [3A, SRC remove AC] -> [keep 3A, 1.5A]
6. A device disconnect [3A remove device, 1.5A] -> [Nothing, keep 1.5A]
7. A device connect [Nothing, 1.5A] -> [3A, 1.5A]
8. B device disconnect [3A, 1.5A remove device] -> [keep 3A, Nothing]
9. B device connect [3A, Nothing] -> [3A, 1.5A]
TEST=Connect the PD device (max operating current less than 1500mA) to port 0.
This device gets the 5V/3A PDO; And then connect the PD device (max
operating current is 3000mA) to port 1, the first device do the
re-negotiation to 5V/1.5A and the second device do the re-negotiation
to 5V/3A.
Signed-off-by: johnwc_yeh <JohnWC_Yeh@compal.com>1 parent 283a549 commit 15e2d78
1 file changed
+20
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
474 | 474 | | |
475 | 475 | | |
476 | 476 | | |
477 | | - | |
| 477 | + | |
478 | 478 | | |
479 | 479 | | |
| 480 | + | |
480 | 481 | | |
481 | 482 | | |
482 | 483 | | |
| |||
486 | 487 | | |
487 | 488 | | |
488 | 489 | | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | 490 | | |
494 | 491 | | |
495 | 492 | | |
496 | 493 | | |
497 | | - | |
498 | | - | |
499 | | - | |
500 | | - | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
501 | 507 | | |
502 | 508 | | |
503 | 509 | | |
| |||
539 | 545 | | |
540 | 546 | | |
541 | 547 | | |
542 | | - | |
| 548 | + | |
543 | 549 | | |
544 | 550 | | |
545 | 551 | | |
| |||
586 | 592 | | |
587 | 593 | | |
588 | 594 | | |
589 | | - | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
590 | 598 | | |
591 | 599 | | |
592 | | - | |
| 600 | + | |
593 | 601 | | |
594 | 602 | | |
595 | 603 | | |
| |||
0 commit comments