RE: usb: udc-core: Dual gadget issue in v3.1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
> On Wed, Oct 19, 2011 at 05:13:48PM +0530, Gupta, Ajay Kumar wrote:
> > Hi,
> > > On Wed, Oct 19, 2011 at 02:36:10PM +0530, Gupta, Ajay Kumar wrote:
> > > > Hi,
> > > > > On Thu, Oct 13, 2011 at 12:50:55PM +0530, Gupta, Ajay Kumar
> wrote:
> > > > > > We are facing an issue in AM335x based custom board which has
> > > > > > two musb port.
> > > > > >
> > > > > > a) musb0  ID pin is floating and have micro-B plug receptacle
> > > > > > connector. [DEVICE ONLY]
> > > > > > b) musb1  ID pin is grounded and have standard-A plug
> > > > > > receptacle connector. [HOST ONLY]
> > > > > >
> > > > > > We are using udc-core in linux v3.1-rc8 kernel. This kernel
> > > > > > only provides option for selecting gadget driver for first
> > > > > > instance only as builtin.
> > > > >
> > > > > why don't you mark all gadget drivers as modules ? I do that all
> > > > > the
> > > > > time:
> > > >
> > > > This wouldn't help if we want to use musb1 (host only) port during
> > > > bootup so that root file system on a pen drive connected to it can
> > > > be
> > > mounted.
> > > >
> > > > >
> > > > > CONFIG_USB_GADGET=m
> > > > > CONFIG_USB_GADGET_DEBUG=y
> > > > > CONFIG_USB_GADGET_DEBUG_FILES=y
> > > > > CONFIG_USB_GADGET_DEBUG_FS=y
> > > > > CONFIG_USB_GADGET_VBUS_DRAW=2
> > > > > CONFIG_USB_R8A66597=m
> > > > > CONFIG_USB_M66592=m
> > > > > CONFIG_USB_AMD5536UDC=m
> > > > > CONFIG_USB_CI13XXX_PCI=m
> > > > > CONFIG_USB_NET2272=m
> > > > > CONFIG_USB_NET2272_DMA=y
> > > > > CONFIG_USB_NET2280=m
> > > > > CONFIG_USB_GOKU=m
> > > > > CONFIG_USB_EG20T=m
> > > > > CONFIG_USB_DUMMY_HCD=m
> > > > > CONFIG_USB_GADGET_DUALSPEED=y
> > > > > CONFIG_USB_GADGET_SUPERSPEED=y
> > > > > CONFIG_USB_ZERO=m
> > > > > CONFIG_USB_ZERO_HNPTEST=y
> > > > > CONFIG_USB_AUDIO=m
> > > > > CONFIG_USB_ETH=m
> > > > > CONFIG_USB_ETH_RNDIS=y
> > > > > CONFIG_USB_ETH_EEM=y
> > > > > CONFIG_USB_G_NCM=m
> > > > > CONFIG_USB_GADGETFS=m
> > > > > CONFIG_USB_FUNCTIONFS=m
> > > > > CONFIG_USB_FUNCTIONFS_ETH=y
> > > > > CONFIG_USB_FUNCTIONFS_RNDIS=y
> > > > > CONFIG_USB_FUNCTIONFS_GENERIC=y
> > > > > CONFIG_USB_FILE_STORAGE=m
> > > > > CONFIG_USB_FILE_STORAGE_TEST=y
> > > > > CONFIG_USB_MASS_STORAGE=m
> > > > > CONFIG_USB_G_SERIAL=m
> > > > > CONFIG_USB_MIDI_GADGET=m
> > > > > CONFIG_USB_G_PRINTER=m
> > > > > CONFIG_USB_CDC_COMPOSITE=m
> > > > > CONFIG_USB_G_NOKIA=m
> > > > > CONFIG_USB_G_MULTI=m
> > > > > CONFIG_USB_G_MULTI_RNDIS=y
> > > > > CONFIG_USB_G_MULTI_CDC=y
> > > > > CONFIG_USB_G_HID=m
> > > > > CONFIG_USB_G_DBGP=m
> > > > > # CONFIG_USB_G_DBGP_PRINTK is not set CONFIG_USB_G_DBGP_SERIAL=y
> > > > > CONFIG_USB_G_WEBCAM=m
> > > > >
> > > > > > Current musb driver requires a gadget module to be inserted
> > > > > > for a musb port to be usable in OTG mode which is the only
> > > > > > mode available in
> > > > > > v3.1-rc8 due to recent changes removing all HOST and GADGET
> > > > > > only ifdeffery.
> > > > >
> > > > > You can add runtime checks based on platform_data. Something
> like:
> > > > >
> > > > > switch (pdata->mode) {
> > > > > case MUSB_HOST:
> > > > > 	start_host();
> > > > > 	break;
> > > > > case MUSB_PERIPHERAL:
> > > > > 	start_gadget();
> > > > > 	break;
> > > > > case MUSB_OTG:
> > > > > 	start_gadget()
> > > > > 	start_host();
> > > > > 	break;
> > > > > default:
> > > > > 	error();
> > > > > }
> > > > >
> > > > > which means that for a port which is host-only, it won't require
> > > > > a gadget driver and for a port which is gadget-only, it won't
> > > > > start host stack.
> > > >
> > > > If so then how about the menuconfig option for gadget driver for
> > > > such host only port? Shouldn't the gadget driver option be
> > > > unavailable for
> > > such ports?
> > >
> > > how we can we change menuconfig for something which isn't
> > > compile-time constant ?
> >
> > Yes, correct. So there will be option for selecting gadget module even
> > when The port is host only and that would confuse the users. We would
> > need to find a solution for this also.
> 
> of course not mate. It's like saying we can't compile an i2c client
> driver just because we didn't enable i2c-omap. It doesn't work that way.

Let me explain:
I compile for omap3evm for a board which has a host only port. I use
Omap3evm only defconfig and then go to drivers->USB support->Inventra.

It would show OTG mode and go further below and you would see
Gadget driver support which you *cannot* disable as the moment you
Disable it Inventra option for host also will disappear. This will confuse
Users and looks unnecessary for a board with HOST only ports.

You point holds good for a multiconfig compile and if people are OK with
this then no issue.

> > > > > > 3) Change musb driver so that there is no need for gadget
> > > > > > driver for host only ports.  (may be based on musb->board_mode
> > > > > > ?)
> > > > >
> > > > > yes.
> > > >
> > > > Doesn't seem to be a cleaner way as explained above the issue of
> > > > gadget Driver coming in menuconfig for such ports.
> > >
> > > you don't assign a port for a gadget driver. Ever.
> > Yes, agree. But wouldn't it be confusing for a host only musb port
> > showing gadget driver in menuconfig?
> 
> why ? musb isn't the only gadget controller in the world.
I meant in a single board config environment.

Ajay
> 
> --
> balbi
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux