Re: [PATCH 4/4] CI13xxx: Add USB host interrupt notifier

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

 



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?

> > 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);

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