]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
Merge tag 'xceiv-for-v3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi...
authorOlof Johansson <olof@lixom.net>
Fri, 21 Sep 2012 03:07:06 +0000 (20:07 -0700)
committerOlof Johansson <olof@lixom.net>
Fri, 21 Sep 2012 03:07:19 +0000 (20:07 -0700)
usb: xceiv: patches for v3.7 merge window

nop xceiv got its own header to avoid polluting otg.h. It has also
learned to work as USB2 and USB3 phys so we can use it on USB3
controllers.

Together with those two changes to nop xceiv, we're adding basic
PHY support to dwc3 driver, this is to allow platforms which actually
have a SW-controllable PHY talk to them through dwc3 driver.

We're adding a new phy driver for the OMAP architecture. This driver
is for the PHY found in OMAP4 SoCs, and a new phy driver for the
marvell architecture. An extra phy driver - for Tegra SoCs - is now
moving from arch/arm/mach-tegra* to drivers/usb/phy.

Also here, there's the creation of <linux/usb/phy.h> which should be
used from now on for PHY drivers, even those which don't support
OTG.

* tag 'xceiv-for-v3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb:
  usb: otg: mxs-phy: Fix mx23 operation
  usb: dwc3: add basic PHY support
  usb: dwc3: exynos: add nop transceiver support
  usb: dwc3: omap: add nop transceiver support
  usb: dwc3: pci: add nop transceiver support
  usb: otg: move the dereference below the NULL test
  arm: omap: phy: remove unused functions from omap-phy-internal.c
  usb: twl4030: Add device tree support for twl4030 usb
  usb: twl6030: Add dt support for twl6030 usb
  usb: otg: make twl6030_usb as a comparator driver to omap_usb2
  usb: phy: add a new driver for omap usb2 phy
  usb: phy: fix build break
  usb: move phy driver from mach-tegra to drivers/usb
  usb: otg: Move phy interface to separate file.
  usb: phy: isp1301: Remove unused static array and define
  usb: phy: mv_u3d: Add usb phy driver for mv_u3d
  usb: otg: Remove the unneeded NULL check
  usb: xceiv: nop: let it work as USB2 and USB3 phy
  usb: xceiv: create nop-usb-xceiv.h and avoid pollution on otg.h

Signed-off-by: Olof Johansson <olof@lixom.net>
1  2 
arch/arm/mach-omap2/board-omap3evm.c
arch/arm/mach-omap2/twl-common.c
drivers/usb/dwc3/core.c
drivers/usb/host/ehci-tegra.c
drivers/usb/musb/musb_dsps.c
drivers/usb/musb/tusb6010.c

index 0d362e9f9cb9a9854c32b378c5dd058f2f785327,9894e3df49c20aa9091b582d9ca93b153b1e40fd..3d2a988e3d9a0c61cfe7a3a94835e90380047f0e
@@@ -32,6 -32,7 +32,7 @@@
  #include <linux/spi/ads7846.h>
  #include <linux/i2c/twl.h>
  #include <linux/usb/otg.h>
+ #include <linux/usb/nop-usb-xceiv.h>
  #include <linux/smsc911x.h>
  
  #include <linux/wl12xx.h>
@@@ -58,7 -59,6 +59,7 @@@
  #include "hsmmc.h"
  #include "common-board-devices.h"
  
 +#define OMAP3_EVM_TS_GPIO     175
  #define OMAP3_EVM_EHCI_VBUS   22
  #define OMAP3_EVM_EHCI_SELECT 61
  
index db5ff664237517562766ffdbc34887c6416c272f,e2cdf67f4b8fff761c8f6fe02e92732bb6e8b0ef..329b726012f3d01fc3483254785c209f284c8cf8
@@@ -67,7 -67,6 +67,7 @@@ void __init omap_pmic_init(int bus, u3
                           const char *pmic_type, int pmic_irq,
                           struct twl4030_platform_data *pmic_data)
  {
 +      omap_mux_init_signal("sys_nirq", OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE);
        strncpy(pmic_i2c_board_info.type, pmic_type,
                sizeof(pmic_i2c_board_info.type));
        pmic_i2c_board_info.irq = pmic_irq;
@@@ -251,11 -250,6 +251,6 @@@ void __init omap3_pmic_get_config(struc
  
  #if defined(CONFIG_ARCH_OMAP4)
  static struct twl4030_usb_data omap4_usb_pdata = {
-       .phy_init       = omap4430_phy_init,
-       .phy_exit       = omap4430_phy_exit,
-       .phy_power      = omap4430_phy_power,
-       .phy_set_clock  = omap4430_phy_set_clk,
-       .phy_suspend    = omap4430_phy_suspend,
  };
  
  static struct regulator_init_data omap4_vdac_idata = {
diff --combined drivers/usb/dwc3/core.c
index a68ff53124dc15e88ab3ceaa35e3fbf7e97cc978,79a24fab13d142fd7da020c2ba794f33b82263a4..66d15c2d6b621f915dc106cf5d7df1b908914ca9
@@@ -50,6 -50,7 +50,7 @@@
  #include <linux/dma-mapping.h>
  #include <linux/of.h>
  
+ #include <linux/usb/otg.h>
  #include <linux/usb/ch9.h>
  #include <linux/usb/gadget.h>
  
@@@ -136,6 -137,8 +137,8 @@@ static void dwc3_core_soft_reset(struc
        reg |= DWC3_GUSB2PHYCFG_PHYSOFTRST;
        dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg);
  
+       usb_phy_init(dwc->usb2_phy);
+       usb_phy_init(dwc->usb3_phy);
        mdelay(100);
  
        /* Clear USB3 PHY reset */
@@@ -436,21 -439,16 +439,21 @@@ static int __devinit dwc3_probe(struct 
                dev_err(dev, "missing IRQ\n");
                return -ENODEV;
        }
 -      dwc->xhci_resources[1] = *res;
 +      dwc->xhci_resources[1].start = res->start;
 +      dwc->xhci_resources[1].end = res->end;
 +      dwc->xhci_resources[1].flags = res->flags;
 +      dwc->xhci_resources[1].name = res->name;
  
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        if (!res) {
                dev_err(dev, "missing memory resource\n");
                return -ENODEV;
        }
 -      dwc->xhci_resources[0] = *res;
 +      dwc->xhci_resources[0].start = res->start;
        dwc->xhci_resources[0].end = dwc->xhci_resources[0].start +
                                        DWC3_XHCI_REGS_END;
 +      dwc->xhci_resources[0].flags = res->flags;
 +      dwc->xhci_resources[0].name = res->name;
  
         /*
          * Request memory region but exclude xHCI regs,
                return -ENOMEM;
        }
  
+       dwc->usb2_phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB2);
+       if (IS_ERR_OR_NULL(dwc->usb2_phy)) {
+               dev_err(dev, "no usb2 phy configured\n");
+               return -EPROBE_DEFER;
+       }
+       dwc->usb3_phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB3);
+       if (IS_ERR_OR_NULL(dwc->usb3_phy)) {
+               dev_err(dev, "no usb3 phy configured\n");
+               return -EPROBE_DEFER;
+       }
        spin_lock_init(&dwc->lock);
        platform_set_drvdata(pdev, dwc);
  
index 26dedb30ad0be75199dbaf81b3c18ec6aa3e961f,65408f7ae92bd7ac6216b76c83829546723c6205..c0d47323b52ad075867051c50fb8daede600b644
@@@ -27,7 -27,7 +27,7 @@@
  #include <linux/of_gpio.h>
  #include <linux/pm_runtime.h>
  
- #include <mach/usb_phy.h>
+ #include <linux/usb/tegra_usb_phy.h>
  #include <mach/iomap.h>
  
  #define TEGRA_USB_DMA_ALIGN 32
@@@ -49,7 -49,7 +49,7 @@@ static void tegra_ehci_power_up(struct 
  
        clk_prepare_enable(tegra->emc_clk);
        clk_prepare_enable(tegra->clk);
-       tegra_usb_phy_power_on(tegra->phy);
+       usb_phy_set_suspend(&tegra->phy->u_phy, 0);
        tegra->host_resumed = 1;
  }
  
@@@ -58,7 -58,7 +58,7 @@@ static void tegra_ehci_power_down(struc
        struct tegra_ehci_hcd *tegra = dev_get_drvdata(hcd->self.controller);
  
        tegra->host_resumed = 0;
-       tegra_usb_phy_power_off(tegra->phy);
+       usb_phy_set_suspend(&tegra->phy->u_phy, 1);
        clk_disable_unprepare(tegra->clk);
        clk_disable_unprepare(tegra->emc_clk);
  }
@@@ -715,7 -715,9 +715,9 @@@ static int tegra_ehci_probe(struct plat
                goto fail_phy;
        }
  
-       err = tegra_usb_phy_power_on(tegra->phy);
+       usb_phy_init(&tegra->phy->u_phy);
+       err = usb_phy_set_suspend(&tegra->phy->u_phy, 0);
        if (err) {
                dev_err(&pdev->dev, "Failed to power on the phy\n");
                goto fail;
@@@ -762,7 -764,7 +764,7 @@@ fail
                usb_put_phy(tegra->transceiver);
        }
  #endif
-       tegra_usb_phy_close(tegra->phy);
+       usb_phy_shutdown(&tegra->phy->u_phy);
  fail_phy:
        iounmap(hcd->regs);
  fail_io:
@@@ -799,12 -801,11 +801,12 @@@ static int tegra_ehci_remove(struct pla
  #endif
  
        usb_remove_hcd(hcd);
 -      usb_put_hcd(hcd);
  
-       tegra_usb_phy_close(tegra->phy);
+       usb_phy_shutdown(&tegra->phy->u_phy);
        iounmap(hcd->regs);
  
 +      usb_put_hcd(hcd);
 +
        clk_disable_unprepare(tegra->clk);
        clk_put(tegra->clk);
  
index 494772fc9e23ad123b7fb726fe1e0de24807b849,4e899bb129456338398cdcc4fbe4b3b2198cbef2..c20b8776aafad60b703d3b56132c535fa7eba79c
@@@ -36,6 -36,7 +36,7 @@@
  #include <linux/dma-mapping.h>
  #include <linux/pm_runtime.h>
  #include <linux/module.h>
+ #include <linux/usb/nop-usb-xceiv.h>
  
  #include <linux/of.h>
  #include <linux/of_device.h>
@@@ -479,9 -480,9 +480,9 @@@ static int __devinit dsps_create_musb_p
                ret = -ENODEV;
                goto err0;
        }
 -      strcpy((u8 *)res->name, "mc");
        res->parent = NULL;
        resources[1] = *res;
 +      resources[1].name = "mc";
  
        /* allocate the child platform device */
        musb = platform_device_alloc("musb-hdrc", -1);
@@@ -566,28 -567,27 +567,28 @@@ static int __devinit dsps_probe(struct 
        }
        platform_set_drvdata(pdev, glue);
  
 -      /* create the child platform device for first instances of musb */
 -      ret = dsps_create_musb_pdev(glue, 0);
 -      if (ret != 0) {
 -              dev_err(&pdev->dev, "failed to create child pdev\n");
 -              goto err2;
 -      }
 -
        /* enable the usbss clocks */
        pm_runtime_enable(&pdev->dev);
  
        ret = pm_runtime_get_sync(&pdev->dev);
        if (ret < 0) {
                dev_err(&pdev->dev, "pm_runtime_get_sync FAILED");
 +              goto err2;
 +      }
 +
 +      /* create the child platform device for first instances of musb */
 +      ret = dsps_create_musb_pdev(glue, 0);
 +      if (ret != 0) {
 +              dev_err(&pdev->dev, "failed to create child pdev\n");
                goto err3;
        }
  
        return 0;
  
  err3:
 -      pm_runtime_disable(&pdev->dev);
 +      pm_runtime_put(&pdev->dev);
  err2:
 +      pm_runtime_disable(&pdev->dev);
        kfree(glue->wrp);
  err1:
        kfree(glue);
index 341625442377ec6f1daac69450269c95f4148eb5,00f21dfee5d77cd761cb68b24e6493f581fea87e..c38dab190c9b8621af3e898ec00e540f8d69656e
@@@ -24,6 -24,7 +24,7 @@@
  #include <linux/irq.h>
  #include <linux/platform_device.h>
  #include <linux/dma-mapping.h>
+ #include <linux/usb/nop-usb-xceiv.h>
  
  #include "musb_core.h"
  
@@@ -1215,7 -1216,7 +1216,7 @@@ static int __devinit tusb_probe(struct 
        ret = platform_device_add(musb);
        if (ret) {
                dev_err(&pdev->dev, "failed to register musb device\n");
 -              goto err1;
 +              goto err2;
        }
  
        return 0;