Re: [PATCH] usb: chipidea: reuse the platform_data to store the ci info

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

 



On Thu, 13 Aug 2015, Peter Chen wrote:

> > > Alan, do you have any suggestions? Currently, IP core driver and ehci
> > > core both takes its internal structure as driver data. Thanks.
> > 
> > It's not just ehci-hcd: The USB core stores the hcd address as driver 
> > data.  usb_create_shared_hcd() does:
> > 
> > 		dev_set_drvdata(dev, hcd);
> > 
> > (The core uses this value only in usb_hcd_platform_shutdown(), but 
> > other platform-glue drivers also store the hcd address there.)
> > 
> > The standard answer is to put the Chipidea private data in the
> > ehci_ci_priv structure.  That's what it's meant for.
> > 
> > Is that okay for you?
> 
> Thanks, Alan. It is ok for ehci glue layer as a separate driver.
> But it is not ok for the drivers like having all hcd/gadget/otg
> part together, the IP core driver's suspend/resume/remove,
> sysfs will use driver's private data, unless the ehci platform
> device as child for IP core device, but it is not for gadget.
> 
> If there is no better solution, I will use Rong's solution.

In the old days, a single device could be a USB host controller and
nothing else.  Then later, a single device could be either a host
controller or a device controller.  Now a single device can be both.

Obviously this causes problems for our original design, where the 
device's drvdata stored a pointer to the hcd structure or the udc 
structure.

In principle, the drvdata should point to something that contains
pointers to both the hcd and udc structures.  Maybe also an otg
structure.  That would require a lot of changes to existing code but it
might be worthwhile.

Felipe, what do you think?

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



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

  Powered by Linux