aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-04 16:07:23 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-04 16:07:23 -0500
commit207b08b9426dfaa63fcfea4156be0acb5b46ee38 (patch)
tree682172e9380970f183f880b13607a76b876c5c4d
parent5c82171167adb8e4ac77b91a42cd49fb211a81a0 (diff)
parent6a4290cc28be12d72d50644bd4bda1aede37cd41 (diff)
Merge tag 'fixes-for-v4.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-linus
Felipe writes: usb: fixes for v4.5-rc2 DWC3 got a fix for OTG Certification, DWC2 has two fixes for regressions on RasPI, MUSB has a NULL pointer dereference fix for ux500 platforms and two PHYs (MSM and MXS) got some minor fixes. While at that, I'm also adding a fix to my email address which has changed recently.
-rw-r--r--MAINTAINERS10
-rw-r--r--drivers/usb/dwc2/core.c14
-rw-r--r--drivers/usb/dwc2/platform.c8
-rw-r--r--drivers/usb/dwc3/gadget.c1
-rw-r--r--drivers/usb/musb/ux500.c7
-rw-r--r--drivers/usb/phy/phy-msm-usb.c37
-rw-r--r--drivers/usb/phy/phy-mxs-usb.c2
7 files changed, 43 insertions, 36 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index 30aca4aa5467..e8bde896230e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3445,7 +3445,7 @@ S: Maintained
3445F: drivers/usb/dwc2/ 3445F: drivers/usb/dwc2/
3446 3446
3447DESIGNWARE USB3 DRD IP DRIVER 3447DESIGNWARE USB3 DRD IP DRIVER
3448M: Felipe Balbi <balbi@ti.com> 3448M: Felipe Balbi <balbi@kernel.org>
3449L: linux-usb@vger.kernel.org 3449L: linux-usb@vger.kernel.org
3450L: linux-omap@vger.kernel.org 3450L: linux-omap@vger.kernel.org
3451T: git git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git 3451T: git git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git
@@ -7370,7 +7370,7 @@ F: drivers/tty/isicom.c
7370F: include/linux/isicom.h 7370F: include/linux/isicom.h
7371 7371
7372MUSB MULTIPOINT HIGH SPEED DUAL-ROLE CONTROLLER 7372MUSB MULTIPOINT HIGH SPEED DUAL-ROLE CONTROLLER
7373M: Felipe Balbi <balbi@ti.com> 7373M: Felipe Balbi <balbi@kernel.org>
7374L: linux-usb@vger.kernel.org 7374L: linux-usb@vger.kernel.org
7375T: git git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git 7375T: git git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git
7376S: Maintained 7376S: Maintained
@@ -7939,7 +7939,7 @@ F: drivers/media/platform/omap3isp/
7939F: drivers/staging/media/omap4iss/ 7939F: drivers/staging/media/omap4iss/
7940 7940
7941OMAP USB SUPPORT 7941OMAP USB SUPPORT
7942M: Felipe Balbi <balbi@ti.com> 7942M: Felipe Balbi <balbi@kernel.org>
7943L: linux-usb@vger.kernel.org 7943L: linux-usb@vger.kernel.org
7944L: linux-omap@vger.kernel.org 7944L: linux-omap@vger.kernel.org
7945T: git git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git 7945T: git git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git
@@ -11318,7 +11318,7 @@ F: Documentation/usb/ehci.txt
11318F: drivers/usb/host/ehci* 11318F: drivers/usb/host/ehci*
11319 11319
11320USB GADGET/PERIPHERAL SUBSYSTEM 11320USB GADGET/PERIPHERAL SUBSYSTEM
11321M: Felipe Balbi <balbi@ti.com> 11321M: Felipe Balbi <balbi@kernel.org>
11322L: linux-usb@vger.kernel.org 11322L: linux-usb@vger.kernel.org
11323W: http://www.linux-usb.org/gadget 11323W: http://www.linux-usb.org/gadget
11324T: git git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git 11324T: git git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git
@@ -11394,7 +11394,7 @@ S: Maintained
11394F: drivers/net/usb/pegasus.* 11394F: drivers/net/usb/pegasus.*
11395 11395
11396USB PHY LAYER 11396USB PHY LAYER
11397M: Felipe Balbi <balbi@ti.com> 11397M: Felipe Balbi <balbi@kernel.org>
11398L: linux-usb@vger.kernel.org 11398L: linux-usb@vger.kernel.org
11399T: git git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git 11399T: git git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git
11400S: Maintained 11400S: Maintained
diff --git a/drivers/usb/dwc2/core.c b/drivers/usb/dwc2/core.c
index 39a0fa8a4c0a..e991d55914db 100644
--- a/drivers/usb/dwc2/core.c
+++ b/drivers/usb/dwc2/core.c
@@ -572,12 +572,6 @@ static bool dwc2_force_mode(struct dwc2_hsotg *hsotg, bool host)
572 set = host ? GUSBCFG_FORCEHOSTMODE : GUSBCFG_FORCEDEVMODE; 572 set = host ? GUSBCFG_FORCEHOSTMODE : GUSBCFG_FORCEDEVMODE;
573 clear = host ? GUSBCFG_FORCEDEVMODE : GUSBCFG_FORCEHOSTMODE; 573 clear = host ? GUSBCFG_FORCEDEVMODE : GUSBCFG_FORCEHOSTMODE;
574 574
575 /*
576 * If the force mode bit is already set, don't set it.
577 */
578 if ((gusbcfg & set) && !(gusbcfg & clear))
579 return false;
580
581 gusbcfg &= ~clear; 575 gusbcfg &= ~clear;
582 gusbcfg |= set; 576 gusbcfg |= set;
583 dwc2_writel(gusbcfg, hsotg->regs + GUSBCFG); 577 dwc2_writel(gusbcfg, hsotg->regs + GUSBCFG);
@@ -3278,9 +3272,6 @@ static void dwc2_get_dev_hwparams(struct dwc2_hsotg *hsotg)
3278/** 3272/**
3279 * During device initialization, read various hardware configuration 3273 * During device initialization, read various hardware configuration
3280 * registers and interpret the contents. 3274 * registers and interpret the contents.
3281 *
3282 * This should be called during driver probe. It will perform a core
3283 * soft reset in order to get the reset values of the parameters.
3284 */ 3275 */
3285int dwc2_get_hwparams(struct dwc2_hsotg *hsotg) 3276int dwc2_get_hwparams(struct dwc2_hsotg *hsotg)
3286{ 3277{
@@ -3288,7 +3279,6 @@ int dwc2_get_hwparams(struct dwc2_hsotg *hsotg)
3288 unsigned width; 3279 unsigned width;
3289 u32 hwcfg1, hwcfg2, hwcfg3, hwcfg4; 3280 u32 hwcfg1, hwcfg2, hwcfg3, hwcfg4;
3290 u32 grxfsiz; 3281 u32 grxfsiz;
3291 int retval;
3292 3282
3293 /* 3283 /*
3294 * Attempt to ensure this device is really a DWC_otg Controller. 3284 * Attempt to ensure this device is really a DWC_otg Controller.
@@ -3308,10 +3298,6 @@ int dwc2_get_hwparams(struct dwc2_hsotg *hsotg)
3308 hw->snpsid >> 12 & 0xf, hw->snpsid >> 8 & 0xf, 3298 hw->snpsid >> 12 & 0xf, hw->snpsid >> 8 & 0xf,
3309 hw->snpsid >> 4 & 0xf, hw->snpsid & 0xf, hw->snpsid); 3299 hw->snpsid >> 4 & 0xf, hw->snpsid & 0xf, hw->snpsid);
3310 3300
3311 retval = dwc2_core_reset(hsotg);
3312 if (retval)
3313 return retval;
3314
3315 hwcfg1 = dwc2_readl(hsotg->regs + GHWCFG1); 3301 hwcfg1 = dwc2_readl(hsotg->regs + GHWCFG1);
3316 hwcfg2 = dwc2_readl(hsotg->regs + GHWCFG2); 3302 hwcfg2 = dwc2_readl(hsotg->regs + GHWCFG2);
3317 hwcfg3 = dwc2_readl(hsotg->regs + GHWCFG3); 3303 hwcfg3 = dwc2_readl(hsotg->regs + GHWCFG3);
diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
index 510f787434b3..690b9fd98b55 100644
--- a/drivers/usb/dwc2/platform.c
+++ b/drivers/usb/dwc2/platform.c
@@ -530,7 +530,13 @@ static int dwc2_driver_probe(struct platform_device *dev)
530 if (retval) 530 if (retval)
531 return retval; 531 return retval;
532 532
533 /* Reset the controller and detect hardware config values */ 533 /*
534 * Reset before dwc2_get_hwparams() then it could get power-on real
535 * reset value form registers.
536 */
537 dwc2_core_reset_and_force_dr_mode(hsotg);
538
539 /* Detect config values from hardware */
534 retval = dwc2_get_hwparams(hsotg); 540 retval = dwc2_get_hwparams(hsotg);
535 if (retval) 541 if (retval)
536 goto error; 542 goto error;
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index af023a81a0b0..7d1dd82a95ac 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -2789,6 +2789,7 @@ int dwc3_gadget_init(struct dwc3 *dwc)
2789 dwc->gadget.speed = USB_SPEED_UNKNOWN; 2789 dwc->gadget.speed = USB_SPEED_UNKNOWN;
2790 dwc->gadget.sg_supported = true; 2790 dwc->gadget.sg_supported = true;
2791 dwc->gadget.name = "dwc3-gadget"; 2791 dwc->gadget.name = "dwc3-gadget";
2792 dwc->gadget.is_otg = dwc->dr_mode == USB_DR_MODE_OTG;
2792 2793
2793 /* 2794 /*
2794 * FIXME We might be setting max_speed to <SUPER, however versions 2795 * FIXME We might be setting max_speed to <SUPER, however versions
diff --git a/drivers/usb/musb/ux500.c b/drivers/usb/musb/ux500.c
index b2685e75a683..3eaa4ba6867d 100644
--- a/drivers/usb/musb/ux500.c
+++ b/drivers/usb/musb/ux500.c
@@ -348,7 +348,9 @@ static int ux500_suspend(struct device *dev)
348 struct ux500_glue *glue = dev_get_drvdata(dev); 348 struct ux500_glue *glue = dev_get_drvdata(dev);
349 struct musb *musb = glue_to_musb(glue); 349 struct musb *musb = glue_to_musb(glue);
350 350
351 usb_phy_set_suspend(musb->xceiv, 1); 351 if (musb)
352 usb_phy_set_suspend(musb->xceiv, 1);
353
352 clk_disable_unprepare(glue->clk); 354 clk_disable_unprepare(glue->clk);
353 355
354 return 0; 356 return 0;
@@ -366,7 +368,8 @@ static int ux500_resume(struct device *dev)
366 return ret; 368 return ret;
367 } 369 }
368 370
369 usb_phy_set_suspend(musb->xceiv, 0); 371 if (musb)
372 usb_phy_set_suspend(musb->xceiv, 0);
370 373
371 return 0; 374 return 0;
372} 375}
diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
index 0d19a6d61a71..970a30e155cb 100644
--- a/drivers/usb/phy/phy-msm-usb.c
+++ b/drivers/usb/phy/phy-msm-usb.c
@@ -1599,6 +1599,8 @@ static int msm_otg_read_dt(struct platform_device *pdev, struct msm_otg *motg)
1599 &motg->id.nb); 1599 &motg->id.nb);
1600 if (ret < 0) { 1600 if (ret < 0) {
1601 dev_err(&pdev->dev, "register ID notifier failed\n"); 1601 dev_err(&pdev->dev, "register ID notifier failed\n");
1602 extcon_unregister_notifier(motg->vbus.extcon,
1603 EXTCON_USB, &motg->vbus.nb);
1602 return ret; 1604 return ret;
1603 } 1605 }
1604 1606
@@ -1660,15 +1662,6 @@ static int msm_otg_probe(struct platform_device *pdev)
1660 if (!motg) 1662 if (!motg)
1661 return -ENOMEM; 1663 return -ENOMEM;
1662 1664
1663 pdata = dev_get_platdata(&pdev->dev);
1664 if (!pdata) {
1665 if (!np)
1666 return -ENXIO;
1667 ret = msm_otg_read_dt(pdev, motg);
1668 if (ret)
1669 return ret;
1670 }
1671
1672 motg->phy.otg = devm_kzalloc(&pdev->dev, sizeof(struct usb_otg), 1665 motg->phy.otg = devm_kzalloc(&pdev->dev, sizeof(struct usb_otg),
1673 GFP_KERNEL); 1666 GFP_KERNEL);
1674 if (!motg->phy.otg) 1667 if (!motg->phy.otg)
@@ -1710,6 +1703,15 @@ static int msm_otg_probe(struct platform_device *pdev)
1710 if (!motg->regs) 1703 if (!motg->regs)
1711 return -ENOMEM; 1704 return -ENOMEM;
1712 1705
1706 pdata = dev_get_platdata(&pdev->dev);
1707 if (!pdata) {
1708 if (!np)
1709 return -ENXIO;
1710 ret = msm_otg_read_dt(pdev, motg);
1711 if (ret)
1712 return ret;
1713 }
1714
1713 /* 1715 /*
1714 * NOTE: The PHYs can be multiplexed between the chipidea controller 1716 * NOTE: The PHYs can be multiplexed between the chipidea controller
1715 * and the dwc3 controller, using a single bit. It is important that 1717 * and the dwc3 controller, using a single bit. It is important that
@@ -1717,8 +1719,10 @@ static int msm_otg_probe(struct platform_device *pdev)
1717 */ 1719 */
1718 if (motg->phy_number) { 1720 if (motg->phy_number) {
1719 phy_select = devm_ioremap_nocache(&pdev->dev, USB2_PHY_SEL, 4); 1721 phy_select = devm_ioremap_nocache(&pdev->dev, USB2_PHY_SEL, 4);
1720 if (!phy_select) 1722 if (!phy_select) {
1721 return -ENOMEM; 1723 ret = -ENOMEM;
1724 goto unregister_extcon;
1725 }
1722 /* Enable second PHY with the OTG port */ 1726 /* Enable second PHY with the OTG port */
1723 writel(0x1, phy_select); 1727 writel(0x1, phy_select);
1724 } 1728 }
@@ -1728,7 +1732,8 @@ static int msm_otg_probe(struct platform_device *pdev)
1728 motg->irq = platform_get_irq(pdev, 0); 1732 motg->irq = platform_get_irq(pdev, 0);
1729 if (motg->irq < 0) { 1733 if (motg->irq < 0) {
1730 dev_err(&pdev->dev, "platform_get_irq failed\n"); 1734 dev_err(&pdev->dev, "platform_get_irq failed\n");
1731 return motg->irq; 1735 ret = motg->irq;
1736 goto unregister_extcon;
1732 } 1737 }
1733 1738
1734 regs[0].supply = "vddcx"; 1739 regs[0].supply = "vddcx";
@@ -1737,7 +1742,7 @@ static int msm_otg_probe(struct platform_device *pdev)
1737 1742
1738 ret = devm_regulator_bulk_get(motg->phy.dev, ARRAY_SIZE(regs), regs); 1743 ret = devm_regulator_bulk_get(motg->phy.dev, ARRAY_SIZE(regs), regs);
1739 if (ret) 1744 if (ret)
1740 return ret; 1745 goto unregister_extcon;
1741 1746
1742 motg->vddcx = regs[0].consumer; 1747 motg->vddcx = regs[0].consumer;
1743 motg->v3p3 = regs[1].consumer; 1748 motg->v3p3 = regs[1].consumer;
@@ -1834,6 +1839,12 @@ disable_clks:
1834 clk_disable_unprepare(motg->clk); 1839 clk_disable_unprepare(motg->clk);
1835 if (!IS_ERR(motg->core_clk)) 1840 if (!IS_ERR(motg->core_clk))
1836 clk_disable_unprepare(motg->core_clk); 1841 clk_disable_unprepare(motg->core_clk);
1842unregister_extcon:
1843 extcon_unregister_notifier(motg->id.extcon,
1844 EXTCON_USB_HOST, &motg->id.nb);
1845 extcon_unregister_notifier(motg->vbus.extcon,
1846 EXTCON_USB, &motg->vbus.nb);
1847
1837 return ret; 1848 return ret;
1838} 1849}
1839 1850
diff --git a/drivers/usb/phy/phy-mxs-usb.c b/drivers/usb/phy/phy-mxs-usb.c
index c2936dc48ca7..00bfea01be65 100644
--- a/drivers/usb/phy/phy-mxs-usb.c
+++ b/drivers/usb/phy/phy-mxs-usb.c
@@ -220,7 +220,7 @@ static int mxs_phy_hw_init(struct mxs_phy *mxs_phy)
220/* Return true if the vbus is there */ 220/* Return true if the vbus is there */
221static bool mxs_phy_get_vbus_status(struct mxs_phy *mxs_phy) 221static bool mxs_phy_get_vbus_status(struct mxs_phy *mxs_phy)
222{ 222{
223 unsigned int vbus_value; 223 unsigned int vbus_value = 0;
224 224
225 if (!mxs_phy->regmap_anatop) 225 if (!mxs_phy->regmap_anatop)
226 return false; 226 return false;