forked from torvalds/linux
-
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.
phy: rcar-gen3-usb2: add sysfs for usb role swap
This patch adds sysfs "role" for usb role swap. This parameter can be read and write. If you use this file as the following, you can swap the usb role. For example: 1) Connect a usb cable using 2 Salvator-x boards 2) On A-Device (ID pin is low), you input the following command: # echo peripheral > /sys/devices/platform/soc/ee080200.usb-phy/role 3) On B-Device (ID pin is high), you input the following command: # echo host > /sys/devices/platform/soc/ee080200.usb-phy/role Then, the A-device acts as a peripheral and the B-device acts as a host. Please note that A-Device must input the following command if you want the board to act as a host again. (even if you disconnect the usb cable, since id state may be the same, the A-Device keeps to act as peripheral.) # echo host > /sys/devices/platform/soc/ee080200.usb-phy/role Signed-off-by: Yoshihiro Shimoda <[email protected]> Reviewed-by: Peter Chen <[email protected]> Signed-off-by: Kishon Vijay Abraham I <[email protected]>
- Loading branch information
Showing
2 changed files
with
132 additions
and
1 deletion.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
Documentation/ABI/testing/sysfs-platform-phy-rcar-gen3-usb2
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,15 @@ | ||
What: /sys/devices/platform/<phy-name>/role | ||
Date: October 2016 | ||
KernelVersion: 4.10 | ||
Contact: Yoshihiro Shimoda <[email protected]> | ||
Description: | ||
This file can be read and write. | ||
The file can show/change the phy mode for role swap of usb. | ||
|
||
Write the following strings to change the mode: | ||
"host" - switching mode from peripheral to host. | ||
"peripheral" - switching mode from host to peripheral. | ||
|
||
Read the file, then it shows the following strings: | ||
"host" - The mode is host now. | ||
"peripheral" - The mode is peripheral now. |
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