]> git.dujemihanovic.xyz Git - u-boot.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)
commit6913c30516022f86104c9fbe315499e43eee4ed6
tree4e6905d43940410e713b22fcd0a26a252225791c
parent4412a2bf0b674d7438821531a0a19bbcd4b80eda
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: 446e3a205b87 ("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