]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
usb: fotg210: Collect pieces of dual mode controller
authorLinus Walleij <linus.walleij@linaro.org>
Sun, 23 Oct 2022 14:47:06 +0000 (16:47 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Nov 2022 11:38:09 +0000 (12:38 +0100)
The Faraday FOTG210 is a dual-mode OTG USB controller that can
act as host, peripheral or both. To be able to probe from one
hardware description and to follow the pattern of other dual-
mode controllers such as MUSB or MTU3 we need to collect the
two, currently completely separate drivers in the same
directory.

After this, users need to select the main symbol USB_FOTG210
and then each respective subdriver. We pave the road to
compile both drivers into the same kernel and select the
one we want to use at probe() time, and possibly add OTG
support in the end.

This patch doesn't do much more than create the new symbol
and collect the drivers in one place. We also add a comment
for the section of dual-mode controllers in the Kconfig
file so people can see what these selections are about.

Also add myself as maintainer as there has been little
response on my patches to these drivers.

Cc: Fabian Vogt <fabian@ritter-vogt.de>
Cc: Yuan-Hsin Chen <yhchen@faraday-tech.com>
Cc: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20221023144708.3596563-1-linus.walleij@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
13 files changed:
MAINTAINERS
drivers/usb/Kconfig
drivers/usb/Makefile
drivers/usb/fotg210/Kconfig [new file with mode: 0644]
drivers/usb/fotg210/Makefile [new file with mode: 0644]
drivers/usb/fotg210/fotg210-hcd.c [moved from drivers/usb/host/fotg210-hcd.c with 99% similarity]
drivers/usb/fotg210/fotg210-hcd.h [moved from drivers/usb/host/fotg210.h with 100% similarity]
drivers/usb/fotg210/fotg210-udc.c [moved from drivers/usb/gadget/udc/fotg210-udc.c with 99% similarity]
drivers/usb/fotg210/fotg210-udc.h [moved from drivers/usb/gadget/udc/fotg210.h with 100% similarity]
drivers/usb/gadget/udc/Kconfig
drivers/usb/gadget/udc/Makefile
drivers/usb/host/Kconfig
drivers/usb/host/Makefile

index 379945f82a6438e385e32810084a9827aca62ece..52ddfc938ac9154ad60eb49c7981f77b72b87833 100644 (file)
@@ -7873,6 +7873,12 @@ F:       fs/notify/fanotify/
 F:     include/linux/fanotify.h
 F:     include/uapi/linux/fanotify.h
 
+FARADAY FOTG210 USB2 DUAL-ROLE CONTROLLER
+M:     Linus Walleij <linus.walleij@linaro.org>
+L:     linux-usb@vger.kernel.org
+S:     Maintained
+F:     drivers/usb/fotg210/
+
 FARSYNC SYNCHRONOUS DRIVER
 M:     Kevin Curtis <kevin.curtis@farsite.co.uk>
 S:     Supported
index 578a439e71b579f218b3df18f8f3a0c1f14a416a..a871a988829dbf0e91e3e1532163cf504b145810 100644 (file)
@@ -111,8 +111,12 @@ source "drivers/usb/usbip/Kconfig"
 
 endif
 
+comment "USB dual-mode controller drivers"
+
 source "drivers/usb/cdns3/Kconfig"
 
+source "drivers/usb/fotg210/Kconfig"
+
 source "drivers/usb/mtu3/Kconfig"
 
 source "drivers/usb/musb/Kconfig"
index 643edf5fe18c618ed9898bf70a5009e22fa6ab8b..a81e6ef293af27723c73b3b44571fd5b2998f1f8 100644 (file)
@@ -17,6 +17,8 @@ obj-$(CONFIG_USB_CDNS_SUPPORT)        += cdns3/
 obj-$(CONFIG_USB_CDNS3)                += cdns3/
 obj-$(CONFIG_USB_CDNSP_PCI)    += cdns3/
 
+obj-$(CONFIG_USB_FOTG210)      += fotg210/
+
 obj-$(CONFIG_USB_MON)          += mon/
 obj-$(CONFIG_USB_MTU3)         += mtu3/
 
diff --git a/drivers/usb/fotg210/Kconfig b/drivers/usb/fotg210/Kconfig
new file mode 100644 (file)
index 0000000..e7a1067
--- /dev/null
@@ -0,0 +1,36 @@
+# SPDX-License-Identifier: GPL-2.0
+
+config USB_FOTG210
+       tristate "Faraday FOTG210 USB2 Dual Role controller"
+       depends on USB || USB_GADGET
+       depends on HAS_DMA && HAS_IOMEM
+       default ARCH_GEMINI
+       help
+         Faraday FOTG210 is a dual-mode USB controller that can act
+         in both host controller and peripheral controller mode.
+
+if USB_FOTG210
+
+config USB_FOTG210_HCD
+       tristate "Faraday FOTG210 USB Host Controller support"
+       depends on USB
+       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
+         with minor modification.
+
+         To compile this driver as a module, choose M here: the
+         module will be called fotg210-hcd.
+
+config USB_FOTG210_UDC
+       depends on USB_GADGET
+       tristate "Faraday FOTG210 USB Peripheral Controller support"
+       help
+          Faraday USB2.0 OTG controller which can be configured as
+          high speed or full speed USB device. This driver suppports
+          Bulk Transfer so far.
+
+          Say "y" to link the driver statically, or "m" to build a
+          dynamically linked module called "fotg210-udc".
+
+endif
diff --git a/drivers/usb/fotg210/Makefile b/drivers/usb/fotg210/Makefile
new file mode 100644 (file)
index 0000000..f4a26ca
--- /dev/null
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0
+obj-$(CONFIG_USB_FOTG210_HCD)  += fotg210-hcd.o
+obj-$(CONFIG_USB_FOTG210_UDC)  += fotg210-udc.o
similarity index 99%
rename from drivers/usb/host/fotg210-hcd.c
rename to drivers/usb/fotg210/fotg210-hcd.c
index 3d1dbcf4c07326ff39a09fe1b25f7a9363e4bfc8..8fbf63e76d7d1780134fa24cd996007fad7f8e4c 100644 (file)
@@ -77,7 +77,7 @@ MODULE_PARM_DESC(hird, "host initiated resume duration, +1 for each 75us");
 
 #define INTR_MASK (STS_IAA | STS_FATAL | STS_PCD | STS_ERR | STS_INT)
 
-#include "fotg210.h"
+#include "fotg210-hcd.h"
 
 #define fotg210_dbg(fotg210, fmt, args...) \
        dev_dbg(fotg210_to_hcd(fotg210)->self.controller, fmt, ## args)
similarity index 99%
rename from drivers/usb/gadget/udc/fotg210-udc.c
rename to drivers/usb/fotg210/fotg210-udc.c
index fdca28e72a3b4d1441afa7044e418bb00994abfa..01a4509775b2b51ca0854583cb277615b4171e2c 100644 (file)
@@ -16,7 +16,7 @@
 #include <linux/usb/ch9.h>
 #include <linux/usb/gadget.h>
 
-#include "fotg210.h"
+#include "fotg210-udc.h"
 
 #define        DRIVER_DESC     "FOTG210 USB Device Controller Driver"
 #define        DRIVER_VERSION  "30-April-2013"
index 5756acb07b8da810313d7d614adbf0c55d9666be..16243964b1cd1509329bbf3c0cfaddfeb5281be6 100644 (file)
@@ -108,17 +108,6 @@ config USB_FUSB300
        help
           Faraday usb device controller FUSB300 driver
 
-config USB_FOTG210_UDC
-       depends on HAS_DMA
-       tristate "Faraday FOTG210 USB Peripheral Controller"
-       help
-          Faraday USB2.0 OTG controller which can be configured as
-          high speed or full speed USB device. This driver supppors
-          Bulk Transfer so far.
-
-          Say "y" to link the driver statically, or "m" to build a
-          dynamically linked module called "fotg210_udc".
-
 config USB_GR_UDC
        tristate "Aeroflex Gaisler GRUSBDC USB Peripheral Controller Driver"
        depends on HAS_DMA
index 12f9e4c9eb0c5721578b7195409a2878917e8ae2..39daf36a2baa29bbfa8dd3a9ca79cbb3fadd2753 100644 (file)
@@ -34,7 +34,6 @@ obj-$(CONFIG_USB_EG20T)               += pch_udc.o
 obj-$(CONFIG_USB_MV_UDC)       += mv_udc.o
 mv_udc-y                       := mv_udc_core.o
 obj-$(CONFIG_USB_FUSB300)      += fusb300_udc.o
-obj-$(CONFIG_USB_FOTG210_UDC)  += fotg210-udc.o
 obj-$(CONFIG_USB_MV_U3D)       += mv_u3d_core.o
 obj-$(CONFIG_USB_GR_UDC)       += gr_udc.o
 obj-$(CONFIG_USB_GADGET_XILINX)        += udc-xilinx.o
index 8e8db71021a54783836c8c6f3e867342c4734818..8d799d23c476e1795c0b957da50cf15afc0c720c 100644 (file)
@@ -389,17 +389,6 @@ config USB_ISP1362_HCD
          To compile this driver as a module, choose M here: the
          module will be called isp1362-hcd.
 
-config USB_FOTG210_HCD
-       tristate "FOTG210 HCD support"
-       depends on USB && HAS_DMA && HAS_IOMEM
-       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
-         with minor modification.
-
-         To compile this driver as a module, choose M here: the
-         module will be called fotg210-hcd.
-
 config USB_MAX3421_HCD
        tristate "MAX3421 HCD (USB-over-SPI) support"
        depends on USB && SPI
index 2c8a61be7e466c197949ed39980b438d1fb53f2a..6d8ee264c9b2bf85669f608c7c0f50a5e44cb514 100644 (file)
@@ -84,6 +84,5 @@ obj-$(CONFIG_USB_EHCI_FSL)    += ehci-fsl.o
 obj-$(CONFIG_USB_EHCI_MV)      += ehci-mv.o
 obj-$(CONFIG_USB_HCD_BCMA)     += bcma-hcd.o
 obj-$(CONFIG_USB_HCD_SSB)      += ssb-hcd.o
-obj-$(CONFIG_USB_FOTG210_HCD)  += fotg210-hcd.o
 obj-$(CONFIG_USB_MAX3421_HCD)  += max3421-hcd.o
 obj-$(CONFIG_USB_XEN_HCD)      += xen-hcd.o