On Mon, 17 Aug 2015, Peter Chen wrote: > > That's not quite what I had in mind. I was thinking of something more > > like this: > > > > Platform device ---- drvdata ----> struct usb_pointers > > | > > | > > |-------|-------| > > | | | > > gadget hcd otg > > > > where struct usb_pointers (maybe you can think of a better name) looks > > like this: > > > > struct usb_pointers { > > struct usb_hcd *hcd; > > struct usb_gadget *gadget; > > struct usb_otg *otg; > > }; > > > > If you want, you can use your IP Core device in place of my platform > > device. All that matters is that the parent device of the root hub > > (for hosts) or gadget (for peripherals) should store the address of a > > usb_pointers structure in its drvdata. > > > > I am wonder how you get hcd pointer at hcd core code? The platform > device drvdata is not hcd pointer any more, instead, it is platform > device private data. The platform device private data will now be a usb_pointers structure. The hcd core code will simply do: struct usb_pointers *usbptr = platform_get_drvdata(dev); hcd = usbptr->hcd; We can allocate some extra space at the end of the usb_pointers structure if the platform/glue driver wants to store additional data in there. Alan Stern -- 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