Hi, On Tue, Jun 26, 2012 at 5:07 PM, Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx> wrote: > On 06/26/2012 01:23 PM, ABRAHAM, KISHON VIJAY wrote: > [...] > >>>> This is like bypassing the otg_library to add or get the phy :-( >>> >>> The problem is, we don't have _the_ phy, we have one phy per usb port >>> and we have two USB ports. >> >> I think then this patch would solve your problem as it allows to add >> multiple-phys of the same type? > > We have two USB ports, a OTG capable and a host-only one. Each one has a > phy, which is used in the host mode and (if the USB port supports) in > the peripheral mode. > > I didn't follow you multi phy patches closely, what's the exact meaning > of type here. If this has already been discussed you can point me to the > appropriate thread. What we were doing in multi-phy patch is, whenever a phy driver registers itself in the otg library using usb_add_phy, it has to give a phy type along with it (USB2 PHY, USB3 PHY,..). We weren't allowing multiple phys of the same type, meaning in a system there cant be two users who calls usb_add_phy(USB2PHY) because there wasn't any reasonable way to get the phy. The complete discussion thread is @ http://www.spinics.net/lists/linux-usb/msg63385.html > >>>> Ideally you should make use of the otg library function for it. Having >>>> a generic function in the otg library to get phy by phandle will help >>>> other phy users to use it instead of implementing their own version of >>>> get_phy from phandle. >>> >>> +1 >>> >>> The code I pointed you at is the topmost patch in: >>> https://github.com/riczhao/kernel-imx/commits/topics/usb-driver >>> As soon as your code is available, let's convert it to use your generic >>> function. >> >> Cool. Thanks :-) > > I pointed you to the code to make sure it fits our use case. To be > precise, we have two of these usb to usbphy links in the dev-tree: yeah. So in the probe of your phy driver (fsl,imx28-usbphy), call usb_add_phy. Then you can call devm_get_phy_by_phandle in the usb controller driver (fsl,imx28-usb).. Thanks Kishon -- 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