From patchwork Wed Sep 26 14:06:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe De Swert X-Patchwork-Id: 1509731 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 5F9EDDF238 for ; Wed, 26 Sep 2012 14:16:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755661Ab2IZOQe (ORCPT ); Wed, 26 Sep 2012 10:16:34 -0400 Received: from smtp180.dfw.emailsrvr.com ([67.192.241.180]:48555 "EHLO smtp180.dfw.emailsrvr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755515Ab2IZOQd convert rfc822-to-8bit (ORCPT ); Wed, 26 Sep 2012 10:16:33 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp18.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id 60C2A268774 for ; Wed, 26 Sep 2012 10:07:01 -0400 (EDT) X-Virus-Scanned: OK Received: from smtp136.ord.emailsrvr.com (smtp136.ord.emailsrvr.com [173.203.6.136]) by smtp18.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTPS id 40042268329 for ; Wed, 26 Sep 2012 10:07:01 -0400 (EDT) Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp14.relay.ord1a.emailsrvr.com (SMTP Server) with ESMTP id 21AC83180DF; Wed, 26 Sep 2012 10:06:20 -0400 (EDT) X-Virus-Scanned: OK Received: from smtp192.mex05.mlsrvr.com (unknown [184.106.31.85]) by smtp14.relay.ord1a.emailsrvr.com (SMTP Server) with ESMTPS id 2EDFE318189; Wed, 26 Sep 2012 10:06:19 -0400 (EDT) Received: from ORD2MBX02B.mex05.mlsrvr.com ([fe80::90e2:baff:fe11:e98c]) by ORD2HUB01.mex05.mlsrvr.com ([fe80::109c:386a:1302:c99%20]) with mapi id 14.02.0318.001; Wed, 26 Sep 2012 09:06:17 -0500 From: Philippe De Swert To: "praveen.nadahally@stericsson.com" , Philippe De Swert CC: "balbi@ti.com" , Tony Lindgren , "linux-usb@vger.kernel.org" , "linux-omap@vger.kernel.org" , Sergei Shtylyov , "heikki.krogerus@linux.intel.com" , "kishon@ti.com" , "marek.vasut@gmail.com" , "leoli@freescale.com" , "s.hauer@pengutronix.de" , "shubhrajyoti@ti.com" , "nsekhar@ti.com" , "notasas@gmail.com" , "vikram.pandita@ti.com" , "ravibabu@ti.com" , "mina86@mina86.com" , "mian.yousaf.kaukab@stericsson.com" Subject: RE: [PATCH 1/1] usb: Include generic_interrupt for OMAP2_PLUS Thread-Topic: [PATCH 1/1] usb: Include generic_interrupt for OMAP2_PLUS Thread-Index: AQHNmkuH626ShSYaY0Wg1RgJVT2/I5eZu9iAgAAK0gCAAAI2gIAANDwAgAEK24CAABI0AIABWzOAgAA1qdI= Date: Wed, 26 Sep 2012 14:06:16 +0000 Message-ID: <02DC685EFE4B1942A41870A0F2608047A65157@ORD2MBX02B.mex05.mlsrvr.com> References: <1348487604-7202-1-git-send-email-philippe.deswert@jollamobile.com> <20120924121538.GH2892@arwen.pp.htv.fi> <20120924130216.GA5603@arwen.pp.htv.fi> <20120924160914.GB28835@atomide.com> <20120925080420.GH9137@arwen.pp.htv.fi> , In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-GB X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [88.115.16.102] MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Hi, diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 26f1bef..1d5ee34 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -1496,35 +1496,6 @@ static int __devinit musb_core_init(u16 musb_type, struct musb *musb) return 0; } -/*-------------------------------------------------------------------------*/ - -#if defined(CONFIG_SOC_OMAP2430) || defined(CONFIG_SOC_OMAP3430) || \ - defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_ARCH_U8500) - -static irqreturn_t generic_interrupt(int irq, void *__hci) -{ - unsigned long flags; - irqreturn_t retval = IRQ_NONE; - struct musb *musb = __hci; - - spin_lock_irqsave(&musb->lock, flags); - - musb->int_usb = musb_readb(musb->mregs, MUSB_INTRUSB); - musb->int_tx = musb_readw(musb->mregs, MUSB_INTRTX); - musb->int_rx = musb_readw(musb->mregs, MUSB_INTRRX); - - if (musb->int_usb || musb->int_tx || musb->int_rx) - retval = musb_interrupt(musb); - - spin_unlock_irqrestore(&musb->lock, flags); - - return retval; -} - -#else -#define generic_interrupt NULL -#endif - /* * handle all the irqs defined by the HDRC core. for now we expect: other * irq sources (phy, dma, etc) will be handled first, musb->int_* values @@ -1907,7 +1878,8 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) musb->ops = plat->platform_ops; /* The musb_platform_init() call: - * - adjusts musb->mregs and musb->isr if needed, + * - adjusts musb->mregs if needed + * - sets the musb->isr * - may initialize an integrated tranceiver * - initializes musb->xceiv, usually by otg_get_phy() * - stops powering VBUS @@ -1917,7 +1889,6 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) * external/discrete ones in various flavors (twl4030 family, * isp1504, non-OTG, etc) mostly hooking up through ULPI. */ - musb->isr = generic_interrupt; status = musb_platform_init(musb); if (status < 0) goto fail1; diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index 5fdb9da..5461619d 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c @@ -306,6 +306,26 @@ static void omap_musb_mailbox_work(struct work_struct *mailbox_work) omap_musb_set_mailbox(glue); } +static irqreturn_t omap2430_musb_interrupt(int irq, void *__hci) +{ + unsigned long flags; + irqreturn_t retval = IRQ_NONE; + struct musb *musb = __hci; + + spin_lock_irqsave(&musb->lock, flags); + + musb->int_usb = musb_readb(musb->mregs, MUSB_INTRUSB); + musb->int_tx = musb_readw(musb->mregs, MUSB_INTRTX); + musb->int_rx = musb_readw(musb->mregs, MUSB_INTRRX); + + if (musb->int_usb || musb->int_tx || musb->int_rx) + retval = musb_interrupt(musb); + + spin_unlock_irqrestore(&musb->lock, flags); + + return retval; +} + static int omap2430_musb_init(struct musb *musb) { u32 l; @@ -325,6 +345,8 @@ static int omap2430_musb_init(struct musb *musb) return -ENODEV; } + musb->isr = omap2430_musb_interrupt; + status = pm_runtime_get_sync(dev); if (status < 0) { dev_err(dev, "pm_runtime_get_sync FAILED %d\n", status); diff --git a/drivers/usb/musb/ux500.c b/drivers/usb/musb/ux500.c index a8c0fad..ec9aaec 100644 --- a/drivers/usb/musb/ux500.c +++ b/drivers/usb/musb/ux500.c @@ -36,6 +36,26 @@ struct ux500_glue { }; #define glue_to_musb(g) platform_get_drvdata(g->musb) +static irqreturn_t ux500_musb_interrupt(int irq, void *__hci) +{ + unsigned long flags; + irqreturn_t retval = IRQ_NONE; + struct musb *musb = __hci; + + spin_lock_irqsave(&musb->lock, flags); + + musb->int_usb = musb_readb(musb->mregs, MUSB_INTRUSB); + musb->int_tx = musb_readw(musb->mregs, MUSB_INTRTX); + musb->int_rx = musb_readw(musb->mregs, MUSB_INTRRX); + + if (musb->int_usb || musb->int_tx || musb->int_rx) + retval = musb_interrupt(musb); + + spin_unlock_irqrestore(&musb->lock, flags); + + return retval; +} + static int ux500_musb_init(struct musb *musb) { musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2); @@ -43,6 +63,7 @@ static int ux500_musb_init(struct musb *musb) pr_err("HS USB OTG: no transceiver configured\n"); return -ENODEV; } + musb->isr = ux500_musb_interrupt; return 0; }