gemini: Add kernel v6.1 patches
[openwrt/openwrt.git] / target / linux / gemini / patches-6.1 / 0006-usb-fotg210-Fix-Kconfig-for-USB-host-modules.patch
1 From 6e002d41889bc52213a26ff91338d340505e0336 Mon Sep 17 00:00:00 2001
2 From: Linus Walleij <linus.walleij@linaro.org>
3 Date: Fri, 11 Nov 2022 15:48:21 +0100
4 Subject: [PATCH 06/29] usb: fotg210: Fix Kconfig for USB host modules
5
6 The kernel robot reports a link failure when activating the
7 FOTG210 host subdriver with =y on a system where the USB host
8 core is a module (CONFIG_USB=m).
9
10 This is a bit of special case, so mimic the Kconfig incantations
11 from DWC3: let the subdrivers for host or peripheral depend
12 on the host or gadget support being =y or the same as the
13 FOTG210 core itself.
14
15 This should ensure that either:
16
17 - The host (CONFIG_USB) or gadget (CONFIG_GADGET) is compiled
18 in and then the FOTG210 can be either module or compiled
19 in.
20
21 - The host or gadget is modular, and then the FOTG210 module
22 must be a module too, or we cannot resolve the symbols
23 at link time.
24
25 Reported-by: kernel test robot <lkp@intel.com>
26 Link: https://lore.kernel.org/linux-usb/202211112132.0BUPGKCd-lkp@intel.com/
27 Cc: Arnd Bergmann <arnd@arndb.de>
28 Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
29 Link: https://lore.kernel.org/r/20221111144821.113665-1-linus.walleij@linaro.org
30 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
31 ---
32 --- a/drivers/usb/fotg210/Kconfig
33 +++ b/drivers/usb/fotg210/Kconfig
34 @@ -14,7 +14,7 @@ if USB_FOTG210
35
36 config USB_FOTG210_HCD
37 bool "Faraday FOTG210 USB Host Controller support"
38 - depends on USB
39 + depends on USB=y || USB=USB_FOTG210
40 help
41 Faraday FOTG210 is an OTG controller which can be configured as
42 an USB2.0 host. It is designed to meet USB2.0 EHCI specification
43 @@ -24,7 +24,7 @@ config USB_FOTG210_HCD
44 module will be called fotg210-hcd.
45
46 config USB_FOTG210_UDC
47 - depends on USB_GADGET
48 + depends on USB_GADGET=y || USB_GADGET=USB_FOTG210
49 bool "Faraday FOTG210 USB Peripheral Controller support"
50 help
51 Faraday USB2.0 OTG controller which can be configured as