-
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: gadget: udc: renesas_usb3: add support for usb role swap
This patch adds support for usb role swap via sysfs "role". For example: 1) Connect a usb cable using 2 Salvator-X boards. - For A-Device, the cable is connected to CN11 (USB3.0 ch0). - For B-Device, the cable is connected to CN9 (USB2.0 ch0). 2) On A-Device, you input the following command: # echo peripheral > /sys/devices/platform/soc/ee020000.usb/role 3) On B-Device, 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. # echo host > /sys/devices/platform/soc/ee020000.usb/role Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
- Loading branch information
Yoshihiro Shimoda
authored and
Felipe Balbi
committed
Apr 11, 2017
1 parent
fbf4987
commit cc995c9
Showing
2 changed files
with
71 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,15 @@ | ||
What: /sys/devices/platform/<renesas_usb3's name>/role | ||
Date: March 2017 | ||
KernelVersion: 4.13 | ||
Contact: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> | ||
Description: | ||
This file can be read and write. | ||
The file can show/change the drd mode of usb. | ||
|
||
Write the following string 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