+21
−24
Loading
Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more
On newer PMICs forcing the current role prior to a PR Swap
causes the Type-C state machine to re-run. During this time
debounce is happening and PD PHY messages will fail to be
transmitted. This is remedied by first sending the Accept
message before setting PROP_PR_SWAP which temporarily reduces
debounce delay, so that then forcing role can happen in a
short time and not interfere with PD PHY operation.
While at it consolidate the handling of all of the above in the
PE_SRC_SNK_TRANSITION_TO_OFF and PE_SNK_SRC_TRANSITION_TO_OFF
cases in usbpd_set_state() to remove redundant code.
Change-Id: Id4d196d121a285cabedfff74aaa9768bb73595e4
Signed-off-by:
Jack Pham <jackp@codeaurora.org>