openwrt/target/linux/gemini/patches-6.1/0006-usb-fotg210-Fix-Kconfig-for-USB-host-modules.patch
Linus Walleij 58acb1dd2c gemini: Add kernel v6.1 patches
This adds a bunch of patches for the v6.1 Gemini kernel.

For v5.15 this was down to a single upstream patch, but for
kernel v6.2 I reworked the USB code for FOTG210, so instead of
carrying over the half-baked and incomplete patch from v5.15
I just backported all the v6.2 patches, 31 in total, as it
creates full device USB mode for e.g. D-Link DNS-313.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2023-06-01 23:54:20 +02:00

52 lines
1.9 KiB
Diff

From 6e002d41889bc52213a26ff91338d340505e0336 Mon Sep 17 00:00:00 2001
From: Linus Walleij <linus.walleij@linaro.org>
Date: Fri, 11 Nov 2022 15:48:21 +0100
Subject: [PATCH 06/29] usb: fotg210: Fix Kconfig for USB host modules
The kernel robot reports a link failure when activating the
FOTG210 host subdriver with =y on a system where the USB host
core is a module (CONFIG_USB=m).
This is a bit of special case, so mimic the Kconfig incantations
from DWC3: let the subdrivers for host or peripheral depend
on the host or gadget support being =y or the same as the
FOTG210 core itself.
This should ensure that either:
- The host (CONFIG_USB) or gadget (CONFIG_GADGET) is compiled
in and then the FOTG210 can be either module or compiled
in.
- The host or gadget is modular, and then the FOTG210 module
must be a module too, or we cannot resolve the symbols
at link time.
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/linux-usb/202211112132.0BUPGKCd-lkp@intel.com/
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20221111144821.113665-1-linus.walleij@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
--- a/drivers/usb/fotg210/Kconfig
+++ b/drivers/usb/fotg210/Kconfig
@@ -14,7 +14,7 @@ if USB_FOTG210
config USB_FOTG210_HCD
bool "Faraday FOTG210 USB Host Controller support"
- depends on USB
+ depends on USB=y || USB=USB_FOTG210
help
Faraday FOTG210 is an OTG controller which can be configured as
an USB2.0 host. It is designed to meet USB2.0 EHCI specification
@@ -24,7 +24,7 @@ config USB_FOTG210_HCD
module will be called fotg210-hcd.
config USB_FOTG210_UDC
- depends on USB_GADGET
+ depends on USB_GADGET=y || USB_GADGET=USB_FOTG210
bool "Faraday FOTG210 USB Peripheral Controller support"
help
Faraday USB2.0 OTG controller which can be configured as