]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge tag 'usb-for-v4.6' of http://git.kernel.org/pub/scm/linux/kernel/git/balbi...
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 5 Mar 2016 02:43:07 +0000 (18:43 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 5 Mar 2016 02:43:07 +0000 (18:43 -0800)
Felipe writes:

usb changes for v4.6 merge window

This is almost all under drivers/usb/dwc2/. Many
changes to the host side implementation of dwc2 have
been done by Douglas Anderson.

We also have USB 3.1 support added to the Gadget
Framework and, because of that work, dwc3 got
support to Synopsys new DWC_usb31 IP core.

Other than these 2 important series, we also have
the usual collection of non-critical fixes,
Documentation updates, and minor changes all over
the place.

15 files changed:
Documentation/devicetree/bindings/usb/usb-xhci.txt
Documentation/usb/usbip_protocol.txt [moved from drivers/usb/usbip/usbip_protocol.txt with 100% similarity]
MAINTAINERS
drivers/phy/phy-dm816x-usb.c
drivers/phy/phy-twl4030-usb.c
drivers/usb/core/hub.c
drivers/usb/host/Kconfig
drivers/usb/host/ehci-atmel.c
drivers/usb/host/ehci.h
drivers/usb/host/ohci-at91.c
drivers/usb/host/ohci-nxp.c
drivers/usb/host/ohci.h
drivers/usb/host/xhci-mtk.c
drivers/usb/host/xhci-plat.c
drivers/usb/misc/idmouse.c

index 082573289f1e5577f5e0173e6d1810c23d8dfea3..6a17aa85c4d5f65825f40b20ddef8131d3cabf8d 100644 (file)
@@ -1,10 +1,23 @@
 USB xHCI controllers
 
 Required properties:
-  - compatible: should be one of "generic-xhci",
-    "marvell,armada-375-xhci", "marvell,armada-380-xhci",
-    "renesas,xhci-r8a7790", "renesas,xhci-r8a7791", "renesas,xhci-r8a7793",
-    "renesas,xhci-r8a7795" (deprecated: "xhci-platform").
+  - compatible: should be one or more of
+
+    - "generic-xhci" for generic XHCI device
+    - "marvell,armada-375-xhci" for Armada 375 SoCs
+    - "marvell,armada-380-xhci" for Armada 38x SoCs
+    - "renesas,xhci-r8a7790" for r8a7790 SoC
+    - "renesas,xhci-r8a7791" for r8a7791 SoC
+    - "renesas,xhci-r8a7793" for r8a7793 SoC
+    - "renesas,xhci-r8a7795" for r8a7795 SoC
+    - "renesas,rcar-gen2-xhci" for a generic R-Car Gen2 compatible device
+    - "renesas,rcar-gen3-xhci" for a generic R-Car Gen3 compatible device
+    - "xhci-platform" (deprecated)
+
+    When compatible with the generic version, nodes must list the
+    SoC-specific version corresponding to the platform first
+    followed by the generic version.
+
   - reg: should contain address and length of the standard XHCI
     register set for the device.
   - interrupts: one XHCI interrupt should be described here.
index a1477a7429ab94a6fdc32f745bace8db376b687c..c55b37e4fa3bf45335269fb5ab69bef275a46e23 100644 (file)
@@ -11380,6 +11380,7 @@ M:      Valentina Manea <valentina.manea.m@gmail.com>
 M:     Shuah Khan <shuah.kh@samsung.com>
 L:     linux-usb@vger.kernel.org
 S:     Maintained
+F:     Documentation/usb/usbip_protocol.txt
 F:     drivers/usb/usbip/
 F:     tools/usb/usbip/
 
index b4bbef664d206b4a73cd665986bd12eb988de285..cbcce7cf0028e138e22cd9372188401fda45be48 100644 (file)
@@ -118,7 +118,7 @@ static const struct phy_ops ops = {
        .owner          = THIS_MODULE,
 };
 
-static int dm816x_usb_phy_runtime_suspend(struct device *dev)
+static int __maybe_unused dm816x_usb_phy_runtime_suspend(struct device *dev)
 {
        struct dm816x_usb_phy *phy = dev_get_drvdata(dev);
        unsigned int mask, val;
@@ -136,7 +136,7 @@ static int dm816x_usb_phy_runtime_suspend(struct device *dev)
        return 0;
 }
 
-static int dm816x_usb_phy_runtime_resume(struct device *dev)
+static int __maybe_unused dm816x_usb_phy_runtime_resume(struct device *dev)
 {
        struct dm816x_usb_phy *phy = dev_get_drvdata(dev);
        unsigned int mask, val;
index 840f3eae428b84292534d324ef856b485d001584..6b6af6cba45401ee98d1c7b967796157d2f9fcdc 100644 (file)
@@ -391,7 +391,7 @@ static void __twl4030_phy_power(struct twl4030_usb *twl, int on)
        WARN_ON(twl4030_usb_write_verify(twl, PHY_PWR_CTRL, pwr) < 0);
 }
 
-static int twl4030_usb_runtime_suspend(struct device *dev)
+static int __maybe_unused twl4030_usb_runtime_suspend(struct device *dev)
 {
        struct twl4030_usb *twl = dev_get_drvdata(dev);
 
@@ -405,7 +405,7 @@ static int twl4030_usb_runtime_suspend(struct device *dev)
        return 0;
 }
 
-static int twl4030_usb_runtime_resume(struct device *dev)
+static int __maybe_unused twl4030_usb_runtime_resume(struct device *dev)
 {
        struct twl4030_usb *twl = dev_get_drvdata(dev);
        int res;
index fa23967ccfb36129ca5d5aad639c1a88fd43e766..38cc4bae0a82648d92196a3c759a73ac8d9317d1 100644 (file)
@@ -4344,7 +4344,7 @@ hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1,
 {
        struct usb_device       *hdev = hub->hdev;
        struct usb_hcd          *hcd = bus_to_hcd(hdev->bus);
-       int                     i, j, retval;
+       int                     retries, operations, retval, i;
        unsigned                delay = HUB_SHORT_RESET_TIME;
        enum usb_device_speed   oldspeed = udev->speed;
        const char              *speed;
@@ -4449,7 +4449,7 @@ hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1,
         * first 8 bytes of the device descriptor to get the ep0 maxpacket
         * value.
         */
-       for (i = 0; i < GET_DESCRIPTOR_TRIES; (++i, msleep(100))) {
+       for (retries = 0; retries < GET_DESCRIPTOR_TRIES; (++retries, msleep(100))) {
                bool did_new_scheme = false;
 
                if (use_new_scheme(udev, retry_counter)) {
@@ -4476,7 +4476,7 @@ hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1,
                         * 255 is for WUSB devices, we actually need to use
                         * 512 (WUSB1.0[4.8.1]).
                         */
-                       for (j = 0; j < 3; ++j) {
+                       for (operations = 0; operations < 3; ++operations) {
                                buf->bMaxPacketSize0 = 0;
                                r = usb_control_msg(udev, usb_rcvaddr0pipe(),
                                        USB_REQ_GET_DESCRIPTOR, USB_DIR_IN,
@@ -4502,7 +4502,7 @@ hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1,
                                 * reset. But only on the first attempt,
                                 * lest we get into a time out/reset loop
                                 */
-                               if (r == 0  || (r == -ETIMEDOUT && j == 0))
+                               if (r == 0  || (r == -ETIMEDOUT && retries == 0))
                                        break;
                        }
                        udev->descriptor.bMaxPacketSize0 =
@@ -4534,7 +4534,7 @@ hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1,
                 * authorization will assign the final address.
                 */
                if (udev->wusb == 0) {
-                       for (j = 0; j < SET_ADDRESS_TRIES; ++j) {
+                       for (operations = 0; operations < SET_ADDRESS_TRIES; ++operations) {
                                retval = hub_set_address(udev, devnum);
                                if (retval >= 0)
                                        break;
index 8c20ebbc049c8b30fd38f0dc21e08a7432995bc4..3050b18b24477c805a1efc52446760c3a2458399 100644 (file)
@@ -18,7 +18,7 @@ config USB_C67X00_HCD
 
 config USB_XHCI_HCD
        tristate "xHCI HCD (USB 3.0) support"
-       depends on HAS_IOMEM
+       depends on HAS_DMA && HAS_IOMEM
        ---help---
          The eXtensible Host Controller Interface (xHCI) is standard for USB 3.0
          "SuperSpeed" host controller hardware.
@@ -73,7 +73,7 @@ endif # USB_XHCI_HCD
 
 config USB_EHCI_HCD
        tristate "EHCI HCD (USB 2.0) support"
-       depends on HAS_IOMEM
+       depends on HAS_DMA && HAS_IOMEM
        ---help---
          The Enhanced Host Controller Interface (EHCI) is standard for USB 2.0
          "high speed" (480 Mbit/sec, 60 Mbyte/sec) host controller hardware.
@@ -364,8 +364,7 @@ config USB_ISP1362_HCD
 
 config USB_FOTG210_HCD
        tristate "FOTG210 HCD support"
-       depends on USB
-       depends on HAS_IOMEM
+       depends on USB && HAS_DMA && HAS_IOMEM
        ---help---
          Faraday FOTG210 is an OTG controller which can be configured as
          an USB2.0 host. It is designed to meet USB2.0 EHCI specification
@@ -387,7 +386,7 @@ config USB_MAX3421_HCD
 
 config USB_OHCI_HCD
        tristate "OHCI HCD (USB 1.1) support"
-       depends on HAS_IOMEM
+       depends on HAS_DMA && HAS_IOMEM
        ---help---
          The Open Host Controller Interface (OHCI) is a standard for accessing
          USB 1.1 host controller hardware.  It does more in hardware than Intel's
index be0964a801e819fd5dbf88bcee3c1f12f14fd039..7440722bfbf046fc646e34659dbb4e82b80469b7 100644 (file)
@@ -185,8 +185,7 @@ static int ehci_atmel_drv_remove(struct platform_device *pdev)
        return 0;
 }
 
-#ifdef CONFIG_PM
-static int ehci_atmel_drv_suspend(struct device *dev)
+static int __maybe_unused ehci_atmel_drv_suspend(struct device *dev)
 {
        struct usb_hcd *hcd = dev_get_drvdata(dev);
        struct atmel_ehci_priv *atmel_ehci = hcd_to_atmel_ehci_priv(hcd);
@@ -200,7 +199,7 @@ static int ehci_atmel_drv_suspend(struct device *dev)
        return 0;
 }
 
-static int ehci_atmel_drv_resume(struct device *dev)
+static int __maybe_unused ehci_atmel_drv_resume(struct device *dev)
 {
        struct usb_hcd *hcd = dev_get_drvdata(dev);
        struct atmel_ehci_priv *atmel_ehci = hcd_to_atmel_ehci_priv(hcd);
@@ -208,7 +207,6 @@ static int ehci_atmel_drv_resume(struct device *dev)
        atmel_start_clock(atmel_ehci);
        return ehci_resume(hcd, false);
 }
-#endif
 
 #ifdef CONFIG_OF
 static const struct of_device_id atmel_ehci_dt_ids[] = {
index 2ddf35203c05c31290a821cf3f7fd6274f0f63ce..3f3b74aeca9740c67f45831762beea1d3c2d9097 100644 (file)
@@ -888,12 +888,10 @@ extern int        ehci_handshake(struct ehci_hcd *ehci, void __iomem *ptr,
                                u32 mask, u32 done, int usec);
 extern int     ehci_reset(struct ehci_hcd *ehci);
 
-#ifdef CONFIG_PM
 extern int     ehci_suspend(struct usb_hcd *hcd, bool do_wakeup);
 extern int     ehci_resume(struct usb_hcd *hcd, bool force_reset);
 extern void    ehci_adjust_port_wakeup_flags(struct ehci_hcd *ehci,
                        bool suspending, bool do_wakeup);
-#endif /* CONFIG_PM */
 
 extern int     ehci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
                                 u16 wIndex, char *buf, u16 wLength);
index 8c6e15bd6ff0b27ce2e8cb22c2fe03e9866f1768..f789d2954c5d421707dc53cffb1372b78896eb9b 100644 (file)
@@ -583,9 +583,7 @@ static int ohci_hcd_at91_drv_remove(struct platform_device *pdev)
        return 0;
 }
 
-#ifdef CONFIG_PM
-
-static int
+static int __maybe_unused
 ohci_hcd_at91_drv_suspend(struct device *dev)
 {
        struct usb_hcd  *hcd = dev_get_drvdata(dev);
@@ -630,7 +628,8 @@ ohci_hcd_at91_drv_suspend(struct device *dev)
        return ret;
 }
 
-static int ohci_hcd_at91_drv_resume(struct device *dev)
+static int __maybe_unused
+ohci_hcd_at91_drv_resume(struct device *dev)
 {
        struct usb_hcd  *hcd = dev_get_drvdata(dev);
        struct ohci_at91_priv *ohci_at91 = hcd_to_ohci_at91_priv(hcd);
@@ -643,7 +642,6 @@ static int ohci_hcd_at91_drv_resume(struct device *dev)
        ohci_resume(hcd, false);
        return 0;
 }
-#endif
 
 static SIMPLE_DEV_PM_OPS(ohci_hcd_at91_pm_ops, ohci_hcd_at91_drv_suspend,
                                        ohci_hcd_at91_drv_resume);
index ebacf97fc406653783da1e7888674a0b2383e4f9..b7d4756232ae305ed2502fb531cab50fa51addc5 100644 (file)
 #include <mach/hardware.h>
 
 #define USB_CONFIG_BASE                0x31020000
-#define PWRMAN_BASE            0x40004000
-
-#define USB_CTRL               IO_ADDRESS(PWRMAN_BASE + 0x64)
-
-/* USB_CTRL bit defines */
-#define USB_SLAVE_HCLK_EN      (1 << 24)
-#define USB_DEV_NEED_CLK_EN    (1 << 22)
-#define USB_HOST_NEED_CLK_EN   (1 << 21)
-#define PAD_CONTROL_LAST_DRIVEN        (1 << 19)
-
 #define USB_OTG_STAT_CONTROL   IO_ADDRESS(USB_CONFIG_BASE + 0x110)
 
 /* USB_OTG_STAT_CONTROL bit defines */
@@ -68,9 +58,7 @@ static struct i2c_client *isp1301_i2c_client;
 
 extern int usb_disabled(void);
 
-static struct clk *usb_pll_clk;
-static struct clk *usb_dev_clk;
-static struct clk *usb_otg_clk;
+static struct clk *usb_host_clk;
 
 static void isp1301_configure_lpc32xx(void)
 {
@@ -110,9 +98,6 @@ static void isp1301_configure_lpc32xx(void)
        i2c_smbus_write_byte_data(isp1301_i2c_client,
                ISP1301_I2C_INTERRUPT_RISING | ISP1301_I2C_REG_CLEAR_ADDR, ~0);
 
-       /* Enable usb_need_clk clock after transceiver is initialized */
-       __raw_writel(__raw_readl(USB_CTRL) | USB_HOST_NEED_CLK_EN, USB_CTRL);
-
        printk(KERN_INFO "ISP1301 Vendor ID  : 0x%04x\n",
              i2c_smbus_read_word_data(isp1301_i2c_client, 0x00));
        printk(KERN_INFO "ISP1301 Product ID : 0x%04x\n",
@@ -185,59 +170,20 @@ static int ohci_hcd_nxp_probe(struct platform_device *pdev)
                goto fail_disable;
        }
 
-       /* Enable AHB slave USB clock, needed for further USB clock control */
-       __raw_writel(USB_SLAVE_HCLK_EN | PAD_CONTROL_LAST_DRIVEN, USB_CTRL);
-
-       /* Enable USB PLL */
-       usb_pll_clk = devm_clk_get(&pdev->dev, "ck_pll5");
-       if (IS_ERR(usb_pll_clk)) {
-               dev_err(&pdev->dev, "failed to acquire USB PLL\n");
-               ret = PTR_ERR(usb_pll_clk);
+       /* Enable USB host clock */
+       usb_host_clk = devm_clk_get(&pdev->dev, NULL);
+       if (IS_ERR(usb_host_clk)) {
+               dev_err(&pdev->dev, "failed to acquire USB OHCI clock\n");
+               ret = PTR_ERR(usb_host_clk);
                goto fail_disable;
        }
 
-       ret = clk_prepare_enable(usb_pll_clk);
+       ret = clk_prepare_enable(usb_host_clk);
        if (ret < 0) {
-               dev_err(&pdev->dev, "failed to start USB PLL\n");
+               dev_err(&pdev->dev, "failed to start USB OHCI clock\n");
                goto fail_disable;
        }
 
-       ret = clk_set_rate(usb_pll_clk, 48000);
-       if (ret < 0) {
-               dev_err(&pdev->dev, "failed to set USB clock rate\n");
-               goto fail_rate;
-       }
-
-       /* Enable USB device clock */
-       usb_dev_clk = devm_clk_get(&pdev->dev, "ck_usbd");
-       if (IS_ERR(usb_dev_clk)) {
-               dev_err(&pdev->dev, "failed to acquire USB DEV Clock\n");
-               ret = PTR_ERR(usb_dev_clk);
-               goto fail_rate;
-       }
-
-       ret = clk_prepare_enable(usb_dev_clk);
-       if (ret < 0) {
-               dev_err(&pdev->dev, "failed to start USB DEV Clock\n");
-               goto fail_rate;
-       }
-
-       /* Enable USB otg clocks */
-       usb_otg_clk = devm_clk_get(&pdev->dev, "ck_usb_otg");
-       if (IS_ERR(usb_otg_clk)) {
-               dev_err(&pdev->dev, "failed to acquire USB DEV Clock\n");
-               ret = PTR_ERR(usb_otg_clk);
-               goto fail_otg;
-       }
-
-       __raw_writel(__raw_readl(USB_CTRL) | USB_HOST_NEED_CLK_EN, USB_CTRL);
-
-       ret = clk_prepare_enable(usb_otg_clk);
-       if (ret < 0) {
-               dev_err(&pdev->dev, "failed to start USB DEV Clock\n");
-               goto fail_otg;
-       }
-
        isp1301_configure();
 
        hcd = usb_create_hcd(driver, &pdev->dev, dev_name(&pdev->dev));
@@ -276,11 +222,7 @@ static int ohci_hcd_nxp_probe(struct platform_device *pdev)
 fail_resource:
        usb_put_hcd(hcd);
 fail_hcd:
-       clk_disable_unprepare(usb_otg_clk);
-fail_otg:
-       clk_disable_unprepare(usb_dev_clk);
-fail_rate:
-       clk_disable_unprepare(usb_pll_clk);
+       clk_disable_unprepare(usb_host_clk);
 fail_disable:
        isp1301_i2c_client = NULL;
        return ret;
@@ -293,9 +235,7 @@ static int ohci_hcd_nxp_remove(struct platform_device *pdev)
        usb_remove_hcd(hcd);
        ohci_nxp_stop_hc();
        usb_put_hcd(hcd);
-       clk_disable_unprepare(usb_otg_clk);
-       clk_disable_unprepare(usb_dev_clk);
-       clk_disable_unprepare(usb_pll_clk);
+       clk_disable_unprepare(usb_host_clk);
        isp1301_i2c_client = NULL;
 
        return 0;
index bc462288cfb079c4d2af75ef8ae7b9c6b0ebda98..37f1725e7a469c45fa035a46ed9827a5b92bc6c7 100644 (file)
@@ -735,10 +735,8 @@ extern void        ohci_init_driver(struct hc_driver *drv,
                                const struct ohci_driver_overrides *over);
 extern int     ohci_restart(struct ohci_hcd *ohci);
 extern int     ohci_setup(struct usb_hcd *hcd);
-#ifdef CONFIG_PM
 extern int     ohci_suspend(struct usb_hcd *hcd, bool do_wakeup);
 extern int     ohci_resume(struct usb_hcd *hcd, bool hibernated);
-#endif
 extern int     ohci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
                                 u16 wIndex, char *buf, u16 wLength);
 extern int     ohci_hub_status_data(struct usb_hcd *hcd, char *buf);
index 9532f5aef71bfe310b499db66a266e9a2c7b32f4..79959f17c38cfe3cd0791b87cf9f0dd90f93ad9d 100644 (file)
@@ -695,7 +695,6 @@ static int xhci_mtk_remove(struct platform_device *dev)
        return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 /*
  * if ip sleep fails, and all clocks are disabled, access register will hang
  * AHB bus, so stop polling roothubs to avoid regs access on bus suspend.
@@ -703,7 +702,7 @@ static int xhci_mtk_remove(struct platform_device *dev)
  * to wake up system immediately after system suspend complete if ip sleep
  * fails, it is what we wanted.
  */
-static int xhci_mtk_suspend(struct device *dev)
+static int __maybe_unused xhci_mtk_suspend(struct device *dev)
 {
        struct xhci_hcd_mtk *mtk = dev_get_drvdata(dev);
        struct usb_hcd *hcd = mtk->hcd;
@@ -722,7 +721,7 @@ static int xhci_mtk_suspend(struct device *dev)
        return 0;
 }
 
-static int xhci_mtk_resume(struct device *dev)
+static int __maybe_unused xhci_mtk_resume(struct device *dev)
 {
        struct xhci_hcd_mtk *mtk = dev_get_drvdata(dev);
        struct usb_hcd *hcd = mtk->hcd;
@@ -744,10 +743,7 @@ static int xhci_mtk_resume(struct device *dev)
 static const struct dev_pm_ops xhci_mtk_pm_ops = {
        SET_SYSTEM_SLEEP_PM_OPS(xhci_mtk_suspend, xhci_mtk_resume)
 };
-#define DEV_PM_OPS     (&xhci_mtk_pm_ops)
-#else
-#define DEV_PM_OPS     NULL
-#endif /* CONFIG_PM */
+#define DEV_PM_OPS IS_ENABLED(CONFIG_PM) ? &xhci_mtk_pm_ops : NULL
 
 #ifdef CONFIG_OF
 static const struct of_device_id mtk_xhci_of_match[] = {
index d39d6bf1d090dad06687892ed723ea3a5e993083..5c15e9bc5f7a418e2c56645a2a753e659d20167a 100644 (file)
@@ -110,7 +110,13 @@ static const struct of_device_id usb_xhci_of_match[] = {
                .compatible = "renesas,xhci-r8a7795",
                .data = &xhci_plat_renesas_rcar_gen3,
        }, {
+               .compatible = "renesas,rcar-gen2-xhci",
+               .data = &xhci_plat_renesas_rcar_gen2,
+       }, {
+               .compatible = "renesas,rcar-gen3-xhci",
+               .data = &xhci_plat_renesas_rcar_gen3,
        },
+       {},
 };
 MODULE_DEVICE_TABLE(of, usb_xhci_of_match);
 #endif
index 4e38683c653cf3b9dc614b2b3f4f1cf721cfac14..5105397e62fc764616fce38899747195cafcc553 100644 (file)
@@ -257,9 +257,9 @@ static int idmouse_open(struct inode *inode, struct file *file)
                if (result)
                        goto error;
                result = idmouse_create_image (dev);
+               usb_autopm_put_interface(interface);
                if (result)
                        goto error;
-               usb_autopm_put_interface(interface);
 
                /* increment our usage count for the driver */
                ++dev->open;