aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2012-10-10 15:07:46 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-24 17:45:17 -0400
commitd39dbc8918be0e6bb850592e334203c9114c0e77 (patch)
tree85b33ea568a1c27b33692736c6a2bdeb1a997df7 /drivers/usb/host
parentacc08503406f97ce6582c92fd8c8139f1e871a96 (diff)
USB: EHCI: move ehci_update_device() to ehci-lpm.c
In preparation for splitting the ehci-hcd driver into a core library and separate platform-specific driver modules, this patch (as1618) moves ehci_update_device() from a couple of platform-specific source files into ehci-lpm.c. This is where it should have been all along, since all it does is call a couple of other functions that are already in ehci-lpm.c. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Acked-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r--drivers/usb/host/ehci-lpm.c23
-rw-r--r--drivers/usb/host/ehci-pci.c16
-rw-r--r--drivers/usb/host/ehci-vt8500.c16
3 files changed, 20 insertions, 35 deletions
diff --git a/drivers/usb/host/ehci-lpm.c b/drivers/usb/host/ehci-lpm.c
index 2111627a19de..6b092c1dff64 100644
--- a/drivers/usb/host/ehci-lpm.c
+++ b/drivers/usb/host/ehci-lpm.c
@@ -17,8 +17,8 @@
17*/ 17*/
18 18
19/* this file is part of ehci-hcd.c */ 19/* this file is part of ehci-hcd.c */
20static int __maybe_unused ehci_lpm_set_da(struct ehci_hcd *ehci, 20
21 int dev_addr, int port_num) 21static int ehci_lpm_set_da(struct ehci_hcd *ehci, int dev_addr, int port_num)
22{ 22{
23 u32 __iomem portsc; 23 u32 __iomem portsc;
24 24
@@ -38,7 +38,7 @@ static int __maybe_unused ehci_lpm_set_da(struct ehci_hcd *ehci,
38 * this function is used to check if the device support LPM 38 * this function is used to check if the device support LPM
39 * if yes, mark the PORTSC register with PORT_LPM bit 39 * if yes, mark the PORTSC register with PORT_LPM bit
40 */ 40 */
41static int __maybe_unused ehci_lpm_check(struct ehci_hcd *ehci, int port) 41static int ehci_lpm_check(struct ehci_hcd *ehci, int port)
42{ 42{
43 u32 __iomem *portsc ; 43 u32 __iomem *portsc ;
44 u32 val32; 44 u32 val32;
@@ -82,3 +82,20 @@ static int __maybe_unused ehci_lpm_check(struct ehci_hcd *ehci, int port)
82 82
83 return retval; 83 return retval;
84} 84}
85
86static int __maybe_unused ehci_update_device(struct usb_hcd *hcd,
87 struct usb_device *udev)
88{
89 struct ehci_hcd *ehci = hcd_to_ehci(hcd);
90 int rc = 0;
91
92 if (!udev->parent) /* udev is root hub itself, impossible */
93 rc = -1;
94 /* we only support lpm device connected to root hub yet */
95 if (ehci->has_lpm && !udev->parent->parent) {
96 rc = ehci_lpm_set_da(ehci, udev->devnum, udev->portnum);
97 if (!rc)
98 rc = ehci_lpm_check(ehci, udev->portnum);
99 }
100 return rc;
101}
diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
index d1407f8d42b1..7880ba621f89 100644
--- a/drivers/usb/host/ehci-pci.c
+++ b/drivers/usb/host/ehci-pci.c
@@ -379,22 +379,6 @@ static int ehci_pci_resume(struct usb_hcd *hcd, bool hibernated)
379} 379}
380#endif 380#endif
381 381
382static int ehci_update_device(struct usb_hcd *hcd, struct usb_device *udev)
383{
384 struct ehci_hcd *ehci = hcd_to_ehci(hcd);
385 int rc = 0;
386
387 if (!udev->parent) /* udev is root hub itself, impossible */
388 rc = -1;
389 /* we only support lpm device connected to root hub yet */
390 if (ehci->has_lpm && !udev->parent->parent) {
391 rc = ehci_lpm_set_da(ehci, udev->devnum, udev->portnum);
392 if (!rc)
393 rc = ehci_lpm_check(ehci, udev->portnum);
394 }
395 return rc;
396}
397
398static const struct hc_driver ehci_pci_hc_driver = { 382static const struct hc_driver ehci_pci_hc_driver = {
399 .description = hcd_name, 383 .description = hcd_name,
400 .product_desc = "EHCI Host Controller", 384 .product_desc = "EHCI Host Controller",
diff --git a/drivers/usb/host/ehci-vt8500.c b/drivers/usb/host/ehci-vt8500.c
index d3c9a3e397b9..c6fe0bb619cb 100644
--- a/drivers/usb/host/ehci-vt8500.c
+++ b/drivers/usb/host/ehci-vt8500.c
@@ -19,22 +19,6 @@
19#include <linux/of.h> 19#include <linux/of.h>
20#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21 21
22static int ehci_update_device(struct usb_hcd *hcd, struct usb_device *udev)
23{
24 struct ehci_hcd *ehci = hcd_to_ehci(hcd);
25 int rc = 0;
26
27 if (!udev->parent) /* udev is root hub itself, impossible */
28 rc = -1;
29 /* we only support lpm device connected to root hub yet */
30 if (ehci->has_lpm && !udev->parent->parent) {
31 rc = ehci_lpm_set_da(ehci, udev->devnum, udev->portnum);
32 if (!rc)
33 rc = ehci_lpm_check(ehci, udev->portnum);
34 }
35 return rc;
36}
37
38static const struct hc_driver vt8500_ehci_hc_driver = { 22static const struct hc_driver vt8500_ehci_hc_driver = {
39 .description = hcd_name, 23 .description = hcd_name,
40 .product_desc = "VT8500 EHCI", 24 .product_desc = "VT8500 EHCI",