On Wed, Apr 15, 2009 at 04:18:32PM +0200, Guennadi Liakhovetski wrote: > On Wed, 15 Apr 2009, Sascha Hauer wrote: > > > Hi Guennadi, > > > > On Wed, Apr 15, 2009 at 02:29:05PM +0200, Guennadi Liakhovetski wrote: > > > From: Guennadi Liakhovetski <lg@xxxxxxx> > > > > > > Add support for the i.MX31 OTG controller in pure device mode to the pcm037 > > > board. > > > > Have you already investigated what is missing for OTG support? I'm > > asking because currently I use the same port as host port, so that would > > be the next logical step. > > No, I haven't. How far are you with the host support? It is working fine, but I need access to the ULPI tranceivers which currently does not look very nice and I found no time to look at it yet, so I have nothing for mainline right now. > I looked briefly at > some recent OTG patches on the list, the whole infrastructure seems to be > still very much experimental and unstable. That was a couple of months ago > though. Ok, that whas the impression I got, too. > > Could you also test your driver with the first port, and implement it > first as host-only? Adding OTG later when both host and device are in > place? Sure. We need some Kernel option then to let the user decide what to use. > > > > +/* OTG config */ > > > +static struct fsl_usb2_platform_data usb_data = { > > > + .operating_mode = FSL_USB2_DR_DEVICE, > > > + .phy_mode = FSL_USB2_PHY_ULPI, > > > +}; > > > + > > > +static struct resource otg_resources[] = { > > > + { > > > + .start = OTG_BASE_ADDR, > > > + .end = OTG_BASE_ADDR + 0x1ff, > > > + .flags = IORESOURCE_MEM, > > > + }, { > > > + .start = MXC_INT_USB3, > > > + .flags = IORESOURCE_IRQ, > > > + }, > > > +}; > > > + > > > +static u64 udc_dmamask = DMA_BIT_MASK(32); > > > + > > > +/* OTG gadget device */ > > > +static struct platform_device otg_udc_device = { > > > + .name = "fsl-usb2-udc", > > > + .id = -1, > > > + .dev = { > > > + .dma_mask = &udc_dmamask, > > > + .coherent_dma_mask = 0xffffffff, > > > + .platform_data = &usb_data, > > > + }, > > > + .resource = otg_resources, > > > + .num_resources = ARRAY_SIZE(otg_resources), > > > +}; > > > > > > why not devices.[ch]? > > Sure, can do that too, if you prefer. > > As UDC support is ready and the patch is very small, it just extends an > existing driver, I would propose to get it in the mainline now, and extend > for OTG when the host part is ready too. OK > Would the UDC driver have to be > modified for that too? Probably, yes. That would be another argument for > pulling this patch first. If you agree, I'll resubmit only this patch, > moving platform data into devices.[hc]. You mean the platform_device and resources, but not the platform_data? > > Thanks > Guennadi > --- > Guennadi Liakhovetski, Ph.D. > Freelance Open-Source Software Developer > -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -- 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