usb: dwc3: Fix compilation break when building with USB_DWC3_DUAL_ROLE=y

The commit:
388e5c5 usb: dwc3: remove dwc3 dependency on host AND gadget
breaks compilation when
USB=y, USB_GADGET=m, USB_DWC3=y and USB_DWC3_DUAL_ROLE=y.

drivers/built-in.o: In function `dwc3_gadget_giveback':
drivers/usb/dwc3/gadget.c:271: undefined reference to `usb_gadget_unmap_request'
drivers/built-in.o: In function `__dwc3_gadget_kick_transfer':
drivers/usb/dwc3/gadget.c:1005: undefined reference to `usb_gadget_unmap_request'
drivers/built-in.o: In function `__dwc3_gadget_ep_queue':
drivers/usb/dwc3/gadget.c:1073: undefined reference to `usb_gadget_map_request'
drivers/built-in.o: In function `dwc3_gadget_reset_interrupt':
drivers/usb/dwc3/gadget.c:2165: undefined reference to `usb_gadget_set_state'
drivers/built-in.o: In function `dwc3_gadget_init':
drivers/usb/dwc3/gadget.c:2647: undefined reference to `usb_add_gadget_udc'
drivers/built-in.o: In function `dwc3_gadget_exit':
drivers/usb/dwc3/gadget.c:2681: undefined reference to `usb_del_gadget_udc'
drivers/built-in.o: In function `__dwc3_ep0_do_control_data':
drivers/usb/dwc3/ep0.c:929: undefined reference to `usb_gadget_map_request'
drivers/usb/dwc3/ep0.c:906: undefined reference to `usb_gadget_map_request'
drivers/built-in.o: In function `dwc3_ep0_set_config':
drivers/usb/dwc3/ep0.c:575: undefined reference to `usb_gadget_set_state'
drivers/built-in.o: In function `dwc3_ep0_set_address':
drivers/usb/dwc3/ep0.c:520: undefined reference to `usb_gadget_set_state'
drivers/usb/dwc3/ep0.c:522: undefined reference to `usb_gadget_set_state'
drivers/built-in.o: In function `dwc3_ep0_set_config':
drivers/usb/dwc3/ep0.c:556: undefined reference to `usb_gadget_set_state'

Making changes similar to patch:
71a5e61 usb: chipidea: fix and improve dependencies if usb host or gadget support is built as module

Let us limit the DWC3 mode to depend on corresponding usb-subsystem
and USB_DWC3.

Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
This commit is contained in:
Vivek Gautam
2013-05-14 17:32:16 +05:30
committed by Felipe Balbi
parent fea77077d1
commit 1bc0d92689

View File

@@ -19,21 +19,21 @@ choice
config USB_DWC3_HOST config USB_DWC3_HOST
bool "Host only mode" bool "Host only mode"
depends on USB depends on USB=y || USB=USB_DWC3
help help
Select this when you want to use DWC3 in host mode only, Select this when you want to use DWC3 in host mode only,
thereby the gadget feature will be regressed. thereby the gadget feature will be regressed.
config USB_DWC3_GADGET config USB_DWC3_GADGET
bool "Gadget only mode" bool "Gadget only mode"
depends on USB_GADGET depends on USB_GADGET=y || USB_GADGET=USB_DWC3
help help
Select this when you want to use DWC3 in gadget mode only, Select this when you want to use DWC3 in gadget mode only,
thereby the host feature will be regressed. thereby the host feature will be regressed.
config USB_DWC3_DUAL_ROLE config USB_DWC3_DUAL_ROLE
bool "Dual Role mode" bool "Dual Role mode"
depends on (USB && USB_GADGET) depends on ((USB=y || USB=USB_DWC3) && (USB_GADGET=y || USB_GADGET=USB_DWC3))
help help
This is the default mode of working of DWC3 controller where This is the default mode of working of DWC3 controller where
both host and gadget features are enabled. both host and gadget features are enabled.