On Wed, May 16, 2012 at 05:39:07PM +0200, Marek Vasut wrote: > Dear Alan Stern, > > > On Tue, 15 May 2012, Marek Vasut wrote: > > > Dear Alan Stern, > > > > > > > On Tue, 15 May 2012, Marek Vasut wrote: > > > > > > I'm not sure I really understand the purpose of all this. Why does > > > > > > the PHY driver need to know about every IRQ the host driver > > > > > > receives? > > > > > > > > > > I use the .notify_event in ci13xxx to filter out this kind of event, > > > > > read the EHCI host register and then notify the PHY about the state > > > > > of USB PCD. > > > > > > > > Which state changes are you interested in? > > > > > > The PCD bit getting flipped. > > > > I presume you are referring to the Port Change Detect bit (STS_PCD) in > > the USBSTS register. Does this controller have only one port? > > Yes. Peter hinted me to use this bit to detect host connect/disconnect events. > > > > > Could the ehci-hcd driver include a hook to call the appropriate PHY > > > > driver at the right times? > > > > > > But that sounds like quite unsystematic hack. I'd like to avoid poluting > > > the code only because one stupid controller needs it. > > > > It's reasonable to assume that other controllers in the future may have > > similar needs -- they may even require multiple PHYs to be notified > > about connect changes on multiple ports. I see nothing wrong with > > implementing a callback just for this purpose. Something like: > > > > void (*phy_connect_change)(unsigned port, int connected); > > > > Then in the port loop in ehci_irq(), you could do: > > > > if (unlikely(ehci->phy_connect_change && (pstatus & PORT_CSC))) > > (ehci->phy_connect_change)(i, pstatus & PORT_CONNECT); > > Ok Alan, I'll add it into the next series of the ci13xxx stuff we'll craft > together with Richard. Thanks for your guidance! How about define a interface to let hcd or udc driver to pass message to phy driver? My work: https://github.com/riczhao/kernel-imx/commit/693b09a41abfb07d97fe0251325576cdcc9e3606 Thanks Richard > > > > > Alan Stern > > Best regards, > Marek Vasut > -- > 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 > -- 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