]> git.baikalelectronics.ru Git - uboot.git/commit
usb: dwc3-generic: Relax unsupported dr_mode check
authorJonas Karlman <jonas@kwiboo.se>
Sun, 30 Jul 2023 22:59:56 +0000 (22:59 +0000)
committerKever Yang <kever.yang@rock-chips.com>
Mon, 31 Jul 2023 06:40:38 +0000 (14:40 +0800)
commit26f3a34bb4ab63e087c305758e3c31b6f3009a67
tree4e6905d43940410e713b22fcd0a26a252225791c
parent14feefd848809a40fa9a387449ec2fcfad378767
usb: dwc3-generic: Relax unsupported dr_mode check

When dr_mode is peripheral or otg and U-Boot has not been built with
DM_USB_GADGET support, booting such device may end up with:

  dwc3_glue_bind_common: subnode name: usb@fcc00000
  Error binding driver 'dwc3-generic-wrapper': -6
  Some drivers failed to bind
  initcall sequence 00000000effbca08 failed at call 0000000000a217c8 (err=-6)
  ### ERROR ### Please RESET the board ###

Instead fail gracfully with ENODEV to allow board continue booting.

  dwc3_glue_bind_common: subnode name: usb@fcc00000
  dwc3_glue_bind_common: unsupported dr_mode 3

Also use CONFIG_IS_ENABLED(USB_HOST) and change switch to if statements
to improve readability of the code.

Fixes: 82d6fc767a90 ("dwc3-generic: Handle the PHYs, the clocks and the reset lines")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Marek Vasut <marex@denx.de>
drivers/usb/dwc3/dwc3-generic.c