diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2014-04-16 12:00:10 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-04-24 16:05:32 -0400 |
commit | 37769939082ae0749405133e09eac2c3ccb8fcf0 (patch) | |
tree | 474cba0ffa82a4d7dc834d12a26878bfb5589b9e /drivers | |
parent | 42b59eba718a145e991ae02437f38d8aa8efe207 (diff) |
USB: EHCI: Export the ehci_hub_control function
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/host/ehci-hub.c | 12 | ||||
-rw-r--r-- | drivers/usb/host/ehci-tegra.c | 8 | ||||
-rw-r--r-- | drivers/usb/host/ehci.h | 3 |
3 files changed, 6 insertions, 17 deletions
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c index 7ae0c4d51741..cc305c71ac3d 100644 --- a/drivers/usb/host/ehci-hub.c +++ b/drivers/usb/host/ehci-hub.c | |||
@@ -33,15 +33,6 @@ | |||
33 | 33 | ||
34 | #ifdef CONFIG_PM | 34 | #ifdef CONFIG_PM |
35 | 35 | ||
36 | static int ehci_hub_control( | ||
37 | struct usb_hcd *hcd, | ||
38 | u16 typeReq, | ||
39 | u16 wValue, | ||
40 | u16 wIndex, | ||
41 | char *buf, | ||
42 | u16 wLength | ||
43 | ); | ||
44 | |||
45 | static int persist_enabled_on_companion(struct usb_device *udev, void *unused) | 36 | static int persist_enabled_on_companion(struct usb_device *udev, void *unused) |
46 | { | 37 | { |
47 | return !udev->maxchild && udev->persist_enabled && | 38 | return !udev->maxchild && udev->persist_enabled && |
@@ -865,7 +856,7 @@ cleanup: | |||
865 | #endif /* CONFIG_USB_HCD_TEST_MODE */ | 856 | #endif /* CONFIG_USB_HCD_TEST_MODE */ |
866 | /*-------------------------------------------------------------------------*/ | 857 | /*-------------------------------------------------------------------------*/ |
867 | 858 | ||
868 | static int ehci_hub_control ( | 859 | int ehci_hub_control( |
869 | struct usb_hcd *hcd, | 860 | struct usb_hcd *hcd, |
870 | u16 typeReq, | 861 | u16 typeReq, |
871 | u16 wValue, | 862 | u16 wValue, |
@@ -1285,6 +1276,7 @@ error_exit: | |||
1285 | spin_unlock_irqrestore (&ehci->lock, flags); | 1276 | spin_unlock_irqrestore (&ehci->lock, flags); |
1286 | return retval; | 1277 | return retval; |
1287 | } | 1278 | } |
1279 | EXPORT_SYMBOL_GPL(ehci_hub_control); | ||
1288 | 1280 | ||
1289 | static void ehci_relinquish_port(struct usb_hcd *hcd, int portnum) | 1281 | static void ehci_relinquish_port(struct usb_hcd *hcd, int portnum) |
1290 | { | 1282 | { |
diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c index 7ef00ecb0da1..572634cd95d6 100644 --- a/drivers/usb/host/ehci-tegra.c +++ b/drivers/usb/host/ehci-tegra.c | |||
@@ -51,10 +51,6 @@ struct tegra_ehci_soc_config { | |||
51 | bool has_hostpc; | 51 | bool has_hostpc; |
52 | }; | 52 | }; |
53 | 53 | ||
54 | static int (*orig_hub_control)(struct usb_hcd *hcd, | ||
55 | u16 typeReq, u16 wValue, u16 wIndex, | ||
56 | char *buf, u16 wLength); | ||
57 | |||
58 | struct tegra_ehci_hcd { | 54 | struct tegra_ehci_hcd { |
59 | struct tegra_usb_phy *phy; | 55 | struct tegra_usb_phy *phy; |
60 | struct clk *clk; | 56 | struct clk *clk; |
@@ -236,7 +232,7 @@ static int tegra_ehci_hub_control( | |||
236 | spin_unlock_irqrestore(&ehci->lock, flags); | 232 | spin_unlock_irqrestore(&ehci->lock, flags); |
237 | 233 | ||
238 | /* Handle the hub control events here */ | 234 | /* Handle the hub control events here */ |
239 | return orig_hub_control(hcd, typeReq, wValue, wIndex, buf, wLength); | 235 | return ehci_hub_control(hcd, typeReq, wValue, wIndex, buf, wLength); |
240 | 236 | ||
241 | done: | 237 | done: |
242 | spin_unlock_irqrestore(&ehci->lock, flags); | 238 | spin_unlock_irqrestore(&ehci->lock, flags); |
@@ -554,8 +550,6 @@ static int __init ehci_tegra_init(void) | |||
554 | * too easy. | 550 | * too easy. |
555 | */ | 551 | */ |
556 | 552 | ||
557 | orig_hub_control = tegra_ehci_hc_driver.hub_control; | ||
558 | |||
559 | tegra_ehci_hc_driver.map_urb_for_dma = tegra_ehci_map_urb_for_dma; | 553 | tegra_ehci_hc_driver.map_urb_for_dma = tegra_ehci_map_urb_for_dma; |
560 | tegra_ehci_hc_driver.unmap_urb_for_dma = tegra_ehci_unmap_urb_for_dma; | 554 | tegra_ehci_hc_driver.unmap_urb_for_dma = tegra_ehci_unmap_urb_for_dma; |
561 | tegra_ehci_hc_driver.hub_control = tegra_ehci_hub_control; | 555 | tegra_ehci_hc_driver.hub_control = tegra_ehci_hub_control; |
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h index 9dfc6c1394d6..eee228a26a0e 100644 --- a/drivers/usb/host/ehci.h +++ b/drivers/usb/host/ehci.h | |||
@@ -872,4 +872,7 @@ extern int ehci_suspend(struct usb_hcd *hcd, bool do_wakeup); | |||
872 | extern int ehci_resume(struct usb_hcd *hcd, bool hibernated); | 872 | extern int ehci_resume(struct usb_hcd *hcd, bool hibernated); |
873 | #endif /* CONFIG_PM */ | 873 | #endif /* CONFIG_PM */ |
874 | 874 | ||
875 | extern int ehci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, | ||
876 | u16 wIndex, char *buf, u16 wLength); | ||
877 | |||
875 | #endif /* __LINUX_EHCI_HCD_H */ | 878 | #endif /* __LINUX_EHCI_HCD_H */ |