From: Greg Kroah-Hartman Date: Thu, 5 Jul 2012 22:35:41 +0000 (-0700) Subject: Merge tag 'xceiv-for-v3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi... X-Git-Tag: v3.6-rc1~101^2~24^2~33 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ff9cce82772a78983b529e044d85884d3ec95fda;p=platform%2Fkernel%2Flinux-exynos.git Merge tag 'xceiv-for-v3.6' of git://git./linux/kernel/git/balbi/usb into usb-next 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. --- ff9cce82772a78983b529e044d85884d3ec95fda diff --cc drivers/usb/gadget/omap_udc.c index b26c7d68,7b71295..d7df89e --- a/drivers/usb/gadget/omap_udc.c +++ b/drivers/usb/gadget/omap_udc.c @@@ -35,10 -35,11 +35,11 @@@ #include #include #include + #include #include +#include #include -#include #include #include #include @@@ -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); diff --cc drivers/usb/host/ehci-fsl.c index 3379945,32865a7..74914de --- a/drivers/usb/host/ehci-fsl.c +++ b/drivers/usb/host/ehci-fsl.c @@@ -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); diff --cc drivers/usb/host/ohci-omap.c index eccddb4,c7b06f5..076d201 --- a/drivers/usb/host/ohci-omap.c +++ b/drivers/usb/host/ohci-omap.c @@@ -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); diff --cc drivers/usb/otg/twl6030-usb.c index 0eabb04,600c27a..a3d0c04 --- a/drivers/usb/otg/twl6030-usb.c +++ b/drivers/usb/otg/twl6030-usb.c @@@ -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; }