USB: EHCI: Export the ehci_hub_control function
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Wed, 16 Apr 2014 16:00:10 +0000 (18:00 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 24 Apr 2014 20:05:32 +0000 (13:05 -0700)
Platform drivers sometimes need to perform specific handling of hub
control requests. Make this possible by exporting the ehci_hub_control()
function which can then be called from a custom hub control handler in
the default case.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/ehci-hub.c
drivers/usb/host/ehci-tegra.c
drivers/usb/host/ehci.h

index 7ae0c4d517417d46dbc2dd8f51993728fa839c3a..cc305c71ac3d489d469ec4ca34a03c7861bf122f 100644 (file)
 
 #ifdef CONFIG_PM
 
-static int ehci_hub_control(
-       struct usb_hcd  *hcd,
-       u16             typeReq,
-       u16             wValue,
-       u16             wIndex,
-       char            *buf,
-       u16             wLength
-);
-
 static int persist_enabled_on_companion(struct usb_device *udev, void *unused)
 {
        return !udev->maxchild && udev->persist_enabled &&
@@ -865,7 +856,7 @@ cleanup:
 #endif /* CONFIG_USB_HCD_TEST_MODE */
 /*-------------------------------------------------------------------------*/
 
-static int ehci_hub_control (
+int ehci_hub_control(
        struct usb_hcd  *hcd,
        u16             typeReq,
        u16             wValue,
@@ -1285,6 +1276,7 @@ error_exit:
        spin_unlock_irqrestore (&ehci->lock, flags);
        return retval;
 }
+EXPORT_SYMBOL_GPL(ehci_hub_control);
 
 static void ehci_relinquish_port(struct usb_hcd *hcd, int portnum)
 {
index 7ef00ecb0da10e2d13077f2467b10cd23e2b78ca..572634cd95d61f4ba11c96b7e1247964ff2b6e1d 100644 (file)
@@ -51,10 +51,6 @@ struct tegra_ehci_soc_config {
        bool has_hostpc;
 };
 
-static int (*orig_hub_control)(struct usb_hcd *hcd,
-                               u16 typeReq, u16 wValue, u16 wIndex,
-                               char *buf, u16 wLength);
-
 struct tegra_ehci_hcd {
        struct tegra_usb_phy *phy;
        struct clk *clk;
@@ -236,7 +232,7 @@ static int tegra_ehci_hub_control(
        spin_unlock_irqrestore(&ehci->lock, flags);
 
        /* Handle the hub control events here */
-       return orig_hub_control(hcd, typeReq, wValue, wIndex, buf, wLength);
+       return ehci_hub_control(hcd, typeReq, wValue, wIndex, buf, wLength);
 
 done:
        spin_unlock_irqrestore(&ehci->lock, flags);
@@ -554,8 +550,6 @@ static int __init ehci_tegra_init(void)
         * too easy.
         */
 
-       orig_hub_control = tegra_ehci_hc_driver.hub_control;
-
        tegra_ehci_hc_driver.map_urb_for_dma = tegra_ehci_map_urb_for_dma;
        tegra_ehci_hc_driver.unmap_urb_for_dma = tegra_ehci_unmap_urb_for_dma;
        tegra_ehci_hc_driver.hub_control = tegra_ehci_hub_control;
index 9dfc6c1394d6acbabdca14d87a89f0c0cbb01865..eee228a26a0e71795b472218feefa7c5380e62d0 100644 (file)
@@ -872,4 +872,7 @@ extern int  ehci_suspend(struct usb_hcd *hcd, bool do_wakeup);
 extern int     ehci_resume(struct usb_hcd *hcd, bool hibernated);
 #endif /* CONFIG_PM */
 
+extern int     ehci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
+                                u16 wIndex, char *buf, u16 wLength);
+
 #endif /* __LINUX_EHCI_HCD_H */