aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ehci-hcd.c
diff options
context:
space:
mode:
authorMichael Grzeschik <m.grzeschik@pengutronix.de>2014-10-12 21:53:03 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-11-03 18:34:00 -0500
commit11a7e59405148c855e0a9d13588930ccec02c150 (patch)
treea8e21a87496d8ec3fee589dfea21766d2813d58f /drivers/usb/host/ehci-hcd.c
parente28e2f2f7c42e5b9dd4c965a0245267e44a8a7ae (diff)
usb: ehci: add ehci_port_power interface
The current EHCI implementation is prepared to toggle the PORT_POWER bit to enable or disable a USB-Port. In some cases this port power can not be just toggled by the PORT_POWER bit, and the gpio-regulator is needed to be toggled too. This patch defines a port power control interface ehci_port_power for ehci core use, it toggles PORT_POWER bit as well as calls platform defined .port_power if it is defined. Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Peter Chen <peter.chen@freescale.com> Acked-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/ehci-hcd.c')
-rw-r--r--drivers/usb/host/ehci-hcd.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 15feaf924b71..df75b8e7d157 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -311,6 +311,7 @@ static void unlink_empty_async_suspended(struct ehci_hcd *ehci);
311static void ehci_work(struct ehci_hcd *ehci); 311static void ehci_work(struct ehci_hcd *ehci);
312static void start_unlink_intr(struct ehci_hcd *ehci, struct ehci_qh *qh); 312static void start_unlink_intr(struct ehci_hcd *ehci, struct ehci_qh *qh);
313static void end_unlink_intr(struct ehci_hcd *ehci, struct ehci_qh *qh); 313static void end_unlink_intr(struct ehci_hcd *ehci, struct ehci_qh *qh);
314static int ehci_port_power(struct ehci_hcd *ehci, int portnum, bool enable);
314 315
315#include "ehci-timer.c" 316#include "ehci-timer.c"
316#include "ehci-hub.c" 317#include "ehci-hub.c"
@@ -329,9 +330,13 @@ static void ehci_turn_off_all_ports(struct ehci_hcd *ehci)
329{ 330{
330 int port = HCS_N_PORTS(ehci->hcs_params); 331 int port = HCS_N_PORTS(ehci->hcs_params);
331 332
332 while (port--) 333 while (port--) {
333 ehci_writel(ehci, PORT_RWC_BITS, 334 ehci_writel(ehci, PORT_RWC_BITS,
334 &ehci->regs->port_status[port]); 335 &ehci->regs->port_status[port]);
336 spin_unlock_irq(&ehci->lock);
337 ehci_port_power(ehci, port, false);
338 spin_lock_irq(&ehci->lock);
339 }
335} 340}
336 341
337/* 342/*
@@ -1233,6 +1238,8 @@ void ehci_init_driver(struct hc_driver *drv,
1233 drv->hcd_priv_size += over->extra_priv_size; 1238 drv->hcd_priv_size += over->extra_priv_size;
1234 if (over->reset) 1239 if (over->reset)
1235 drv->reset = over->reset; 1240 drv->reset = over->reset;
1241 if (over->port_power)
1242 drv->port_power = over->port_power;
1236 } 1243 }
1237} 1244}
1238EXPORT_SYMBOL_GPL(ehci_init_driver); 1245EXPORT_SYMBOL_GPL(ehci_init_driver);