-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
usb: phy: Dual role sysfs class definition
This CL adds a new class to monitor and change dual role usb ports from userspace. The usb phy drivers can register to the dual_role_usb class and expose the capabilities of the ports. The phy drivers can decide on whether a specific attribute can be changed from userspace by choosing to implement the appropriate callback. Signed-off-by: Badhri Jagan Sridharan <[email protected]> Bug: 21615151 Change-Id: I121b4a94437972b5abe8f781e3007efa8531978
- Loading branch information
Showing
5 changed files
with
738 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
What: /sys/class/dual_role_usb/.../ | ||
Date: June 2015 | ||
Contact: Badhri Jagan Sridharan<[email protected]> | ||
Description: | ||
Provide a generic interface to monitor and change | ||
the state of dual role usb ports. The name here | ||
refers to the name mentioned in the | ||
dual_role_phy_desc that is passed while registering | ||
the dual_role_phy_intstance through | ||
devm_dual_role_instance_register. | ||
|
||
What: /sys/class/dual_role_usb/.../supported_modes | ||
Date: June 2015 | ||
Contact: Badhri Jagan Sridharan<[email protected]> | ||
Description: | ||
This is a static node, once initialized this | ||
is not expected to change during runtime. "dfp" | ||
refers to "downstream facing port" i.e. port can | ||
only act as host. "ufp" refers to "upstream | ||
facing port" i.e. port can only act as device. | ||
"dfp ufp" refers to "dual role port" i.e. the port | ||
can either be a host port or a device port. | ||
|
||
What: /sys/class/dual_role_usb/.../mode | ||
Date: June 2015 | ||
Contact: Badhri Jagan Sridharan<[email protected]> | ||
Description: | ||
The mode node refers to the current mode in which the | ||
port is operating. "dfp" for host ports. "ufp" for device | ||
ports and "none" when cable is not connected. | ||
|
||
On devices where the USB mode is software-controllable, | ||
userspace can change the mode by writing "dfp" or "ufp". | ||
On devices where the USB mode is fixed in hardware, | ||
this attribute is read-only. | ||
|
||
What: /sys/class/dual_role_usb/.../power_role | ||
Date: June 2015 | ||
Contact: Badhri Jagan Sridharan<[email protected]> | ||
Description: | ||
The power_role node mentions whether the port | ||
is "sink"ing or "source"ing power. "none" if | ||
they are not connected. | ||
|
||
On devices implementing USB Power Delivery, | ||
userspace can control the power role by writing "sink" or | ||
"source". On devices without USB-PD, this attribute is | ||
read-only. | ||
|
||
What: /sys/class/dual_role_usb/.../data_role | ||
Date: June 2015 | ||
Contact: Badhri Jagan Sridharan<[email protected]> | ||
Description: | ||
The data_role node mentions whether the port | ||
is acting as "host" or "device" for USB data connection. | ||
"none" if there is no active data link. | ||
|
||
On devices implementing USB Power Delivery, userspace | ||
can control the data role by writing "host" or "device". | ||
On devices without USB-PD, this attribute is read-only | ||
|
||
What: /sys/class/dual_role_usb/.../powers_vconn | ||
Date: June 2015 | ||
Contact: Badhri Jagan Sridharan<[email protected]> | ||
Description: | ||
The powers_vconn node mentions whether the port | ||
is supplying power for VCONN pin. | ||
|
||
On devices with software control of VCONN, | ||
userspace can disable the power supply to VCONN by writing "n", | ||
or enable the power supply by writing "y". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.