]> git.baikalelectronics.ru Git - uboot.git/commit
usb: dwc2: Avoid delay when initializing USB peripheral by dwc2
authorJoão Loureiro <joaofl@gmail.com>
Wed, 17 Mar 2021 15:52:21 +0000 (16:52 +0100)
committerMarek Vasut <marex@denx.de>
Wed, 9 Jun 2021 08:54:26 +0000 (10:54 +0200)
commit8224d5c888153c2f01f4b054db1e7173adf4b0e4
tree67f60ff5b88a5d31f803e81f39608443b61009f6
parent3307a3fc25fb6a27bfd79cb21646aad423ab887f
usb: dwc2: Avoid delay when initializing USB peripheral by dwc2

When `usb start` is called on the terminal, the dwc2 driver will try
to start every USB device as host first, even if it is explicitly
configured as peripheral in the device tree (dr_mode = "peripheral").

So to avoid an unwanted 15 seconds delay when initializing the usb
(one second per channel = 1s x 15), this patch adds a check to the
initialization, and will skip host initialization of the device is
explicitly set as peripheral. The checking is already done similarly
in the `drivers/usb/gadget/dwc2_udc_otg.c` driver.

Signed-off-by: João Loureiro <joaofl@gmail.com>
drivers/usb/host/dwc2.c