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

Skip to content
Commit e232bdee authored by Jack Pham's avatar Jack Pham
Browse files

usb: pd: Determine dual_role writeable based on PD capability



Allowing 'data_role' and 'power_role' sysfs attributes to
be writeable implies that they can be changed independently.
This is only true if there is a PD-capable device attached,
otherwise the write permission should not be set.

Also make sure to call dual_role_instance_changed() at the
conclusion of initiating a DR swap in order to trigger the
is_writeable() callback to update the permissions. Note that
the PR swap case is already handled during the call to
usbpd_set_state(PE_{SRC,SNK}_READY).

Change-Id: I3f4bcaa8ae32af9a124e6f0967509c784e776f7d
Signed-off-by: default avatarJack Pham <jackp@codeaurora.org>
parent 757ecb71
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