On Mon, Aug 08, 2011 at 06:41:42AM +0000, Chen Peter-B29397 wrote: > > > > > On 8/5/2011 6:12 PM, Sascha Hauer wrote: > > > Yes, that's clear to me. I just wondered what exact names we should use > > > to register a phy. > > > > > > Consider a phy registering itself with > > > > > > usb_register_transceiver(recv) with recv->name = "mxc-ehci.0" > > > > > > (where recv->name could be passed from platform_data) > > > > > > Then the mxc-ehci driver could get its receiver using > > > > > > usb_get_transceiver(dev_name(&pdev->dev)) > > > > > > or with > > > > > > usb_get_transceiver(&pdev->dev); > > > > > > when we do what I suggested. This would be similar to the clocks which > > > get the clocks associated to a device with clk_get(&pdev->dev, id). > > > > > > This would change the behaviour of usb_get_transceiver() from "give me > > > the phy with this name" to "give me the transceiver associated with > > this > > > device". It would prevent us from inventing arbitrary phy names. > > > > > I like this idea. > > > > How does this work if both gadget and host are active. What name should > > be passed to transceiver? "mxc-ehci" or "mxc-udc" > > > I think both of them should be passed to transceiver, as both gadget and host use > this transceiver. That was my first thought aswell, but the phy is a shared resource and should be handled by an instance which is aware of this fact. Neither the host driver nor the device driver are aware of this or even should be aware of this. Sascha -- 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