On Wed, May 15, 2013 at 01:34:31PM +0300, Alexander Shishkin wrote: > Peter Chen <peter.chen@xxxxxxxxxxxxx> writes: > > > Hi Michael & Marc, > > > > Recently, I have worked at i.mx USB loadable module support for chipidea driver, > > it needs to write non-core register during the ci13xxx_imx remove process, > > but currently, the usbmisc_imx is a driver, and it uses symbol from > > ci13xxx_imx, so it will be unload first. > > One driver really shouldn't be using symbols from another driver, we > should fix that first. > It depends, gadget driver uses udc driver's symbol, like usb_gadget_probe_driver, usb_gadget_unregister_driver etc. chipidea host also uses ehci core's symbol ehci_init_driver. >From my point is the controller driver can use core driver's exported symbols. For this problem, ci13xxx_imx and usbmisc_misc will use other's symbol, so it can't be driver at the same time. We can make the their relationship like chipidea's core.c and host.c (udc.c). I think other chipidea controllers may also this non-core register, if it is not, how to handle some usb wakeup interrupt, set wakeup source, phy's setting according to board layout, over correct enable/disable, etc. > > How about I make usbmisc_imx as lib, and using DT entries from ci13xxx_imx? > > In fact, if we need support full feature usb functions, it needs touch > > non-core register from time to time, eg disable/enable wakeup during > > runtime-pm. > > Can we move usbmisc_imx code to the imx platform pm code or something? I > suspect it's only needed during probe/remove time or power state > transitions. Just like sascha said, it is driver specific, it should be at driver layer. -- Best Regards, Peter Chen -- 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