usb: gadget: Allow to build both USB functions and legacy gadgets 22/77022/3
authorKrzysztof Opasiak <k.opasiak@samsung.com>
Mon, 6 Jun 2016 19:40:33 +0000 (21:40 +0200)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Fri, 29 Jul 2016 08:59:19 +0000 (01:59 -0700)
commit6e896dde046d36dcd4407e04fd8f3118c2b690b6
tree1c7ba0e1a097e75b1bf19143cef41fd1ed4b4b4b
parent59842eadb2659f7a2b97d7160ac6cfd338beb7f6
usb: gadget: Allow to build both USB functions and legacy gadgets

Currently it is possible to build in some subset of usb functions
*OR* some gadget module. This is limited only by Kconfig not
any functionality.

This patch removes this limitation. With this patch it is possible
to set up all build combinations:
1) Multiple gadgets build in
2) Part of functions build in, part of functions as a modules
3) Some gadgets build in and some part of functions build in/modules
etc.

As this patch makes Kconfig quite complicated let me clarify how it works:

USB_F_<func name> - used in makefile for compilation
USB_CONFIGFS_F_<func name> - Chosen by user in function menu
USB_G_<gadget name>_REQ_F_<func name> - set up by gadget to mark
      that this particular gadget requires this func to work
USB_F_<func name>_SELECTOR - helper config which is used to determine
    if function should be build in or compiled as a module

The rules are quite simple:
1) If any of USB_CONFIGFS_F_<func name>, USB_G_*_REQ_F_<func name> equals
y, then USB_F_<func name> is set to y and function is build in
2) If none of USB_CONFIGFS_F_<func name>, USB_G_*_REQ_F_<func name> equals
y, but any of them equals m then USB_F_<func name> is set to m and function
is compiled as a module

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
[Backported from commit under review @linux-usb mailing list]
Change-Id: Ic8c2ad723a43536ca4c621ed590e01ba8f0fbf5b
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
drivers/usb/gadget/Kconfig
drivers/usb/gadget/legacy/Kconfig