usb: dwc3: rockchip-inno: support to set testmodes via debugfs
authorWilliam Wu <wulf@rock-chips.com>
Tue, 21 Feb 2017 12:16:33 +0000 (20:16 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Wed, 22 Feb 2017 06:19:19 +0000 (14:19 +0800)
commite1b26377c7422f90982a4ab2d8797947657002bb
tree23b9f7464f05f67154c65014c4d04d0cbec466b5
parent9053aa40d0532beeecc5c0a452c362ff408d839e
usb: dwc3: rockchip-inno: support to set testmodes via debugfs

This patch create host_testmode file in debugfs for
USB HOST. It's useful for us to use a scope to verify
signal integrity for USB2/USB3 HOST.

For example, set testmodes for rk3328 board USB:
1. set test packet for the USB2 port of USB3 interface:
   echo test_packet > /sys/kernel/debug/usb.23/host_testmode

2. set compliance mode for the USB3 port of USB3 interface:
   echo test_u3 > /sys/kernel/debug/usb.23/host_testmode

3. check the testmode status:
   cat /sys/kernel/debug/usb.23/host_testmode
   The log maybe like this:
   U2: test_packet     /* means that U2 in test mode */
   U3: compliance mode /* means that U3 in test mode */

Change-Id: I6ddead14a7b78a011bbffcec6bf865df0632fe1b
Signed-off-by: William Wu <wulf@rock-chips.com>
drivers/usb/dwc3/dwc3-rockchip-inno.c