From d445b6da8da491e025eb60576ce959f6a3a56a4f Mon Sep 17 00:00:00 2001 From: Heikki Krogerus Date: Mon, 13 Feb 2012 13:24:15 +0200 Subject: usb: musb: Start using struct usb_otg Use struct usb_otg members with OTG specific functions instead of usb_phy members. [ balbi@ti.com: added a missing change on musb_gadget.c to avoid a compile error on a later patch ] Signed-off-by: Heikki Krogerus Reviewed-by: Marek Vasut Signed-off-by: Felipe Balbi --- drivers/usb/musb/omap2430.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers/usb/musb/omap2430.c') diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index df719ea..a427fcb 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c @@ -132,6 +132,7 @@ static void omap2430_musb_try_idle(struct musb *musb, unsigned long timeout) static void omap2430_musb_set_vbus(struct musb *musb, int is_on) { + struct usb_otg *otg = musb->xceiv->otg; u8 devctl; unsigned long timeout = jiffies + msecs_to_jiffies(1000); int ret = 1; @@ -167,7 +168,7 @@ static void omap2430_musb_set_vbus(struct musb *musb, int is_on) otg_set_vbus(musb->xceiv, 1); } else { musb->is_active = 1; - musb->xceiv->default_a = 1; + otg->default_a = 1; musb->xceiv->state = OTG_STATE_A_WAIT_VRISE; devctl |= MUSB_DEVCTL_SESSION; MUSB_HST_MODE(musb); @@ -179,7 +180,7 @@ static void omap2430_musb_set_vbus(struct musb *musb, int is_on) * jumping right to B_IDLE... */ - musb->xceiv->default_a = 0; + otg->default_a = 0; musb->xceiv->state = OTG_STATE_B_IDLE; devctl &= ~MUSB_DEVCTL_SESSION; -- cgit v1.1 From b96d3b08365f5a9603f50f3aadca6012f7eaffa1 Mon Sep 17 00:00:00 2001 From: Heikki Krogerus Date: Mon, 13 Feb 2012 13:24:18 +0200 Subject: usb: Convert all users to new usb_phy Use the new usb_phy_* functions with transceiver operations instead of the old otg functions. Includes fixes from Sascha Hauer. Signed-off-by: Heikki Krogerus Acked-by: Sascha Hauer Acked-by: Pavankumar Kondeti Acked-by: Li Yang Acked-by: Alan Stern Reviewed-by: Marek Vasut Signed-off-by: Felipe Balbi --- drivers/usb/musb/omap2430.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'drivers/usb/musb/omap2430.c') diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index a427fcb..96a3d37 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c @@ -247,7 +247,7 @@ static void musb_otg_notifier_work(struct work_struct *data_notifier_work) if (!is_otg_enabled(musb) || musb->gadget_driver) { pm_runtime_get_sync(musb->controller); - otg_init(musb->xceiv); + usb_phy_init(musb->xceiv); omap2430_musb_set_vbus(musb, 1); } break; @@ -257,7 +257,7 @@ static void musb_otg_notifier_work(struct work_struct *data_notifier_work) if (musb->gadget_driver) pm_runtime_get_sync(musb->controller); - otg_init(musb->xceiv); + usb_phy_init(musb->xceiv); break; case USB_EVENT_NONE: @@ -273,7 +273,7 @@ static void musb_otg_notifier_work(struct work_struct *data_notifier_work) if (musb->xceiv->set_vbus) otg_set_vbus(musb->xceiv, 0); } - otg_shutdown(musb->xceiv); + usb_phy_shutdown(musb->xceiv); break; default: dev_dbg(musb->controller, "ID float\n"); @@ -291,7 +291,7 @@ static int omap2430_musb_init(struct musb *musb) * up through ULPI. TWL4030-family PMICs include one, * which needs a driver, drivers aren't always needed. */ - musb->xceiv = otg_get_transceiver(); + musb->xceiv = usb_get_transceiver(); if (!musb->xceiv) { pr_err("HS USB OTG: no transceiver configured\n"); return -ENODEV; @@ -326,7 +326,7 @@ static int omap2430_musb_init(struct musb *musb) musb_readl(musb->mregs, OTG_SIMENABLE)); musb->nb.notifier_call = musb_otg_notifications; - status = otg_register_notifier(musb->xceiv, &musb->nb); + status = usb_register_notifier(musb->xceiv, &musb->nb); if (status) dev_dbg(musb->controller, "notification register failed\n"); @@ -350,7 +350,7 @@ static void omap2430_musb_enable(struct musb *musb) switch (musb->xceiv->last_event) { case USB_EVENT_ID: - otg_init(musb->xceiv); + usb_phy_init(musb->xceiv); if (data->interface_type != MUSB_INTERFACE_UTMI) break; devctl = musb_readb(musb->mregs, MUSB_DEVCTL); @@ -369,7 +369,7 @@ static void omap2430_musb_enable(struct musb *musb) break; case USB_EVENT_VBUS: - otg_init(musb->xceiv); + usb_phy_init(musb->xceiv); break; default: @@ -380,7 +380,7 @@ static void omap2430_musb_enable(struct musb *musb) static void omap2430_musb_disable(struct musb *musb) { if (musb->xceiv->last_event) - otg_shutdown(musb->xceiv); + usb_phy_shutdown(musb->xceiv); } static int omap2430_musb_exit(struct musb *musb) @@ -389,7 +389,7 @@ static int omap2430_musb_exit(struct musb *musb) cancel_work_sync(&musb->otg_notifier_work); omap2430_low_level_exit(musb); - otg_put_transceiver(musb->xceiv); + usb_put_transceiver(musb->xceiv); return 0; } @@ -495,7 +495,7 @@ static int omap2430_runtime_suspend(struct device *dev) OTG_INTERFSEL); omap2430_low_level_exit(musb); - otg_set_suspend(musb->xceiv, 1); + usb_phy_set_suspend(musb->xceiv, 1); return 0; } @@ -509,7 +509,7 @@ static int omap2430_runtime_resume(struct device *dev) musb_writel(musb->mregs, OTG_INTERFSEL, musb->context.otg_interfsel); - otg_set_suspend(musb->xceiv, 0); + usb_phy_set_suspend(musb->xceiv, 0); return 0; } -- cgit v1.1 From 6e13c6505cdff9766d5268ffb8c972c1a2f996e6 Mon Sep 17 00:00:00 2001 From: Heikki Krogerus Date: Mon, 13 Feb 2012 13:24:20 +0200 Subject: usb: otg: Convert all users to pass struct usb_otg for OTG functions This changes the otg functions so that they receive struct otg instead of struct usb_phy as parameter and converts all users of these functions to pass the otg member of their usb_phy. Includes fixes to IMX code from Sascha Hauer. [ balbi@ti.com : fixed a compile warning on ehci-mv.c ] Signed-off-by: Heikki Krogerus Acked-by: Sascha Hauer Acked-by: Igor Grinberg Acked-by: Pavankumar Kondeti Acked-by: Li Yang Acked-by: Alan Stern Reviewed-by: Marek Vasut Signed-off-by: Felipe Balbi --- drivers/usb/musb/omap2430.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/usb/musb/omap2430.c') diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index 96a3d37..d8df60a 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c @@ -164,8 +164,8 @@ static void omap2430_musb_set_vbus(struct musb *musb, int is_on) } } - if (ret && musb->xceiv->set_vbus) - otg_set_vbus(musb->xceiv, 1); + if (ret && otg->set_vbus) + otg_set_vbus(otg, 1); } else { musb->is_active = 1; otg->default_a = 1; @@ -270,8 +270,8 @@ static void musb_otg_notifier_work(struct work_struct *data_notifier_work) } if (data->interface_type == MUSB_INTERFACE_UTMI) { - if (musb->xceiv->set_vbus) - otg_set_vbus(musb->xceiv, 0); + if (musb->xceiv->otg->set_vbus) + otg_set_vbus(musb->xceiv->otg, 0); } usb_phy_shutdown(musb->xceiv); break; -- cgit v1.1