> From: Dinh Nguyen [mailto:dinh.li...@gmail.com]
> Sent: Thursday, August 07, 2014 5:12 AM
> 
> On 8/1/14, 4:41 PM, Dinh Nguyen wrote:
> > On Fri, 2014-08-01 at 20:42 +0000, Paul Zimmerman wrote:
> >>> From: linux-usb-ow...@vger.kernel.org 
> >>> [mailto:linux-usb-ow...@vger.kernel.org] On Behalf Of dingu...@altera.com
> >>> Sent: Wednesday, July 30, 2014 8:21 AM

...

> >>>  config USB_DWC2_PERIPHERAL
> >>> - tristate "Gadget only mode"
> >>> + bool "Gadget only mode"
> >>>   depends on USB_GADGET
> >>>   help
> >>>     The Designware USB2.0 high-speed gadget controller
> >>> -   integrated into many SoCs.
> >>> +   integrated into many SoCs. Select this option if you want the
> >>> +   driver to operate in Peripheral-only mode.
> >>> +
> >>> +config USB_DWC2_DUAL_ROLE
> >>> + bool "Dual Role mode"
> >>> + depends on ((USB=y || USB=USB_DWC2) && (USB_GADGET=y))
> >>
> >> Hi Dinh,
> >>
> >> I just noticed that for dual-role mode, you are not allowing USB_GADGET
> >> to be modular. Is there a reason for that? If so, please mention it in
> >> the commit message. It should also be explained in the help text. Or
> >> maybe add another comment line saying "Dual-role mode requires USB Gadget
> >>  = y" or something like that.
> >>
> >
> > I think it was an oversight on my part and there's not reason why
> > USB_GADGET can't be modular.
> >
> 
> I went back to look this for v3 and it appears that I need USB_GADGET=y
> to avoid a build error when building the new driver for Gadget or Dual-role.
> 
> drivers/built-in.o: In function `dwc2_gadget_init':
> /home/dinguyen/linux_dev/linux-socfpga/drivers/usb/dwc2/gadget.c:3516:
> undefined reference to `usb_add_gadget_udc'
> drivers/built-in.o: In function `s3c_hsotg_remove':
> /home/dinguyen/linux_dev/linux-socfpga/drivers/usb/dwc2/gadget.c:3543:
> undefined reference to `usb_del_gadget_udc'
> /home/dinguyen/linux_dev/linux-socfpga/drivers/usb/dwc2/gadget.c:3549:
> undefined reference to `usb_gadget_unregister_driver'

I don't see why that shouldn't work. usb_add_gadget_udc is defined in
udc-core.c, which gets built if CONFIG_USB_GADGET is set. What Kconfig
line did you use when you got this build error? I think it should be:

config USB_DWC2_DUAL_ROLE
        bool "Dual Role mode"
        depends on (USB=y || USB=USB_DWC2) && (USB_GADGET=y || 
USB_GADGET=USB_DWC2)

-- 
Paul

Reply via email to