diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-02-23 13:40:22 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-02-23 13:40:22 -0500 |
| commit | f9b080803ec66f708309ceffab14ce879c302963 (patch) | |
| tree | 746cc5c38dd6cec3fc1ac7305f1c9430c6033a19 | |
| parent | e0f13bd46ac4faa26a34fc33b457013d5b8a96f5 (diff) | |
| parent | 5bf5dbeda2454296f1984adfbfc8e6f5965ac389 (diff) | |
Merge tag 'usb-3.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB fixes from Greg KH:
"Here are a number of USB fixes for reported issues for 3.14-rc4
The majority of these are for USB gadget, phy, and musb driver issues.
And there's a few new device ids thrown in for good measure"
* tag 'usb-3.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
usb: chipidea: need to mask when writting endptflush and endptprime
usb: musb: correct use of schedule_delayed_work()
usb: phy: msm: fix compilation errors when !CONFIG_PM_SLEEP
usb: gadget: fix NULL pointer dereference
usb: gadget: printer: using gadget_is_otg to check otg support at runtime
phy: let phy_provider_register be the last step in registering PHY
phy-core: Don't allow building phy-core as a module
phy-core: Don't propagate -ENOSUPP from phy_pm_runtime_get_sync to caller
phy-core: phy_get: Leave error logging to the caller
phy,phy-bcm-kona-usb2.c: Add dependency on HAS_IOMEM
usb: musb: correct use of schedule_delayed_work()
usb: musb: do not sleep in atomic context
USB: serial: option: blacklist interface 4 for Cinterion PHS8 and PXS8
USB: EHCI: add delay during suspend to prevent erroneous wakeups
usb: gadget: bcm63xx_udc: fix build failure on DMA channel code
usb: musb: do not sleep in atomic context
usb: gadget: s3c2410_udc: Fix build error
usb: musb: core: Fix remote-wakeup resume
usb: musb: host: Fix SuperSpeed hub enumeration
usb: musb: fix obex in g_nokia.ko causing kernel panic
| -rw-r--r-- | drivers/phy/Kconfig | 3 | ||||
| -rw-r--r-- | drivers/phy/phy-core.c | 14 | ||||
| -rw-r--r-- | drivers/phy/phy-exynos-dp-video.c | 8 | ||||
| -rw-r--r-- | drivers/phy/phy-exynos-mipi-video.c | 10 | ||||
| -rw-r--r-- | drivers/phy/phy-mvebu-sata.c | 10 | ||||
| -rw-r--r-- | drivers/phy/phy-omap-usb2.c | 10 | ||||
| -rw-r--r-- | drivers/phy/phy-twl4030-usb.c | 10 | ||||
| -rw-r--r-- | drivers/usb/chipidea/udc.c | 4 | ||||
| -rw-r--r-- | drivers/usb/gadget/bcm63xx_udc.c | 58 | ||||
| -rw-r--r-- | drivers/usb/gadget/f_fs.c | 7 | ||||
| -rw-r--r-- | drivers/usb/gadget/printer.c | 2 | ||||
| -rw-r--r-- | drivers/usb/gadget/s3c2410_udc.c | 2 | ||||
| -rw-r--r-- | drivers/usb/host/ehci-hub.c | 26 | ||||
| -rw-r--r-- | drivers/usb/musb/musb_core.c | 15 | ||||
| -rw-r--r-- | drivers/usb/musb/musb_host.c | 3 | ||||
| -rw-r--r-- | drivers/usb/musb/musb_virthub.c | 26 | ||||
| -rw-r--r-- | drivers/usb/musb/omap2430.c | 2 | ||||
| -rw-r--r-- | drivers/usb/phy/phy-msm-usb.c | 57 | ||||
| -rw-r--r-- | drivers/usb/serial/option.c | 3 |
19 files changed, 159 insertions, 111 deletions
diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig index afa2354f6600..c7a551c2d5f1 100644 --- a/drivers/phy/Kconfig +++ b/drivers/phy/Kconfig | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | menu "PHY Subsystem" | 5 | menu "PHY Subsystem" |
| 6 | 6 | ||
| 7 | config GENERIC_PHY | 7 | config GENERIC_PHY |
| 8 | tristate "PHY Core" | 8 | bool "PHY Core" |
| 9 | help | 9 | help |
| 10 | Generic PHY support. | 10 | Generic PHY support. |
| 11 | 11 | ||
| @@ -61,6 +61,7 @@ config PHY_EXYNOS_DP_VIDEO | |||
| 61 | config BCM_KONA_USB2_PHY | 61 | config BCM_KONA_USB2_PHY |
| 62 | tristate "Broadcom Kona USB2 PHY Driver" | 62 | tristate "Broadcom Kona USB2 PHY Driver" |
| 63 | depends on GENERIC_PHY | 63 | depends on GENERIC_PHY |
| 64 | depends on HAS_IOMEM | ||
| 64 | help | 65 | help |
| 65 | Enable this to support the Broadcom Kona USB 2.0 PHY. | 66 | Enable this to support the Broadcom Kona USB 2.0 PHY. |
| 66 | 67 | ||
diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c index 5f5b0f4be5be..6c738376daff 100644 --- a/drivers/phy/phy-core.c +++ b/drivers/phy/phy-core.c | |||
| @@ -176,6 +176,8 @@ int phy_init(struct phy *phy) | |||
| 176 | dev_err(&phy->dev, "phy init failed --> %d\n", ret); | 176 | dev_err(&phy->dev, "phy init failed --> %d\n", ret); |
| 177 | goto out; | 177 | goto out; |
| 178 | } | 178 | } |
| 179 | } else { | ||
| 180 | ret = 0; /* Override possible ret == -ENOTSUPP */ | ||
| 179 | } | 181 | } |
| 180 | ++phy->init_count; | 182 | ++phy->init_count; |
| 181 | 183 | ||
| @@ -232,6 +234,8 @@ int phy_power_on(struct phy *phy) | |||
| 232 | dev_err(&phy->dev, "phy poweron failed --> %d\n", ret); | 234 | dev_err(&phy->dev, "phy poweron failed --> %d\n", ret); |
| 233 | goto out; | 235 | goto out; |
| 234 | } | 236 | } |
| 237 | } else { | ||
| 238 | ret = 0; /* Override possible ret == -ENOTSUPP */ | ||
| 235 | } | 239 | } |
| 236 | ++phy->power_count; | 240 | ++phy->power_count; |
| 237 | mutex_unlock(&phy->mutex); | 241 | mutex_unlock(&phy->mutex); |
| @@ -404,17 +408,11 @@ struct phy *phy_get(struct device *dev, const char *string) | |||
| 404 | index = of_property_match_string(dev->of_node, "phy-names", | 408 | index = of_property_match_string(dev->of_node, "phy-names", |
| 405 | string); | 409 | string); |
| 406 | phy = of_phy_get(dev, index); | 410 | phy = of_phy_get(dev, index); |
| 407 | if (IS_ERR(phy)) { | ||
| 408 | dev_err(dev, "unable to find phy\n"); | ||
| 409 | return phy; | ||
| 410 | } | ||
| 411 | } else { | 411 | } else { |
| 412 | phy = phy_lookup(dev, string); | 412 | phy = phy_lookup(dev, string); |
| 413 | if (IS_ERR(phy)) { | ||
| 414 | dev_err(dev, "unable to find phy\n"); | ||
| 415 | return phy; | ||
| 416 | } | ||
| 417 | } | 413 | } |
| 414 | if (IS_ERR(phy)) | ||
| 415 | return phy; | ||
| 418 | 416 | ||
| 419 | if (!try_module_get(phy->ops->owner)) | 417 | if (!try_module_get(phy->ops->owner)) |
| 420 | return ERR_PTR(-EPROBE_DEFER); | 418 | return ERR_PTR(-EPROBE_DEFER); |
diff --git a/drivers/phy/phy-exynos-dp-video.c b/drivers/phy/phy-exynos-dp-video.c index 1dbe6ce7b2ce..0786fef842e7 100644 --- a/drivers/phy/phy-exynos-dp-video.c +++ b/drivers/phy/phy-exynos-dp-video.c | |||
| @@ -76,10 +76,6 @@ static int exynos_dp_video_phy_probe(struct platform_device *pdev) | |||
| 76 | if (IS_ERR(state->regs)) | 76 | if (IS_ERR(state->regs)) |
| 77 | return PTR_ERR(state->regs); | 77 | return PTR_ERR(state->regs); |
| 78 | 78 | ||
| 79 | phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate); | ||
| 80 | if (IS_ERR(phy_provider)) | ||
| 81 | return PTR_ERR(phy_provider); | ||
| 82 | |||
| 83 | phy = devm_phy_create(dev, &exynos_dp_video_phy_ops, NULL); | 79 | phy = devm_phy_create(dev, &exynos_dp_video_phy_ops, NULL); |
| 84 | if (IS_ERR(phy)) { | 80 | if (IS_ERR(phy)) { |
| 85 | dev_err(dev, "failed to create Display Port PHY\n"); | 81 | dev_err(dev, "failed to create Display Port PHY\n"); |
| @@ -87,6 +83,10 @@ static int exynos_dp_video_phy_probe(struct platform_device *pdev) | |||
| 87 | } | 83 | } |
| 88 | phy_set_drvdata(phy, state); | 84 | phy_set_drvdata(phy, state); |
| 89 | 85 | ||
| 86 | phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate); | ||
| 87 | if (IS_ERR(phy_provider)) | ||
| 88 | return PTR_ERR(phy_provider); | ||
| 89 | |||
| 90 | return 0; | 90 | return 0; |
| 91 | } | 91 | } |
| 92 | 92 | ||
diff --git a/drivers/phy/phy-exynos-mipi-video.c b/drivers/phy/phy-exynos-mipi-video.c index 0c5efab11af1..7f139326a642 100644 --- a/drivers/phy/phy-exynos-mipi-video.c +++ b/drivers/phy/phy-exynos-mipi-video.c | |||
| @@ -134,11 +134,6 @@ static int exynos_mipi_video_phy_probe(struct platform_device *pdev) | |||
| 134 | dev_set_drvdata(dev, state); | 134 | dev_set_drvdata(dev, state); |
| 135 | spin_lock_init(&state->slock); | 135 | spin_lock_init(&state->slock); |
| 136 | 136 | ||
| 137 | phy_provider = devm_of_phy_provider_register(dev, | ||
| 138 | exynos_mipi_video_phy_xlate); | ||
| 139 | if (IS_ERR(phy_provider)) | ||
| 140 | return PTR_ERR(phy_provider); | ||
| 141 | |||
| 142 | for (i = 0; i < EXYNOS_MIPI_PHYS_NUM; i++) { | 137 | for (i = 0; i < EXYNOS_MIPI_PHYS_NUM; i++) { |
| 143 | struct phy *phy = devm_phy_create(dev, | 138 | struct phy *phy = devm_phy_create(dev, |
| 144 | &exynos_mipi_video_phy_ops, NULL); | 139 | &exynos_mipi_video_phy_ops, NULL); |
| @@ -152,6 +147,11 @@ static int exynos_mipi_video_phy_probe(struct platform_device *pdev) | |||
| 152 | phy_set_drvdata(phy, &state->phys[i]); | 147 | phy_set_drvdata(phy, &state->phys[i]); |
| 153 | } | 148 | } |
| 154 | 149 | ||
| 150 | phy_provider = devm_of_phy_provider_register(dev, | ||
| 151 | exynos_mipi_video_phy_xlate); | ||
| 152 | if (IS_ERR(phy_provider)) | ||
| 153 | return PTR_ERR(phy_provider); | ||
| 154 | |||
| 155 | return 0; | 155 | return 0; |
| 156 | } | 156 | } |
| 157 | 157 | ||
diff --git a/drivers/phy/phy-mvebu-sata.c b/drivers/phy/phy-mvebu-sata.c index d43786f62437..d70ecd6a1b3f 100644 --- a/drivers/phy/phy-mvebu-sata.c +++ b/drivers/phy/phy-mvebu-sata.c | |||
| @@ -99,17 +99,17 @@ static int phy_mvebu_sata_probe(struct platform_device *pdev) | |||
| 99 | if (IS_ERR(priv->clk)) | 99 | if (IS_ERR(priv->clk)) |
| 100 | return PTR_ERR(priv->clk); | 100 | return PTR_ERR(priv->clk); |
| 101 | 101 | ||
| 102 | phy_provider = devm_of_phy_provider_register(&pdev->dev, | ||
| 103 | of_phy_simple_xlate); | ||
| 104 | if (IS_ERR(phy_provider)) | ||
| 105 | return PTR_ERR(phy_provider); | ||
| 106 | |||
| 107 | phy = devm_phy_create(&pdev->dev, &phy_mvebu_sata_ops, NULL); | 102 | phy = devm_phy_create(&pdev->dev, &phy_mvebu_sata_ops, NULL); |
| 108 | if (IS_ERR(phy)) | 103 | if (IS_ERR(phy)) |
| 109 | return PTR_ERR(phy); | 104 | return PTR_ERR(phy); |
| 110 | 105 | ||
| 111 | phy_set_drvdata(phy, priv); | 106 | phy_set_drvdata(phy, priv); |
| 112 | 107 | ||
| 108 | phy_provider = devm_of_phy_provider_register(&pdev->dev, | ||
| 109 | of_phy_simple_xlate); | ||
| 110 | if (IS_ERR(phy_provider)) | ||
| 111 | return PTR_ERR(phy_provider); | ||
| 112 | |||
| 113 | /* The boot loader may of left it on. Turn it off. */ | 113 | /* The boot loader may of left it on. Turn it off. */ |
| 114 | phy_mvebu_sata_power_off(phy); | 114 | phy_mvebu_sata_power_off(phy); |
| 115 | 115 | ||
diff --git a/drivers/phy/phy-omap-usb2.c b/drivers/phy/phy-omap-usb2.c index bfc5c337f99a..7699752fba11 100644 --- a/drivers/phy/phy-omap-usb2.c +++ b/drivers/phy/phy-omap-usb2.c | |||
| @@ -177,11 +177,6 @@ static int omap_usb2_probe(struct platform_device *pdev) | |||
| 177 | phy->phy.otg = otg; | 177 | phy->phy.otg = otg; |
| 178 | phy->phy.type = USB_PHY_TYPE_USB2; | 178 | phy->phy.type = USB_PHY_TYPE_USB2; |
| 179 | 179 | ||
| 180 | phy_provider = devm_of_phy_provider_register(phy->dev, | ||
| 181 | of_phy_simple_xlate); | ||
| 182 | if (IS_ERR(phy_provider)) | ||
| 183 | return PTR_ERR(phy_provider); | ||
| 184 | |||
| 185 | control_node = of_parse_phandle(node, "ctrl-module", 0); | 180 | control_node = of_parse_phandle(node, "ctrl-module", 0); |
| 186 | if (!control_node) { | 181 | if (!control_node) { |
| 187 | dev_err(&pdev->dev, "Failed to get control device phandle\n"); | 182 | dev_err(&pdev->dev, "Failed to get control device phandle\n"); |
| @@ -214,6 +209,11 @@ static int omap_usb2_probe(struct platform_device *pdev) | |||
| 214 | 209 | ||
| 215 | phy_set_drvdata(generic_phy, phy); | 210 | phy_set_drvdata(generic_phy, phy); |
| 216 | 211 | ||
| 212 | phy_provider = devm_of_phy_provider_register(phy->dev, | ||
| 213 | of_phy_simple_xlate); | ||
| 214 | if (IS_ERR(phy_provider)) | ||
| 215 | return PTR_ERR(phy_provider); | ||
| 216 | |||
| 217 | phy->wkupclk = devm_clk_get(phy->dev, "usb_phy_cm_clk32k"); | 217 | phy->wkupclk = devm_clk_get(phy->dev, "usb_phy_cm_clk32k"); |
| 218 | if (IS_ERR(phy->wkupclk)) { | 218 | if (IS_ERR(phy->wkupclk)) { |
| 219 | dev_err(&pdev->dev, "unable to get usb_phy_cm_clk32k\n"); | 219 | dev_err(&pdev->dev, "unable to get usb_phy_cm_clk32k\n"); |
diff --git a/drivers/phy/phy-twl4030-usb.c b/drivers/phy/phy-twl4030-usb.c index daf65e68aaab..c3ace1db8136 100644 --- a/drivers/phy/phy-twl4030-usb.c +++ b/drivers/phy/phy-twl4030-usb.c | |||
| @@ -695,11 +695,6 @@ static int twl4030_usb_probe(struct platform_device *pdev) | |||
| 695 | otg->set_host = twl4030_set_host; | 695 | otg->set_host = twl4030_set_host; |
| 696 | otg->set_peripheral = twl4030_set_peripheral; | 696 | otg->set_peripheral = twl4030_set_peripheral; |
| 697 | 697 | ||
| 698 | phy_provider = devm_of_phy_provider_register(twl->dev, | ||
| 699 | of_phy_simple_xlate); | ||
| 700 | if (IS_ERR(phy_provider)) | ||
| 701 | return PTR_ERR(phy_provider); | ||
| 702 | |||
| 703 | phy = devm_phy_create(twl->dev, &ops, init_data); | 698 | phy = devm_phy_create(twl->dev, &ops, init_data); |
| 704 | if (IS_ERR(phy)) { | 699 | if (IS_ERR(phy)) { |
| 705 | dev_dbg(&pdev->dev, "Failed to create PHY\n"); | 700 | dev_dbg(&pdev->dev, "Failed to create PHY\n"); |
| @@ -708,6 +703,11 @@ static int twl4030_usb_probe(struct platform_device *pdev) | |||
| 708 | 703 | ||
| 709 | phy_set_drvdata(phy, twl); | 704 | phy_set_drvdata(phy, twl); |
| 710 | 705 | ||
| 706 | phy_provider = devm_of_phy_provider_register(twl->dev, | ||
| 707 | of_phy_simple_xlate); | ||
| 708 | if (IS_ERR(phy_provider)) | ||
| 709 | return PTR_ERR(phy_provider); | ||
| 710 | |||
| 711 | /* init spinlock for workqueue */ | 711 | /* init spinlock for workqueue */ |
| 712 | spin_lock_init(&twl->lock); | 712 | spin_lock_init(&twl->lock); |
| 713 | 713 | ||
diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c index 80de2f88ed2c..4ab2cb62dfce 100644 --- a/drivers/usb/chipidea/udc.c +++ b/drivers/usb/chipidea/udc.c | |||
| @@ -105,7 +105,7 @@ static int hw_ep_flush(struct ci_hdrc *ci, int num, int dir) | |||
| 105 | 105 | ||
| 106 | do { | 106 | do { |
| 107 | /* flush any pending transfer */ | 107 | /* flush any pending transfer */ |
| 108 | hw_write(ci, OP_ENDPTFLUSH, BIT(n), BIT(n)); | 108 | hw_write(ci, OP_ENDPTFLUSH, ~0, BIT(n)); |
| 109 | while (hw_read(ci, OP_ENDPTFLUSH, BIT(n))) | 109 | while (hw_read(ci, OP_ENDPTFLUSH, BIT(n))) |
| 110 | cpu_relax(); | 110 | cpu_relax(); |
| 111 | } while (hw_read(ci, OP_ENDPTSTAT, BIT(n))); | 111 | } while (hw_read(ci, OP_ENDPTSTAT, BIT(n))); |
| @@ -205,7 +205,7 @@ static int hw_ep_prime(struct ci_hdrc *ci, int num, int dir, int is_ctrl) | |||
| 205 | if (is_ctrl && dir == RX && hw_read(ci, OP_ENDPTSETUPSTAT, BIT(num))) | 205 | if (is_ctrl && dir == RX && hw_read(ci, OP_ENDPTSETUPSTAT, BIT(num))) |
| 206 | return -EAGAIN; | 206 | return -EAGAIN; |
| 207 | 207 | ||
| 208 | hw_write(ci, OP_ENDPTPRIME, BIT(n), BIT(n)); | 208 | hw_write(ci, OP_ENDPTPRIME, ~0, BIT(n)); |
| 209 | 209 | ||
| 210 | while (hw_read(ci, OP_ENDPTPRIME, BIT(n))) | 210 | while (hw_read(ci, OP_ENDPTPRIME, BIT(n))) |
| 211 | cpu_relax(); | 211 | cpu_relax(); |
diff --git a/drivers/usb/gadget/bcm63xx_udc.c b/drivers/usb/gadget/bcm63xx_udc.c index 888fbb43b338..e969eb809a85 100644 --- a/drivers/usb/gadget/bcm63xx_udc.c +++ b/drivers/usb/gadget/bcm63xx_udc.c | |||
| @@ -360,24 +360,30 @@ static inline void usb_dma_writel(struct bcm63xx_udc *udc, u32 val, u32 off) | |||
| 360 | bcm_writel(val, udc->iudma_regs + off); | 360 | bcm_writel(val, udc->iudma_regs + off); |
| 361 | } | 361 | } |
| 362 | 362 | ||
| 363 | static inline u32 usb_dmac_readl(struct bcm63xx_udc *udc, u32 off) | 363 | static inline u32 usb_dmac_readl(struct bcm63xx_udc *udc, u32 off, int chan) |
| 364 | { | 364 | { |
| 365 | return bcm_readl(udc->iudma_regs + IUDMA_DMAC_OFFSET + off); | 365 | return bcm_readl(udc->iudma_regs + IUDMA_DMAC_OFFSET + off + |
| 366 | (ENETDMA_CHAN_WIDTH * chan)); | ||
| 366 | } | 367 | } |
| 367 | 368 | ||
| 368 | static inline void usb_dmac_writel(struct bcm63xx_udc *udc, u32 val, u32 off) | 369 | static inline void usb_dmac_writel(struct bcm63xx_udc *udc, u32 val, u32 off, |
| 370 | int chan) | ||
| 369 | { | 371 | { |
| 370 | bcm_writel(val, udc->iudma_regs + IUDMA_DMAC_OFFSET + off); | 372 | bcm_writel(val, udc->iudma_regs + IUDMA_DMAC_OFFSET + off + |
| 373 | (ENETDMA_CHAN_WIDTH * chan)); | ||
| 371 | } | 374 | } |
| 372 | 375 | ||
| 373 | static inline u32 usb_dmas_readl(struct bcm63xx_udc *udc, u32 off) | 376 | static inline u32 usb_dmas_readl(struct bcm63xx_udc *udc, u32 off, int chan) |
| 374 | { | 377 | { |
| 375 | return bcm_readl(udc->iudma_regs + IUDMA_DMAS_OFFSET + off); | 378 | return bcm_readl(udc->iudma_regs + IUDMA_DMAS_OFFSET + off + |
| 379 | (ENETDMA_CHAN_WIDTH * chan)); | ||
| 376 | } | 380 | } |
| 377 | 381 | ||
| 378 | static inline void usb_dmas_writel(struct bcm63xx_udc *udc, u32 val, u32 off) | 382 | static inline void usb_dmas_writel(struct bcm63xx_udc *udc, u32 val, u32 off, |
| 383 | int chan) | ||
| 379 | { | 384 | { |
| 380 | bcm_writel(val, udc->iudma_regs + IUDMA_DMAS_OFFSET + off); | 385 | bcm_writel(val, udc->iudma_regs + IUDMA_DMAS_OFFSET + off + |
| 386 | (ENETDMA_CHAN_WIDTH * chan)); | ||
| 381 | } | 387 | } |
| 382 | 388 | ||
| 383 | static inline void set_clocks(struct bcm63xx_udc *udc, bool is_enabled) | 389 | static inline void set_clocks(struct bcm63xx_udc *udc, bool is_enabled) |
| @@ -638,7 +644,7 @@ static void iudma_write(struct bcm63xx_udc *udc, struct iudma_ch *iudma, | |||
| 638 | } while (!last_bd); | 644 | } while (!last_bd); |
| 639 | 645 | ||
| 640 | usb_dmac_writel(udc, ENETDMAC_CHANCFG_EN_MASK, | 646 | usb_dmac_writel(udc, ENETDMAC_CHANCFG_EN_MASK, |
| 641 | ENETDMAC_CHANCFG_REG(iudma->ch_idx)); | 647 | ENETDMAC_CHANCFG_REG, iudma->ch_idx); |
| 642 | } | 648 | } |
| 643 | 649 | ||
| 644 | /** | 650 | /** |
| @@ -694,9 +700,9 @@ static void iudma_reset_channel(struct bcm63xx_udc *udc, struct iudma_ch *iudma) | |||
| 694 | bcm63xx_fifo_reset_ep(udc, max(0, iudma->ep_num)); | 700 | bcm63xx_fifo_reset_ep(udc, max(0, iudma->ep_num)); |
| 695 | 701 | ||
| 696 | /* stop DMA, then wait for the hardware to wrap up */ | 702 | /* stop DMA, then wait for the hardware to wrap up */ |
| 697 | usb_dmac_writel(udc, 0, ENETDMAC_CHANCFG_REG(ch_idx)); | 703 | usb_dmac_writel(udc, 0, ENETDMAC_CHANCFG_REG, ch_idx); |
| 698 | 704 | ||
| 699 | while (usb_dmac_readl(udc, ENETDMAC_CHANCFG_REG(ch_idx)) & | 705 | while (usb_dmac_readl(udc, ENETDMAC_CHANCFG_REG, ch_idx) & |
| 700 | ENETDMAC_CHANCFG_EN_MASK) { | 706 | ENETDMAC_CHANCFG_EN_MASK) { |
| 701 | udelay(1); | 707 | udelay(1); |
| 702 | 708 | ||
| @@ -713,10 +719,10 @@ static void iudma_reset_channel(struct bcm63xx_udc *udc, struct iudma_ch *iudma) | |||
| 713 | dev_warn(udc->dev, "forcibly halting IUDMA channel %d\n", | 719 | dev_warn(udc->dev, "forcibly halting IUDMA channel %d\n", |
| 714 | ch_idx); | 720 | ch_idx); |
| 715 | usb_dmac_writel(udc, ENETDMAC_CHANCFG_BUFHALT_MASK, | 721 | usb_dmac_writel(udc, ENETDMAC_CHANCFG_BUFHALT_MASK, |
| 716 | ENETDMAC_CHANCFG_REG(ch_idx)); | 722 | ENETDMAC_CHANCFG_REG, ch_idx); |
| 717 | } | 723 | } |
| 718 | } | 724 | } |
| 719 | usb_dmac_writel(udc, ~0, ENETDMAC_IR_REG(ch_idx)); | 725 | usb_dmac_writel(udc, ~0, ENETDMAC_IR_REG, ch_idx); |
| 720 | 726 | ||
| 721 | /* don't leave "live" HW-owned entries for the next guy to step on */ | 727 | /* don't leave "live" HW-owned entries for the next guy to step on */ |
| 722 | for (d = iudma->bd_ring; d <= iudma->end_bd; d++) | 728 | for (d = iudma->bd_ring; d <= iudma->end_bd; d++) |
| @@ -728,11 +734,11 @@ static void iudma_reset_channel(struct bcm63xx_udc *udc, struct iudma_ch *iudma) | |||
| 728 | 734 | ||
| 729 | /* set up IRQs, UBUS burst size, and BD base for this channel */ | 735 | /* set up IRQs, UBUS burst size, and BD base for this channel */ |
| 730 | usb_dmac_writel(udc, ENETDMAC_IR_BUFDONE_MASK, | 736 | usb_dmac_writel(udc, ENETDMAC_IR_BUFDONE_MASK, |
| 731 | ENETDMAC_IRMASK_REG(ch_idx)); | 737 | ENETDMAC_IRMASK_REG, ch_idx); |
| 732 | usb_dmac_writel(udc, 8, ENETDMAC_MAXBURST_REG(ch_idx)); | 738 | usb_dmac_writel(udc, 8, ENETDMAC_MAXBURST_REG, ch_idx); |
| 733 | 739 | ||
| 734 | usb_dmas_writel(udc, iudma->bd_ring_dma, ENETDMAS_RSTART_REG(ch_idx)); | 740 | usb_dmas_writel(udc, iudma->bd_ring_dma, ENETDMAS_RSTART_REG, ch_idx); |
| 735 | usb_dmas_writel(udc, 0, ENETDMAS_SRAM2_REG(ch_idx)); | 741 | usb_dmas_writel(udc, 0, ENETDMAS_SRAM2_REG, ch_idx); |
| 736 | } | 742 | } |
| 737 | 743 | ||
| 738 | /** | 744 | /** |
| @@ -2035,7 +2041,7 @@ static irqreturn_t bcm63xx_udc_data_isr(int irq, void *dev_id) | |||
| 2035 | spin_lock(&udc->lock); | 2041 | spin_lock(&udc->lock); |
| 2036 | 2042 | ||
| 2037 | usb_dmac_writel(udc, ENETDMAC_IR_BUFDONE_MASK, | 2043 | usb_dmac_writel(udc, ENETDMAC_IR_BUFDONE_MASK, |
| 2038 | ENETDMAC_IR_REG(iudma->ch_idx)); | 2044 | ENETDMAC_IR_REG, iudma->ch_idx); |
| 2039 | bep = iudma->bep; | 2045 | bep = iudma->bep; |
| 2040 | rc = iudma_read(udc, iudma); | 2046 | rc = iudma_read(udc, iudma); |
| 2041 | 2047 | ||
| @@ -2175,18 +2181,18 @@ static int bcm63xx_iudma_dbg_show(struct seq_file *s, void *p) | |||
| 2175 | seq_printf(s, " [ep%d]:\n", | 2181 | seq_printf(s, " [ep%d]:\n", |
| 2176 | max_t(int, iudma_defaults[ch_idx].ep_num, 0)); | 2182 | max_t(int, iudma_defaults[ch_idx].ep_num, 0)); |
| 2177 | seq_printf(s, " cfg: %08x; irqstat: %08x; irqmask: %08x; maxburst: %08x\n", | 2183 | seq_printf(s, " cfg: %08x; irqstat: %08x; irqmask: %08x; maxburst: %08x\n", |
| 2178 | usb_dmac_readl(udc, ENETDMAC_CHANCFG_REG(ch_idx)), | 2184 | usb_dmac_readl(udc, ENETDMAC_CHANCFG_REG, ch_idx), |
| 2179 | usb_dmac_readl(udc, ENETDMAC_IR_REG(ch_idx)), | 2185 | usb_dmac_readl(udc, ENETDMAC_IR_REG, ch_idx), |
| 2180 | usb_dmac_readl(udc, ENETDMAC_IRMASK_REG(ch_idx)), | 2186 | usb_dmac_readl(udc, ENETDMAC_IRMASK_REG, ch_idx), |
| 2181 | usb_dmac_readl(udc, ENETDMAC_MAXBURST_REG(ch_idx))); | 2187 | usb_dmac_readl(udc, ENETDMAC_MAXBURST_REG, ch_idx)); |
| 2182 | 2188 | ||
| 2183 | sram2 = usb_dmas_readl(udc, ENETDMAS_SRAM2_REG(ch_idx)); | 2189 | sram2 = usb_dmas_readl(udc, ENETDMAS_SRAM2_REG, ch_idx); |
| 2184 | sram3 = usb_dmas_readl(udc, ENETDMAS_SRAM3_REG(ch_idx)); | 2190 | sram3 = usb_dmas_readl(udc, ENETDMAS_SRAM3_REG, ch_idx); |
| 2185 | seq_printf(s, " base: %08x; index: %04x_%04x; desc: %04x_%04x %08x\n", | 2191 | seq_printf(s, " base: %08x; index: %04x_%04x; desc: %04x_%04x %08x\n", |
| 2186 | usb_dmas_readl(udc, ENETDMAS_RSTART_REG(ch_idx)), | 2192 | usb_dmas_readl(udc, ENETDMAS_RSTART_REG, ch_idx), |
| 2187 | sram2 >> 16, sram2 & 0xffff, | 2193 | sram2 >> 16, sram2 & 0xffff, |
| 2188 | sram3 >> 16, sram3 & 0xffff, | 2194 | sram3 >> 16, sram3 & 0xffff, |
| 2189 | usb_dmas_readl(udc, ENETDMAS_SRAM4_REG(ch_idx))); | 2195 | usb_dmas_readl(udc, ENETDMAS_SRAM4_REG, ch_idx)); |
| 2190 | seq_printf(s, " desc: %d/%d used", iudma->n_bds_used, | 2196 | seq_printf(s, " desc: %d/%d used", iudma->n_bds_used, |
| 2191 | iudma->n_bds); | 2197 | iudma->n_bds); |
| 2192 | 2198 | ||
diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c index 306a2b52125c..2b4334394076 100644 --- a/drivers/usb/gadget/f_fs.c +++ b/drivers/usb/gadget/f_fs.c | |||
| @@ -585,7 +585,6 @@ static ssize_t ffs_epfile_io(struct file *file, | |||
| 585 | char __user *buf, size_t len, int read) | 585 | char __user *buf, size_t len, int read) |
| 586 | { | 586 | { |
| 587 | struct ffs_epfile *epfile = file->private_data; | 587 | struct ffs_epfile *epfile = file->private_data; |
| 588 | struct usb_gadget *gadget = epfile->ffs->gadget; | ||
| 589 | struct ffs_ep *ep; | 588 | struct ffs_ep *ep; |
| 590 | char *data = NULL; | 589 | char *data = NULL; |
| 591 | ssize_t ret, data_len; | 590 | ssize_t ret, data_len; |
| @@ -622,6 +621,12 @@ static ssize_t ffs_epfile_io(struct file *file, | |||
| 622 | /* Allocate & copy */ | 621 | /* Allocate & copy */ |
| 623 | if (!halt) { | 622 | if (!halt) { |
| 624 | /* | 623 | /* |
| 624 | * if we _do_ wait above, the epfile->ffs->gadget might be NULL | ||
| 625 | * before the waiting completes, so do not assign to 'gadget' earlier | ||
| 626 | */ | ||
| 627 | struct usb_gadget *gadget = epfile->ffs->gadget; | ||
| 628 | |||
| 629 | /* | ||
| 625 | * Controller may require buffer size to be aligned to | 630 | * Controller may require buffer size to be aligned to |
| 626 | * maxpacketsize of an out endpoint. | 631 | * maxpacketsize of an out endpoint. |
| 627 | */ | 632 | */ |
diff --git a/drivers/usb/gadget/printer.c b/drivers/usb/gadget/printer.c index bf7a56b6d48a..69b76efd11e9 100644 --- a/drivers/usb/gadget/printer.c +++ b/drivers/usb/gadget/printer.c | |||
| @@ -1157,7 +1157,7 @@ static int __init printer_bind_config(struct usb_configuration *c) | |||
| 1157 | 1157 | ||
| 1158 | usb_gadget_set_selfpowered(gadget); | 1158 | usb_gadget_set_selfpowered(gadget); |
| 1159 | 1159 | ||
| 1160 | if (gadget->is_otg) { | 1160 | if (gadget_is_otg(gadget)) { |
| 1161 | otg_descriptor.bmAttributes |= USB_OTG_HNP; | 1161 | otg_descriptor.bmAttributes |= USB_OTG_HNP; |
| 1162 | printer_cfg_driver.descriptors = otg_desc; | 1162 | printer_cfg_driver.descriptors = otg_desc; |
| 1163 | printer_cfg_driver.bmAttributes |= USB_CONFIG_ATT_WAKEUP; | 1163 | printer_cfg_driver.bmAttributes |= USB_CONFIG_ATT_WAKEUP; |
diff --git a/drivers/usb/gadget/s3c2410_udc.c b/drivers/usb/gadget/s3c2410_udc.c index f04b2c3154de..dd9678f85c58 100644 --- a/drivers/usb/gadget/s3c2410_udc.c +++ b/drivers/usb/gadget/s3c2410_udc.c | |||
| @@ -1629,7 +1629,7 @@ static void s3c2410_udc_reinit(struct s3c2410_udc *dev) | |||
| 1629 | ep->ep.desc = NULL; | 1629 | ep->ep.desc = NULL; |
| 1630 | ep->halted = 0; | 1630 | ep->halted = 0; |
| 1631 | INIT_LIST_HEAD(&ep->queue); | 1631 | INIT_LIST_HEAD(&ep->queue); |
| 1632 | usb_ep_set_maxpacket_limit(&ep->ep, &ep->ep.maxpacket); | 1632 | usb_ep_set_maxpacket_limit(&ep->ep, ep->ep.maxpacket); |
| 1633 | } | 1633 | } |
| 1634 | } | 1634 | } |
| 1635 | 1635 | ||
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c index 47b858fc50b2..7ae0c4d51741 100644 --- a/drivers/usb/host/ehci-hub.c +++ b/drivers/usb/host/ehci-hub.c | |||
| @@ -238,6 +238,7 @@ static int ehci_bus_suspend (struct usb_hcd *hcd) | |||
| 238 | int port; | 238 | int port; |
| 239 | int mask; | 239 | int mask; |
| 240 | int changed; | 240 | int changed; |
| 241 | bool fs_idle_delay; | ||
| 241 | 242 | ||
| 242 | ehci_dbg(ehci, "suspend root hub\n"); | 243 | ehci_dbg(ehci, "suspend root hub\n"); |
| 243 | 244 | ||
| @@ -272,6 +273,7 @@ static int ehci_bus_suspend (struct usb_hcd *hcd) | |||
| 272 | ehci->bus_suspended = 0; | 273 | ehci->bus_suspended = 0; |
| 273 | ehci->owned_ports = 0; | 274 | ehci->owned_ports = 0; |
| 274 | changed = 0; | 275 | changed = 0; |
| 276 | fs_idle_delay = false; | ||
| 275 | port = HCS_N_PORTS(ehci->hcs_params); | 277 | port = HCS_N_PORTS(ehci->hcs_params); |
| 276 | while (port--) { | 278 | while (port--) { |
| 277 | u32 __iomem *reg = &ehci->regs->port_status [port]; | 279 | u32 __iomem *reg = &ehci->regs->port_status [port]; |
| @@ -300,16 +302,32 @@ static int ehci_bus_suspend (struct usb_hcd *hcd) | |||
| 300 | } | 302 | } |
| 301 | 303 | ||
| 302 | if (t1 != t2) { | 304 | if (t1 != t2) { |
| 305 | /* | ||
| 306 | * On some controllers, Wake-On-Disconnect will | ||
| 307 | * generate false wakeup signals until the bus | ||
| 308 | * switches over to full-speed idle. For their | ||
| 309 | * sake, add a delay if we need one. | ||
| 310 | */ | ||
| 311 | if ((t2 & PORT_WKDISC_E) && | ||
| 312 | ehci_port_speed(ehci, t2) == | ||
| 313 | USB_PORT_STAT_HIGH_SPEED) | ||
| 314 | fs_idle_delay = true; | ||
| 303 | ehci_writel(ehci, t2, reg); | 315 | ehci_writel(ehci, t2, reg); |
| 304 | changed = 1; | 316 | changed = 1; |
| 305 | } | 317 | } |
| 306 | } | 318 | } |
| 319 | spin_unlock_irq(&ehci->lock); | ||
| 320 | |||
| 321 | if ((changed && ehci->has_tdi_phy_lpm) || fs_idle_delay) { | ||
| 322 | /* | ||
| 323 | * Wait for HCD to enter low-power mode or for the bus | ||
| 324 | * to switch to full-speed idle. | ||
| 325 | */ | ||
| 326 | usleep_range(5000, 5500); | ||
| 327 | } | ||
| 307 | 328 | ||
| 308 | if (changed && ehci->has_tdi_phy_lpm) { | 329 | if (changed && ehci->has_tdi_phy_lpm) { |
| 309 | spin_unlock_irq(&ehci->lock); | ||
| 310 | msleep(5); /* 5 ms for HCD to enter low-power mode */ | ||
| 311 | spin_lock_irq(&ehci->lock); | 330 | spin_lock_irq(&ehci->lock); |
| 312 | |||
| 313 | port = HCS_N_PORTS(ehci->hcs_params); | 331 | port = HCS_N_PORTS(ehci->hcs_params); |
| 314 | while (port--) { | 332 | while (port--) { |
| 315 | u32 __iomem *hostpc_reg = &ehci->regs->hostpc[port]; | 333 | u32 __iomem *hostpc_reg = &ehci->regs->hostpc[port]; |
| @@ -322,8 +340,8 @@ static int ehci_bus_suspend (struct usb_hcd *hcd) | |||
| 322 | port, (t3 & HOSTPC_PHCD) ? | 340 | port, (t3 & HOSTPC_PHCD) ? |
| 323 | "succeeded" : "failed"); | 341 | "succeeded" : "failed"); |
| 324 | } | 342 | } |
| 343 | spin_unlock_irq(&ehci->lock); | ||
| 325 | } | 344 | } |
| 326 | spin_unlock_irq(&ehci->lock); | ||
| 327 | 345 | ||
| 328 | /* Apparently some devices need a >= 1-uframe delay here */ | 346 | /* Apparently some devices need a >= 1-uframe delay here */ |
| 329 | if (ehci->bus_suspended) | 347 | if (ehci->bus_suspended) |
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index fc192ad9cc6a..239ad0b1ceb6 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c | |||
| @@ -477,8 +477,11 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb, | |||
| 477 | musb->port1_status |= | 477 | musb->port1_status |= |
| 478 | (USB_PORT_STAT_C_SUSPEND << 16) | 478 | (USB_PORT_STAT_C_SUSPEND << 16) |
| 479 | | MUSB_PORT_STAT_RESUME; | 479 | | MUSB_PORT_STAT_RESUME; |
| 480 | musb->rh_timer = jiffies | ||
| 481 | + msecs_to_jiffies(20); | ||
| 480 | schedule_delayed_work( | 482 | schedule_delayed_work( |
| 481 | &musb->finish_resume_work, 20); | 483 | &musb->finish_resume_work, |
| 484 | msecs_to_jiffies(20)); | ||
| 482 | 485 | ||
| 483 | musb->xceiv->state = OTG_STATE_A_HOST; | 486 | musb->xceiv->state = OTG_STATE_A_HOST; |
| 484 | musb->is_active = 1; | 487 | musb->is_active = 1; |
| @@ -2157,11 +2160,19 @@ static void musb_restore_context(struct musb *musb) | |||
| 2157 | void __iomem *musb_base = musb->mregs; | 2160 | void __iomem *musb_base = musb->mregs; |
| 2158 | void __iomem *ep_target_regs; | 2161 | void __iomem *ep_target_regs; |
| 2159 | void __iomem *epio; | 2162 | void __iomem *epio; |
| 2163 | u8 power; | ||
| 2160 | 2164 | ||
| 2161 | musb_writew(musb_base, MUSB_FRAME, musb->context.frame); | 2165 | musb_writew(musb_base, MUSB_FRAME, musb->context.frame); |
| 2162 | musb_writeb(musb_base, MUSB_TESTMODE, musb->context.testmode); | 2166 | musb_writeb(musb_base, MUSB_TESTMODE, musb->context.testmode); |
| 2163 | musb_write_ulpi_buscontrol(musb->mregs, musb->context.busctl); | 2167 | musb_write_ulpi_buscontrol(musb->mregs, musb->context.busctl); |
| 2164 | musb_writeb(musb_base, MUSB_POWER, musb->context.power); | 2168 | |
| 2169 | /* Don't affect SUSPENDM/RESUME bits in POWER reg */ | ||
| 2170 | power = musb_readb(musb_base, MUSB_POWER); | ||
| 2171 | power &= MUSB_POWER_SUSPENDM | MUSB_POWER_RESUME; | ||
| 2172 | musb->context.power &= ~(MUSB_POWER_SUSPENDM | MUSB_POWER_RESUME); | ||
| 2173 | power |= musb->context.power; | ||
| 2174 | musb_writeb(musb_base, MUSB_POWER, power); | ||
| 2175 | |||
| 2165 | musb_writew(musb_base, MUSB_INTRTXE, musb->intrtxe); | 2176 | musb_writew(musb_base, MUSB_INTRTXE, musb->intrtxe); |
| 2166 | musb_writew(musb_base, MUSB_INTRRXE, musb->intrrxe); | 2177 | musb_writew(musb_base, MUSB_INTRRXE, musb->intrrxe); |
| 2167 | musb_writeb(musb_base, MUSB_INTRUSBE, musb->context.intrusbe); | 2178 | musb_writeb(musb_base, MUSB_INTRUSBE, musb->context.intrusbe); |
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c index ed455724017b..abb38c3833ef 100644 --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c | |||
| @@ -1183,6 +1183,9 @@ irqreturn_t musb_h_ep0_irq(struct musb *musb) | |||
| 1183 | csr = MUSB_CSR0_H_STATUSPKT | 1183 | csr = MUSB_CSR0_H_STATUSPKT |
| 1184 | | MUSB_CSR0_TXPKTRDY; | 1184 | | MUSB_CSR0_TXPKTRDY; |
| 1185 | 1185 | ||
| 1186 | /* disable ping token in status phase */ | ||
| 1187 | csr |= MUSB_CSR0_H_DIS_PING; | ||
| 1188 | |||
| 1186 | /* flag status stage */ | 1189 | /* flag status stage */ |
| 1187 | musb->ep0_stage = MUSB_EP0_STATUS; | 1190 | musb->ep0_stage = MUSB_EP0_STATUS; |
| 1188 | 1191 | ||
diff --git a/drivers/usb/musb/musb_virthub.c b/drivers/usb/musb/musb_virthub.c index eb634433ef09..e2d2d8c9891b 100644 --- a/drivers/usb/musb/musb_virthub.c +++ b/drivers/usb/musb/musb_virthub.c | |||
| @@ -135,7 +135,8 @@ void musb_port_suspend(struct musb *musb, bool do_suspend) | |||
| 135 | 135 | ||
| 136 | /* later, GetPortStatus will stop RESUME signaling */ | 136 | /* later, GetPortStatus will stop RESUME signaling */ |
| 137 | musb->port1_status |= MUSB_PORT_STAT_RESUME; | 137 | musb->port1_status |= MUSB_PORT_STAT_RESUME; |
| 138 | schedule_delayed_work(&musb->finish_resume_work, 20); | 138 | schedule_delayed_work(&musb->finish_resume_work, |
| 139 | msecs_to_jiffies(20)); | ||
| 139 | } | 140 | } |
| 140 | } | 141 | } |
| 141 | 142 | ||
| @@ -158,7 +159,6 @@ void musb_port_reset(struct musb *musb, bool do_reset) | |||
| 158 | */ | 159 | */ |
| 159 | power = musb_readb(mbase, MUSB_POWER); | 160 | power = musb_readb(mbase, MUSB_POWER); |
| 160 | if (do_reset) { | 161 | if (do_reset) { |
| 161 | |||
| 162 | /* | 162 | /* |
| 163 | * If RESUME is set, we must make sure it stays minimum 20 ms. | 163 | * If RESUME is set, we must make sure it stays minimum 20 ms. |
| 164 | * Then we must clear RESUME and wait a bit to let musb start | 164 | * Then we must clear RESUME and wait a bit to let musb start |
| @@ -167,11 +167,22 @@ void musb_port_reset(struct musb *musb, bool do_reset) | |||
| 167 | * detected". | 167 | * detected". |
| 168 | */ | 168 | */ |
| 169 | if (power & MUSB_POWER_RESUME) { | 169 | if (power & MUSB_POWER_RESUME) { |
| 170 | while (time_before(jiffies, musb->rh_timer)) | 170 | long remain = (unsigned long) musb->rh_timer - jiffies; |
| 171 | msleep(1); | 171 | |
| 172 | if (musb->rh_timer > 0 && remain > 0) { | ||
| 173 | /* take into account the minimum delay after resume */ | ||
| 174 | schedule_delayed_work( | ||
| 175 | &musb->deassert_reset_work, remain); | ||
| 176 | return; | ||
| 177 | } | ||
| 178 | |||
| 172 | musb_writeb(mbase, MUSB_POWER, | 179 | musb_writeb(mbase, MUSB_POWER, |
| 173 | power & ~MUSB_POWER_RESUME); | 180 | power & ~MUSB_POWER_RESUME); |
| 174 | msleep(1); | 181 | |
| 182 | /* Give the core 1 ms to clear MUSB_POWER_RESUME */ | ||
| 183 | schedule_delayed_work(&musb->deassert_reset_work, | ||
| 184 | msecs_to_jiffies(1)); | ||
| 185 | return; | ||
| 175 | } | 186 | } |
| 176 | 187 | ||
| 177 | power &= 0xf0; | 188 | power &= 0xf0; |
| @@ -180,7 +191,8 @@ void musb_port_reset(struct musb *musb, bool do_reset) | |||
| 180 | 191 | ||
| 181 | musb->port1_status |= USB_PORT_STAT_RESET; | 192 | musb->port1_status |= USB_PORT_STAT_RESET; |
| 182 | musb->port1_status &= ~USB_PORT_STAT_ENABLE; | 193 | musb->port1_status &= ~USB_PORT_STAT_ENABLE; |
| 183 | schedule_delayed_work(&musb->deassert_reset_work, 50); | 194 | schedule_delayed_work(&musb->deassert_reset_work, |
| 195 | msecs_to_jiffies(50)); | ||
| 184 | } else { | 196 | } else { |
| 185 | dev_dbg(musb->controller, "root port reset stopped\n"); | 197 | dev_dbg(musb->controller, "root port reset stopped\n"); |
| 186 | musb_writeb(mbase, MUSB_POWER, | 198 | musb_writeb(mbase, MUSB_POWER, |
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index 2a408cdaf7b2..8aa59a2c5eb2 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c | |||
| @@ -659,7 +659,6 @@ static int omap2430_runtime_suspend(struct device *dev) | |||
| 659 | OTG_INTERFSEL); | 659 | OTG_INTERFSEL); |
| 660 | 660 | ||
| 661 | omap2430_low_level_exit(musb); | 661 | omap2430_low_level_exit(musb); |
| 662 | phy_power_off(musb->phy); | ||
| 663 | } | 662 | } |
| 664 | 663 | ||
| 665 | return 0; | 664 | return 0; |
| @@ -674,7 +673,6 @@ static int omap2430_runtime_resume(struct device *dev) | |||
| 674 | omap2430_low_level_init(musb); | 673 | omap2430_low_level_init(musb); |
| 675 | musb_writel(musb->mregs, OTG_INTERFSEL, | 674 | musb_writel(musb->mregs, OTG_INTERFSEL, |
| 676 | musb->context.otg_interfsel); | 675 | musb->context.otg_interfsel); |
| 677 | phy_power_on(musb->phy); | ||
| 678 | } | 676 | } |
| 679 | 677 | ||
| 680 | return 0; | 678 | return 0; |
diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c index 8546c8dccd51..d204f745ed05 100644 --- a/drivers/usb/phy/phy-msm-usb.c +++ b/drivers/usb/phy/phy-msm-usb.c | |||
| @@ -159,32 +159,6 @@ put_3p3: | |||
| 159 | return rc; | 159 | return rc; |
| 160 | } | 160 | } |
| 161 | 161 | ||
| 162 | #ifdef CONFIG_PM_SLEEP | ||
| 163 | #define USB_PHY_SUSP_DIG_VOL 500000 | ||
| 164 | static int msm_hsusb_config_vddcx(int high) | ||
| 165 | { | ||
| 166 | int max_vol = USB_PHY_VDD_DIG_VOL_MAX; | ||
| 167 | int min_vol; | ||
| 168 | int ret; | ||
| 169 | |||
| 170 | if (high) | ||
| 171 | min_vol = USB_PHY_VDD_DIG_VOL_MIN; | ||
| 172 | else | ||
| 173 | min_vol = USB_PHY_SUSP_DIG_VOL; | ||
| 174 | |||
| 175 | ret = regulator_set_voltage(hsusb_vddcx, min_vol, max_vol); | ||
| 176 | if (ret) { | ||
| 177 | pr_err("%s: unable to set the voltage for regulator " | ||
| 178 | "HSUSB_VDDCX\n", __func__); | ||
| 179 | return ret; | ||
| 180 | } | ||
| 181 | |||
| 182 | pr_debug("%s: min_vol:%d max_vol:%d\n", __func__, min_vol, max_vol); | ||
| 183 | |||
| 184 | return ret; | ||
| 185 | } | ||
| 186 | #endif | ||
| 187 | |||
| 188 | static int msm_hsusb_ldo_set_mode(int on) | 162 | static int msm_hsusb_ldo_set_mode(int on) |
| 189 | { | 163 | { |
| 190 | int ret = 0; | 164 | int ret = 0; |
| @@ -440,7 +414,32 @@ static int msm_otg_reset(struct usb_phy *phy) | |||
| 440 | #define PHY_SUSPEND_TIMEOUT_USEC (500 * 1000) | 414 | #define PHY_SUSPEND_TIMEOUT_USEC (500 * 1000) |
| 441 | #define PHY_RESUME_TIMEOUT_USEC (100 * 1000) | 415 | #define PHY_RESUME_TIMEOUT_USEC (100 * 1000) |
| 442 | 416 | ||
| 443 | #ifdef CONFIG_PM_SLEEP | 417 | #ifdef CONFIG_PM |
| 418 | |||
| 419 | #define USB_PHY_SUSP_DIG_VOL 500000 | ||
| 420 | static int msm_hsusb_config_vddcx(int high) | ||
| 421 | { | ||
| 422 | int max_vol = USB_PHY_VDD_DIG_VOL_MAX; | ||
| 423 | int min_vol; | ||
| 424 | int ret; | ||
| 425 | |||
| 426 | if (high) | ||
| 427 | min_vol = USB_PHY_VDD_DIG_VOL_MIN; | ||
| 428 | else | ||
| 429 | min_vol = USB_PHY_SUSP_DIG_VOL; | ||
| 430 | |||
| 431 | ret = regulator_set_voltage(hsusb_vddcx, min_vol, max_vol); | ||
| 432 | if (ret) { | ||
| 433 | pr_err("%s: unable to set the voltage for regulator " | ||
| 434 | "HSUSB_VDDCX\n", __func__); | ||
| 435 | return ret; | ||
| 436 | } | ||
| 437 | |||
| 438 | pr_debug("%s: min_vol:%d max_vol:%d\n", __func__, min_vol, max_vol); | ||
| 439 | |||
| 440 | return ret; | ||
| 441 | } | ||
| 442 | |||
| 444 | static int msm_otg_suspend(struct msm_otg *motg) | 443 | static int msm_otg_suspend(struct msm_otg *motg) |
| 445 | { | 444 | { |
| 446 | struct usb_phy *phy = &motg->phy; | 445 | struct usb_phy *phy = &motg->phy; |
| @@ -1733,22 +1732,18 @@ static int msm_otg_pm_resume(struct device *dev) | |||
| 1733 | } | 1732 | } |
| 1734 | #endif | 1733 | #endif |
| 1735 | 1734 | ||
| 1736 | #ifdef CONFIG_PM | ||
| 1737 | static const struct dev_pm_ops msm_otg_dev_pm_ops = { | 1735 | static const struct dev_pm_ops msm_otg_dev_pm_ops = { |
| 1738 | SET_SYSTEM_SLEEP_PM_OPS(msm_otg_pm_suspend, msm_otg_pm_resume) | 1736 | SET_SYSTEM_SLEEP_PM_OPS(msm_otg_pm_suspend, msm_otg_pm_resume) |
| 1739 | SET_RUNTIME_PM_OPS(msm_otg_runtime_suspend, msm_otg_runtime_resume, | 1737 | SET_RUNTIME_PM_OPS(msm_otg_runtime_suspend, msm_otg_runtime_resume, |
| 1740 | msm_otg_runtime_idle) | 1738 | msm_otg_runtime_idle) |
| 1741 | }; | 1739 | }; |
| 1742 | #endif | ||
| 1743 | 1740 | ||
| 1744 | static struct platform_driver msm_otg_driver = { | 1741 | static struct platform_driver msm_otg_driver = { |
| 1745 | .remove = msm_otg_remove, | 1742 | .remove = msm_otg_remove, |
| 1746 | .driver = { | 1743 | .driver = { |
| 1747 | .name = DRIVER_NAME, | 1744 | .name = DRIVER_NAME, |
| 1748 | .owner = THIS_MODULE, | 1745 | .owner = THIS_MODULE, |
| 1749 | #ifdef CONFIG_PM | ||
| 1750 | .pm = &msm_otg_dev_pm_ops, | 1746 | .pm = &msm_otg_dev_pm_ops, |
| 1751 | #endif | ||
| 1752 | }, | 1747 | }, |
| 1753 | }; | 1748 | }; |
| 1754 | 1749 | ||
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 216d20affba8..68fc9fe65936 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
| @@ -1526,7 +1526,8 @@ static const struct usb_device_id option_ids[] = { | |||
| 1526 | /* Cinterion */ | 1526 | /* Cinterion */ |
| 1527 | { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_EU3_E) }, | 1527 | { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_EU3_E) }, |
| 1528 | { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_EU3_P) }, | 1528 | { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_EU3_P) }, |
| 1529 | { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_PH8) }, | 1529 | { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_PH8), |
| 1530 | .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, | ||
| 1530 | { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_AHXX) }, | 1531 | { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_AHXX) }, |
| 1531 | { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_PLXX), | 1532 | { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_PLXX), |
| 1532 | .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, | 1533 | .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, |
