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:
Jack Pham <jackp@codeaurora.org>
Loading
Please register or sign in to comment