On Thu, Aug 05, 2010 at 02:17:38PM +0100, Alan Cox wrote: > From: Alek Du <alek.du@xxxxxxxxx> > > The Intel Moorestown platform has EHCI MPH and EHCI OTG host. This patch adds > PCI probe part for them. The HNP part and SRAM part will be added in another > patch. This patch depends on the OTG transceive and OTG client patch from Hang > Yuan that should be accepted already. > > Signed-off-by: Jacob Pan <jacob.jun.pan@xxxxxxxxx> > Signed-off-by: Alek Du <alek.du@xxxxxxxxx> > Signed-off-by: Alan Cox <alan@xxxxxxxxxxxxxxx> > --- > > drivers/usb/core/hub.c | 11 ++ > drivers/usb/core/usb.h | 1 > drivers/usb/host/ehci-hcd.c | 19 +++ > drivers/usb/host/ehci-hub.c | 13 ++ > drivers/usb/host/ehci-langwell-pci.c | 195 ++++++++++++++++++++++++++++++++++ > drivers/usb/host/ehci-pci.c | 15 +++ > drivers/usb/host/ehci.h | 6 + > include/linux/usb/hcd.h | 6 + > 8 files changed, 262 insertions(+), 4 deletions(-) > create mode 100644 drivers/usb/host/ehci-langwell-pci.c > > > diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c > index 84c1897..2e29931 100644 > --- a/drivers/usb/core/hub.c > +++ b/drivers/usb/core/hub.c > @@ -1546,6 +1546,14 @@ static void hub_free_dev(struct usb_device *udev) > hcd->driver->free_dev(hcd, udev); > } > > +static void otg_notify(struct usb_device *udev, unsigned action) > +{ > + struct usb_hcd *hcd = bus_to_hcd(udev->bus); > + > + if (hcd->otg_notify) > + hcd->otg_notify(udev, action); > +} IMO, "event" would be more appropriate than action. We can extend this to convey "Device not found in TPL", "HUB class NOT supported", "Unable to set B_HNP_ENABLE" etc events to OTG driver. OTG driver can pass these events to user space. > + > /** > * usb_disconnect - disconnect a device (usbcore-internal) > * @pdev: pointer to device being disconnected > @@ -1603,7 +1611,7 @@ void usb_disconnect(struct usb_device **pdev) > * notifier chain (used by usbfs and possibly others). > */ > device_del(&udev->dev); > - > + otg_notify(udev, USB_DEVICE_REMOVE); OTG driver will be interested in only OTG port of root hub. So otg_notify should be called only if udev->parent == root_hub && port == otg_port. > /* Free the device number and delete the parent's children[] > * (or root_hub) pointer. > */ > @@ -1822,6 +1830,7 @@ int usb_new_device(struct usb_device *udev) > * notifier chain (used by usbfs and possibly others). > */ > err = device_add(&udev->dev); > + otg_notify(udev, USB_DEVICE_ADD); > if (err) { > dev_err(&udev->dev, "can't device_add, error %d\n", err); > goto fail; -- Sent by a consultant of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum. -- 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