Merge tag 'xceiv-for-v3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi...
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Jul 2012 22:35:41 +0000 (15:35 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Jul 2012 22:35:41 +0000 (15:35 -0700)
usb: phy: patches for v3.6 merge window

We are starting to support multiple USB phys as
we should thanks for Kishon's work. DeviceTree support
for USB PHYs won't come until discussion with DeviceTree
maintainer is finished.

Together with that series, we have one fix for twl4030
which missed a IRQF_ONESHOT annotation when requesting
a threaded IRQ without a top half handler, and removal
of an unused variable compilation warning to isp1301_omap.

1  2 
drivers/usb/gadget/fsl_udc_core.c
drivers/usb/gadget/mv_udc_core.c
drivers/usb/gadget/omap_udc.c
drivers/usb/gadget/pxa25x_udc.c
drivers/usb/gadget/s3c-hsudc.c
drivers/usb/host/ehci-fsl.c
drivers/usb/host/ohci-omap.c
drivers/usb/musb/davinci.c
drivers/usb/otg/twl6030-usb.c

Simple merge
Simple merge
index b26c7d68cc06ca21ab0f4ef6fad539df8734bad3,7b71295adf6fc69cbee82f3e7f079a95aa9c8b08..d7df89e72efe3854abc299622293534e685a9bc7
  #include <linux/usb/otg.h>
  #include <linux/dma-mapping.h>
  #include <linux/clk.h>
+ #include <linux/err.h>
  #include <linux/prefetch.h>
 +#include <linux/io.h>
  
  #include <asm/byteorder.h>
 -#include <asm/io.h>
  #include <asm/irq.h>
  #include <asm/unaligned.h>
  #include <asm/mach-types.h>
@@@ -1734,12 -1793,12 +1735,12 @@@ static void devstate_irq(struct omap_ud
                        if (devstat & UDC_ATT) {
                                udc->gadget.speed = USB_SPEED_FULL;
                                VDBG("connect\n");
-                               if (!udc->transceiver)
+                               if (IS_ERR_OR_NULL(udc->transceiver))
                                        pullup_enable(udc);
 -                              // if (driver->connect) call it
 +                              /* if (driver->connect) call it */
                        } else if (udc->gadget.speed != USB_SPEED_UNKNOWN) {
                                udc->gadget.speed = USB_SPEED_UNKNOWN;
-                               if (!udc->transceiver)
+                               if (IS_ERR_OR_NULL(udc->transceiver))
                                        pullup_disable(udc);
                                DBG("disconnect, gadget %s\n",
                                        udc->driver->driver.name);
@@@ -2956,10 -3011,10 +2957,10 @@@ cleanup1
        udc = NULL;
  
  cleanup0:
-       if (xceiv)
-               usb_put_transceiver(xceiv);
+       if (!IS_ERR_OR_NULL(xceiv))
+               usb_put_phy(xceiv);
  
 -      if (cpu_is_omap16xx() || cpu_is_omap24xx() || cpu_is_omap7xx()) {
 +      if (cpu_is_omap16xx() || cpu_is_omap7xx()) {
                clk_disable(hhc_clk);
                clk_disable(dc_clk);
                clk_put(hhc_clk);
Simple merge
Simple merge
index 3379945b095e23e47833b9c534ea1a98f2e5734a,32865a7145a86d394edb740ba617f7a4f91f66db..74914de8b9bf64ad9d758222bc1bc9075bc8aa78
@@@ -142,15 -143,15 +143,15 @@@ static int usb_hcd_fsl_probe(const stru
        if (pdata->operating_mode == FSL_USB2_DR_OTG) {
                struct ehci_hcd *ehci = hcd_to_ehci(hcd);
  
-               hcd->phy = usb_get_transceiver();
 -              ehci->transceiver = usb_get_phy(USB_PHY_TYPE_USB2);
 -              dev_dbg(&pdev->dev, "hcd=0x%p  ehci=0x%p, transceiver=0x%p\n",
 -                      hcd, ehci, ehci->transceiver);
++              hcd->phy = usb_get_phy(USB_PHY_TYPE_USB2);
 +              dev_dbg(&pdev->dev, "hcd=0x%p  ehci=0x%p, phy=0x%p\n",
 +                      hcd, ehci, hcd->phy);
  
-               if (hcd->phy) {
 -              if (!IS_ERR_OR_NULL(ehci->transceiver)) {
 -                      retval = otg_set_host(ehci->transceiver->otg,
++              if (!IS_ERR_OR_NULL(hcd->phy)) {
 +                      retval = otg_set_host(hcd->phy->otg,
                                              &ehci_to_hcd(ehci)->self);
                        if (retval) {
-                               usb_put_transceiver(hcd->phy);
 -                              usb_put_phy(ehci->transceiver);
++                              usb_put_phy(hcd->phy);
                                goto err4;
                        }
                } else {
@@@ -190,10 -191,11 +191,10 @@@ static void usb_hcd_fsl_remove(struct u
                               struct platform_device *pdev)
  {
        struct fsl_usb2_platform_data *pdata = pdev->dev.platform_data;
 -      struct ehci_hcd *ehci = hcd_to_ehci(hcd);
  
-       if (hcd->phy) {
 -      if (!IS_ERR_OR_NULL(ehci->transceiver)) {
 -              otg_set_host(ehci->transceiver->otg, NULL);
 -              usb_put_phy(ehci->transceiver);
++      if (!IS_ERR_OR_NULL(hcd->phy)) {
 +              otg_set_host(hcd->phy->otg, NULL);
-               usb_put_transceiver(hcd->phy);
++              usb_put_phy(hcd->phy);
        }
  
        usb_remove_hcd(hcd);
index eccddb461396d58ee6b10636f2379e21c0f67fc0,c7b06f504c60cdc29f20698baae4bd0e7059eaad..076d2018e6df752e4b3e1c30c3aa4f7598889797
@@@ -212,14 -212,14 +213,14 @@@ static int ohci_omap_init(struct usb_hc
  
  #ifdef        CONFIG_USB_OTG
        if (need_transceiver) {
-               hcd->phy = usb_get_transceiver();
-               if (hcd->phy) {
 -              ohci->transceiver = usb_get_phy(USB_PHY_TYPE_USB2);
 -              if (!IS_ERR_OR_NULL(ohci->transceiver)) {
 -                      int     status = otg_set_host(ohci->transceiver->otg,
++              hcd->phy = usb_get_phy(USB_PHY_TYPE_USB2);
++              if (!IS_ERR_OR_NULL(hcd->phy)) {
 +                      int     status = otg_set_host(hcd->phy->otg,
                                                &ohci_to_hcd(ohci)->self);
 -                      dev_dbg(hcd->self.controller, "init %s transceiver, status %d\n",
 -                                      ohci->transceiver->label, status);
 +                      dev_dbg(hcd->self.controller, "init %s phy, status %d\n",
 +                                      hcd->phy->label, status);
                        if (status) {
-                               usb_put_transceiver(hcd->phy);
 -                              usb_put_phy(ohci->transceiver);
++                              usb_put_phy(hcd->phy);
                                return status;
                        }
                } else {
@@@ -404,9 -404,9 +405,9 @@@ usb_hcd_omap_remove (struct usb_hcd *hc
        struct ohci_hcd         *ohci = hcd_to_ohci (hcd);
  
        usb_remove_hcd(hcd);
-       if (hcd->phy) {
 -      if (!IS_ERR_OR_NULL(ohci->transceiver)) {
 -              (void) otg_set_host(ohci->transceiver->otg, 0);
 -              usb_put_phy(ohci->transceiver);
++      if (!IS_ERR_OR_NULL(hcd->phy)) {
 +              (void) otg_set_host(hcd->phy->otg, 0);
-               usb_put_transceiver(hcd->phy);
++              usb_put_phy(hcd->phy);
        }
        if (machine_is_omap_osk())
                gpio_free(9);
Simple merge
index 0eabb049b6a94efb7fbb14d16cd42b3c9c0d212d,600c27a42ff146544186bea89b9c4e917cd0f17d..a3d0c0405ccaf8a898d3394d767a363f5826dc3d
@@@ -305,20 -299,19 +299,18 @@@ static irqreturn_t twl6030_usbotg_irq(i
  
                regulator_enable(twl->usb3v3);
                twl->asleep = 1;
 -              twl6030_writeb(twl, TWL_MODULE_USB, USB_ID_INT_EN_HI_CLR, 0x1);
 -              twl6030_writeb(twl, TWL_MODULE_USB, USB_ID_INT_EN_HI_SET,
 -                                                              0x10);
 +              twl6030_writeb(twl, TWL_MODULE_USB, 0x1, USB_ID_INT_EN_HI_CLR);
 +              twl6030_writeb(twl, TWL_MODULE_USB, 0x10, USB_ID_INT_EN_HI_SET);
-               status = USB_EVENT_ID;
+               status = OMAP_MUSB_ID_GROUND;
 +              otg->default_a = true;
 +              twl->phy.state = OTG_STATE_A_IDLE;
                twl->linkstat = status;
-               twl->phy.last_event = status;
-               atomic_notifier_call_chain(&twl->phy.notifier, status,
-                                                       otg->gadget);
+               omap_musb_mailbox(status);
        } else  {
 -              twl6030_writeb(twl, TWL_MODULE_USB, USB_ID_INT_EN_HI_CLR,
 -                                                              0x10);
 -              twl6030_writeb(twl, TWL_MODULE_USB, USB_ID_INT_EN_HI_SET,
 -                                                              0x1);
 +              twl6030_writeb(twl, TWL_MODULE_USB, 0x10, USB_ID_INT_EN_HI_CLR);
 +              twl6030_writeb(twl, TWL_MODULE_USB, 0x1, USB_ID_INT_EN_HI_SET);
        }
 -      twl6030_writeb(twl, TWL_MODULE_USB, USB_ID_INT_LATCH_CLR, status);
 +      twl6030_writeb(twl, TWL_MODULE_USB, status, USB_ID_INT_LATCH_CLR);
  
        return IRQ_HANDLED;
  }