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

Commit 18da0833 authored by Jack Pham's avatar Jack Pham
Browse files

usb: pd: Handle PD_ALLOWED within state machine



Charger may be able to detect a legacy cable connection in which
PD is not supported however the state machine still needs to
run in order to send the EXTCON_USB notification to start the
USB controller in peripheral mode (assuming type is SDP or CDP).
Move checking of PD_ALLOWED to the state machine which can be used
to determine if moving beyond PE_SNK_STARTUP is allowed or not.

The psy_changed() callback should only queue the work when either
typec_mode or pd_allowed states have changed. Also move handling
of the in_pr_swap flag to this function by absorbing the
disconnect callback and clearing the flag when CC state indicates
it is reconnected.

Change-Id: I8879699531a49915e7286e4a166944709076fbd1
Signed-off-by: default avatarJack Pham <jackp@codeaurora.org>
parent 5b100713
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment