Skip to content

Commit

Permalink
Merge branch 'usb-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/gregkh/usb-2.6

* 'usb-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6:
  xHCI: Clear PLC in xhci_bus_resume()
  USB: fix regression in usbip by setting has_tt flag
  usb/isp1760: Report correct urb status after unlink
  omap:usb: add regulator support for EHCI
  mfd: Fix usbhs_enable error handling
  usb: musb: gadget: Fix out-of-sync runtime pm calls
  usb: musb: omap2430: Fix retention idle on musb peripheral only boards
  • Loading branch information
torvalds committed May 4, 2011
2 parents bd355f8 + 4f0871a commit 0ecb063
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 14 deletions.
9 changes: 3 additions & 6 deletions drivers/mfd/omap-usb-host.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include <linux/dma-mapping.h>
#include <linux/spinlock.h>
#include <linux/gpio.h>
#include <linux/regulator/consumer.h>
#include <plat/usb.h>

#define USBHS_DRIVER_NAME "usbhs-omap"
Expand Down Expand Up @@ -700,8 +699,7 @@ static int usbhs_enable(struct device *dev)
dev_dbg(dev, "starting TI HSUSB Controller\n");
if (!pdata) {
dev_dbg(dev, "missing platform_data\n");
ret = -ENODEV;
goto end_enable;
return -ENODEV;
}

spin_lock_irqsave(&omap->lock, flags);
Expand Down Expand Up @@ -915,7 +913,8 @@ static int usbhs_enable(struct device *dev)

end_count:
omap->count++;
goto end_enable;
spin_unlock_irqrestore(&omap->lock, flags);
return 0;

err_tll:
if (pdata->ehci_data->phy_reset) {
Expand All @@ -931,8 +930,6 @@ static int usbhs_enable(struct device *dev)
clk_disable(omap->usbhost_fs_fck);
clk_disable(omap->usbhost_hs_fck);
clk_disable(omap->usbhost_ick);

end_enable:
spin_unlock_irqrestore(&omap->lock, flags);
return ret;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/usbip/vhci_hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1139,7 +1139,7 @@ static int vhci_hcd_probe(struct platform_device *pdev)
usbip_uerr("create hcd failed\n");
return -ENOMEM;
}

hcd->has_tt = 1;

/* this is private data for vhci_hcd */
the_controller = hcd_to_vhci(hcd);
Expand Down
20 changes: 20 additions & 0 deletions drivers/usb/host/ehci-omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include <linux/slab.h>
#include <linux/usb/ulpi.h>
#include <plat/usb.h>
#include <linux/regulator/consumer.h>

/* EHCI Register Set */
#define EHCI_INSNREG04 (0xA0)
Expand Down Expand Up @@ -118,6 +119,8 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
struct ehci_hcd *omap_ehci;
int ret = -ENODEV;
int irq;
int i;
char supply[7];

if (usb_disabled())
return -ENODEV;
Expand Down Expand Up @@ -158,6 +161,23 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
hcd->rsrc_len = resource_size(res);
hcd->regs = regs;

/* get ehci regulator and enable */
for (i = 0 ; i < OMAP3_HS_USB_PORTS ; i++) {
if (pdata->port_mode[i] != OMAP_EHCI_PORT_MODE_PHY) {
pdata->regulator[i] = NULL;
continue;
}
snprintf(supply, sizeof(supply), "hsusb%d", i);
pdata->regulator[i] = regulator_get(dev, supply);
if (IS_ERR(pdata->regulator[i])) {
pdata->regulator[i] = NULL;
dev_dbg(dev,
"failed to get ehci port%d regulator\n", i);
} else {
regulator_enable(pdata->regulator[i]);
}
}

ret = omap_usbhs_enable(dev);
if (ret) {
dev_err(dev, "failed to start usbhs with err %d\n", ret);
Expand Down
1 change: 1 addition & 0 deletions drivers/usb/host/isp1760-hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1633,6 +1633,7 @@ static int isp1760_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
ints[i].qh = NULL;
ints[i].qtd = NULL;

urb->status = status;
isp1760_urb_done(hcd, urb);
if (qtd)
pe(hcd, qh, qtd);
Expand Down
19 changes: 17 additions & 2 deletions drivers/usb/host/xhci-hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ int xhci_bus_suspend(struct usb_hcd *hcd)
if (t1 != t2)
xhci_writel(xhci, t2, port_array[port_index]);

if (DEV_HIGHSPEED(t1)) {
if (hcd->speed != HCD_USB3) {
/* enable remote wake up for USB 2.0 */
u32 __iomem *addr;
u32 tmp;
Expand Down Expand Up @@ -866,14 +866,29 @@ int xhci_bus_resume(struct usb_hcd *hcd)
temp |= PORT_LINK_STROBE | XDEV_U0;
xhci_writel(xhci, temp, port_array[port_index]);
}
/* wait for the port to enter U0 and report port link
* state change.
*/
spin_unlock_irqrestore(&xhci->lock, flags);
msleep(20);
spin_lock_irqsave(&xhci->lock, flags);

/* Clear PLC */
temp = xhci_readl(xhci, port_array[port_index]);
if (temp & PORT_PLC) {
temp = xhci_port_state_to_neutral(temp);
temp |= PORT_PLC;
xhci_writel(xhci, temp, port_array[port_index]);
}

slot_id = xhci_find_slot_id_by_port(hcd,
xhci, port_index + 1);
if (slot_id)
xhci_ring_device(xhci, slot_id);
} else
xhci_writel(xhci, temp, port_array[port_index]);

if (DEV_HIGHSPEED(temp)) {
if (hcd->speed != HCD_USB3) {
/* disable remote wake up for USB 2.0 */
u32 __iomem *addr;
u32 tmp;
Expand Down
6 changes: 2 additions & 4 deletions drivers/usb/musb/musb_gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -1887,11 +1887,9 @@ int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
otg_set_vbus(musb->xceiv, 1);

hcd->self.uses_pio_for_control = 1;

if (musb->xceiv->last_event == USB_EVENT_NONE)
pm_runtime_put(musb->controller);

}
if (musb->xceiv->last_event == USB_EVENT_NONE)
pm_runtime_put(musb->controller);

return 0;

Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/musb/omap2430.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ static int musb_otg_notifications(struct notifier_block *nb,
DBG(4, "VBUS Disconnect\n");

#ifdef CONFIG_USB_GADGET_MUSB_HDRC
if (is_otg_enabled(musb))
if (is_otg_enabled(musb) || is_peripheral_enabled(musb))
if (musb->gadget_driver)
#endif
{
Expand Down

0 comments on commit 0ecb063

Please sign in to comment.