Commit 207b08b9 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Merge tag 'fixes-for-v4.5-rc3' of...

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.
parents 5c821711 6a4290cc
...@@ -3445,7 +3445,7 @@ S: Maintained ...@@ -3445,7 +3445,7 @@ S: Maintained
F: drivers/usb/dwc2/ F: drivers/usb/dwc2/
DESIGNWARE USB3 DRD IP DRIVER DESIGNWARE USB3 DRD IP DRIVER
M: Felipe Balbi <balbi@ti.com> M: Felipe Balbi <balbi@kernel.org>
L: linux-usb@vger.kernel.org L: linux-usb@vger.kernel.org
L: linux-omap@vger.kernel.org L: linux-omap@vger.kernel.org
T: git git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git T: git git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git
...@@ -7370,7 +7370,7 @@ F: drivers/tty/isicom.c ...@@ -7370,7 +7370,7 @@ F: drivers/tty/isicom.c
F: include/linux/isicom.h F: include/linux/isicom.h
MUSB MULTIPOINT HIGH SPEED DUAL-ROLE CONTROLLER MUSB MULTIPOINT HIGH SPEED DUAL-ROLE CONTROLLER
M: Felipe Balbi <balbi@ti.com> M: Felipe Balbi <balbi@kernel.org>
L: linux-usb@vger.kernel.org L: linux-usb@vger.kernel.org
T: git git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git T: git git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git
S: Maintained S: Maintained
...@@ -7939,7 +7939,7 @@ F: drivers/media/platform/omap3isp/ ...@@ -7939,7 +7939,7 @@ F: drivers/media/platform/omap3isp/
F: drivers/staging/media/omap4iss/ F: drivers/staging/media/omap4iss/
OMAP USB SUPPORT OMAP USB SUPPORT
M: Felipe Balbi <balbi@ti.com> M: Felipe Balbi <balbi@kernel.org>
L: linux-usb@vger.kernel.org L: linux-usb@vger.kernel.org
L: linux-omap@vger.kernel.org L: linux-omap@vger.kernel.org
T: git git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git T: git git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git
...@@ -11318,7 +11318,7 @@ F: Documentation/usb/ehci.txt ...@@ -11318,7 +11318,7 @@ F: Documentation/usb/ehci.txt
F: drivers/usb/host/ehci* F: drivers/usb/host/ehci*
USB GADGET/PERIPHERAL SUBSYSTEM USB GADGET/PERIPHERAL SUBSYSTEM
M: Felipe Balbi <balbi@ti.com> M: Felipe Balbi <balbi@kernel.org>
L: linux-usb@vger.kernel.org L: linux-usb@vger.kernel.org
W: http://www.linux-usb.org/gadget W: http://www.linux-usb.org/gadget
T: git git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git T: git git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git
...@@ -11394,7 +11394,7 @@ S: Maintained ...@@ -11394,7 +11394,7 @@ S: Maintained
F: drivers/net/usb/pegasus.* F: drivers/net/usb/pegasus.*
USB PHY LAYER USB PHY LAYER
M: Felipe Balbi <balbi@ti.com> M: Felipe Balbi <balbi@kernel.org>
L: linux-usb@vger.kernel.org L: linux-usb@vger.kernel.org
T: git git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git T: git git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git
S: Maintained S: Maintained
......
...@@ -572,12 +572,6 @@ static bool dwc2_force_mode(struct dwc2_hsotg *hsotg, bool host) ...@@ -572,12 +572,6 @@ static bool dwc2_force_mode(struct dwc2_hsotg *hsotg, bool host)
set = host ? GUSBCFG_FORCEHOSTMODE : GUSBCFG_FORCEDEVMODE; set = host ? GUSBCFG_FORCEHOSTMODE : GUSBCFG_FORCEDEVMODE;
clear = host ? GUSBCFG_FORCEDEVMODE : GUSBCFG_FORCEHOSTMODE; clear = host ? GUSBCFG_FORCEDEVMODE : GUSBCFG_FORCEHOSTMODE;
/*
* If the force mode bit is already set, don't set it.
*/
if ((gusbcfg & set) && !(gusbcfg & clear))
return false;
gusbcfg &= ~clear; gusbcfg &= ~clear;
gusbcfg |= set; gusbcfg |= set;
dwc2_writel(gusbcfg, hsotg->regs + GUSBCFG); dwc2_writel(gusbcfg, hsotg->regs + GUSBCFG);
...@@ -3278,9 +3272,6 @@ static void dwc2_get_dev_hwparams(struct dwc2_hsotg *hsotg) ...@@ -3278,9 +3272,6 @@ static void dwc2_get_dev_hwparams(struct dwc2_hsotg *hsotg)
/** /**
* During device initialization, read various hardware configuration * During device initialization, read various hardware configuration
* registers and interpret the contents. * registers and interpret the contents.
*
* This should be called during driver probe. It will perform a core
* soft reset in order to get the reset values of the parameters.
*/ */
int dwc2_get_hwparams(struct dwc2_hsotg *hsotg) int dwc2_get_hwparams(struct dwc2_hsotg *hsotg)
{ {
...@@ -3288,7 +3279,6 @@ int dwc2_get_hwparams(struct dwc2_hsotg *hsotg) ...@@ -3288,7 +3279,6 @@ int dwc2_get_hwparams(struct dwc2_hsotg *hsotg)
unsigned width; unsigned width;
u32 hwcfg1, hwcfg2, hwcfg3, hwcfg4; u32 hwcfg1, hwcfg2, hwcfg3, hwcfg4;
u32 grxfsiz; u32 grxfsiz;
int retval;
/* /*
* Attempt to ensure this device is really a DWC_otg Controller. * Attempt to ensure this device is really a DWC_otg Controller.
...@@ -3308,10 +3298,6 @@ int dwc2_get_hwparams(struct dwc2_hsotg *hsotg) ...@@ -3308,10 +3298,6 @@ int dwc2_get_hwparams(struct dwc2_hsotg *hsotg)
hw->snpsid >> 12 & 0xf, hw->snpsid >> 8 & 0xf, hw->snpsid >> 12 & 0xf, hw->snpsid >> 8 & 0xf,
hw->snpsid >> 4 & 0xf, hw->snpsid & 0xf, hw->snpsid); hw->snpsid >> 4 & 0xf, hw->snpsid & 0xf, hw->snpsid);
retval = dwc2_core_reset(hsotg);
if (retval)
return retval;
hwcfg1 = dwc2_readl(hsotg->regs + GHWCFG1); hwcfg1 = dwc2_readl(hsotg->regs + GHWCFG1);
hwcfg2 = dwc2_readl(hsotg->regs + GHWCFG2); hwcfg2 = dwc2_readl(hsotg->regs + GHWCFG2);
hwcfg3 = dwc2_readl(hsotg->regs + GHWCFG3); hwcfg3 = dwc2_readl(hsotg->regs + GHWCFG3);
......
...@@ -530,7 +530,13 @@ static int dwc2_driver_probe(struct platform_device *dev) ...@@ -530,7 +530,13 @@ static int dwc2_driver_probe(struct platform_device *dev)
if (retval) if (retval)
return retval; return retval;
/* Reset the controller and detect hardware config values */ /*
* Reset before dwc2_get_hwparams() then it could get power-on real
* reset value form registers.
*/
dwc2_core_reset_and_force_dr_mode(hsotg);
/* Detect config values from hardware */
retval = dwc2_get_hwparams(hsotg); retval = dwc2_get_hwparams(hsotg);
if (retval) if (retval)
goto error; goto error;
......
...@@ -2789,6 +2789,7 @@ int dwc3_gadget_init(struct dwc3 *dwc) ...@@ -2789,6 +2789,7 @@ int dwc3_gadget_init(struct dwc3 *dwc)
dwc->gadget.speed = USB_SPEED_UNKNOWN; dwc->gadget.speed = USB_SPEED_UNKNOWN;
dwc->gadget.sg_supported = true; dwc->gadget.sg_supported = true;
dwc->gadget.name = "dwc3-gadget"; dwc->gadget.name = "dwc3-gadget";
dwc->gadget.is_otg = dwc->dr_mode == USB_DR_MODE_OTG;
/* /*
* FIXME We might be setting max_speed to <SUPER, however versions * FIXME We might be setting max_speed to <SUPER, however versions
......
...@@ -348,7 +348,9 @@ static int ux500_suspend(struct device *dev) ...@@ -348,7 +348,9 @@ static int ux500_suspend(struct device *dev)
struct ux500_glue *glue = dev_get_drvdata(dev); struct ux500_glue *glue = dev_get_drvdata(dev);
struct musb *musb = glue_to_musb(glue); struct musb *musb = glue_to_musb(glue);
usb_phy_set_suspend(musb->xceiv, 1); if (musb)
usb_phy_set_suspend(musb->xceiv, 1);
clk_disable_unprepare(glue->clk); clk_disable_unprepare(glue->clk);
return 0; return 0;
...@@ -366,7 +368,8 @@ static int ux500_resume(struct device *dev) ...@@ -366,7 +368,8 @@ static int ux500_resume(struct device *dev)
return ret; return ret;
} }
usb_phy_set_suspend(musb->xceiv, 0); if (musb)
usb_phy_set_suspend(musb->xceiv, 0);
return 0; return 0;
} }
......
...@@ -1599,6 +1599,8 @@ static int msm_otg_read_dt(struct platform_device *pdev, struct msm_otg *motg) ...@@ -1599,6 +1599,8 @@ static int msm_otg_read_dt(struct platform_device *pdev, struct msm_otg *motg)
&motg->id.nb); &motg->id.nb);
if (ret < 0) { if (ret < 0) {
dev_err(&pdev->dev, "register ID notifier failed\n"); dev_err(&pdev->dev, "register ID notifier failed\n");
extcon_unregister_notifier(motg->vbus.extcon,
EXTCON_USB, &motg->vbus.nb);
return ret; return ret;
} }
...@@ -1660,15 +1662,6 @@ static int msm_otg_probe(struct platform_device *pdev) ...@@ -1660,15 +1662,6 @@ static int msm_otg_probe(struct platform_device *pdev)
if (!motg) if (!motg)
return -ENOMEM; return -ENOMEM;
pdata = dev_get_platdata(&pdev->dev);
if (!pdata) {
if (!np)
return -ENXIO;
ret = msm_otg_read_dt(pdev, motg);
if (ret)
return ret;
}
motg->phy.otg = devm_kzalloc(&pdev->dev, sizeof(struct usb_otg), motg->phy.otg = devm_kzalloc(&pdev->dev, sizeof(struct usb_otg),
GFP_KERNEL); GFP_KERNEL);
if (!motg->phy.otg) if (!motg->phy.otg)
...@@ -1710,6 +1703,15 @@ static int msm_otg_probe(struct platform_device *pdev) ...@@ -1710,6 +1703,15 @@ static int msm_otg_probe(struct platform_device *pdev)
if (!motg->regs) if (!motg->regs)
return -ENOMEM; return -ENOMEM;
pdata = dev_get_platdata(&pdev->dev);
if (!pdata) {
if (!np)
return -ENXIO;
ret = msm_otg_read_dt(pdev, motg);
if (ret)
return ret;
}
/* /*
* NOTE: The PHYs can be multiplexed between the chipidea controller * NOTE: The PHYs can be multiplexed between the chipidea controller
* and the dwc3 controller, using a single bit. It is important that * 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,8 +1719,10 @@ static int msm_otg_probe(struct platform_device *pdev)
*/ */
if (motg->phy_number) { if (motg->phy_number) {
phy_select = devm_ioremap_nocache(&pdev->dev, USB2_PHY_SEL, 4); phy_select = devm_ioremap_nocache(&pdev->dev, USB2_PHY_SEL, 4);
if (!phy_select) if (!phy_select) {
return -ENOMEM; ret = -ENOMEM;
goto unregister_extcon;
}
/* Enable second PHY with the OTG port */ /* Enable second PHY with the OTG port */
writel(0x1, phy_select); writel(0x1, phy_select);
} }
...@@ -1728,7 +1732,8 @@ static int msm_otg_probe(struct platform_device *pdev) ...@@ -1728,7 +1732,8 @@ static int msm_otg_probe(struct platform_device *pdev)
motg->irq = platform_get_irq(pdev, 0); motg->irq = platform_get_irq(pdev, 0);
if (motg->irq < 0) { if (motg->irq < 0) {
dev_err(&pdev->dev, "platform_get_irq failed\n"); dev_err(&pdev->dev, "platform_get_irq failed\n");
return motg->irq; ret = motg->irq;
goto unregister_extcon;
} }
regs[0].supply = "vddcx"; regs[0].supply = "vddcx";
...@@ -1737,7 +1742,7 @@ static int msm_otg_probe(struct platform_device *pdev) ...@@ -1737,7 +1742,7 @@ static int msm_otg_probe(struct platform_device *pdev)
ret = devm_regulator_bulk_get(motg->phy.dev, ARRAY_SIZE(regs), regs); ret = devm_regulator_bulk_get(motg->phy.dev, ARRAY_SIZE(regs), regs);
if (ret) if (ret)
return ret; goto unregister_extcon;
motg->vddcx = regs[0].consumer; motg->vddcx = regs[0].consumer;
motg->v3p3 = regs[1].consumer; motg->v3p3 = regs[1].consumer;
...@@ -1834,6 +1839,12 @@ static int msm_otg_probe(struct platform_device *pdev) ...@@ -1834,6 +1839,12 @@ static int msm_otg_probe(struct platform_device *pdev)
clk_disable_unprepare(motg->clk); clk_disable_unprepare(motg->clk);
if (!IS_ERR(motg->core_clk)) if (!IS_ERR(motg->core_clk))
clk_disable_unprepare(motg->core_clk); clk_disable_unprepare(motg->core_clk);
unregister_extcon:
extcon_unregister_notifier(motg->id.extcon,
EXTCON_USB_HOST, &motg->id.nb);
extcon_unregister_notifier(motg->vbus.extcon,
EXTCON_USB, &motg->vbus.nb);
return ret; return ret;
} }
......
...@@ -220,7 +220,7 @@ static int mxs_phy_hw_init(struct mxs_phy *mxs_phy) ...@@ -220,7 +220,7 @@ static int mxs_phy_hw_init(struct mxs_phy *mxs_phy)
/* Return true if the vbus is there */ /* Return true if the vbus is there */
static bool mxs_phy_get_vbus_status(struct mxs_phy *mxs_phy) static bool mxs_phy_get_vbus_status(struct mxs_phy *mxs_phy)
{ {
unsigned int vbus_value; unsigned int vbus_value = 0;
if (!mxs_phy->regmap_anatop) if (!mxs_phy->regmap_anatop)
return false; return false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment