usb: gadget: udc: renesas_usb3: add support for usb role swap
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Fri, 31 Mar 2017 03:58:05 +0000 (12:58 +0900)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Tue, 11 Apr 2017 07:58:25 +0000 (10:58 +0300)
commitcc995c9ec1184b964ffdf8cf242250bb4319cd91
tree69d0e3d69df2de48201d6d490565f254f8b05630
parentfbf4987ae892619853e46c19df109d86f25eb5a3
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>
Documentation/ABI/testing/sysfs-platform-renesas_usb3 [new file with mode: 0644]
drivers/usb/gadget/udc/renesas_usb3.c