usb: fotg210: Compile into one module
authorLinus Walleij <linus.walleij@linaro.org>
Sun, 23 Oct 2022 14:47:07 +0000 (16:47 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Nov 2022 11:38:09 +0000 (12:38 +0100)
commitaeffd2c3b09f4f50438ec8960095129798bcb33a
treeadf299cd0a0022ee4ba62d7e0106299e1bdbd8e7
parent1dd33a9f1b95ab59cd60f14a7a83fed14697867b
usb: fotg210: Compile into one module

It is since ages perfectly possible to compile both of these
modules into the same kernel, which makes no sense since it
is one piece of hardware.

Compile one module named "fotg210.ko" for both HCD and UDC
drivers by collecting the init calls into a fotg210-core.c
file and start to centralize things handling one and the same
piece of hardware.

Stub out the initcalls if one or the other part of the driver
was not selected.

Tested by compiling one or the other or both of the drivers
into the kernel and as modules.

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-2-linus.walleij@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/fotg210/Kconfig
drivers/usb/fotg210/Makefile
drivers/usb/fotg210/fotg210-core.c [new file with mode: 0644]
drivers/usb/fotg210/fotg210-hcd.c
drivers/usb/fotg210/fotg210-udc.c
drivers/usb/fotg210/fotg210.h [new file with mode: 0644]