* [PATCH 1/1] musb : remove generic_interrupt and have all drivers define the isr on their own. Remove some unneeded CONFIG_SOC_OMAP_3430 instances
@ 2012-10-04 16:59 Philippe De Swert
2012-10-08 16:34 ` Tony Lindgren
0 siblings, 1 reply; 3+ messages in thread
From: Philippe De Swert @ 2012-10-04 16:59 UTC (permalink / raw)
To: Philippe De Swert
Cc: Praveena Nadahally, Tony lindgren, Felipe Balbi,
Greg Kroah-Hartman, linux-usb, linux-kernel, linux-omap
This patch is based on the discussion of a previous patch to fix an issue
where the omap2430 musb driver is not working for N9/N950.
Moving all the interrupt handling to the devices. Avoids inclusion of generic
interrupt and breakage due to sometimes misleading CONFIG options. This makes
sure usb always works if on of the subdrivers is chosen. Tested on Nokia N9/N950.
Partially clean up CONFIG_SOC_OMAP3430 which is not necessary in the cases
where I removed it. Also helps with the removal work of those options that
Tony Lindgren predicted would happen at some point.
Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>
---
drivers/usb/musb/musb_core.c | 31 ++-----------------------------
drivers/usb/musb/musbhsdma.h | 4 ----
drivers/usb/musb/omap2430.c | 22 ++++++++++++++++++++++
drivers/usb/musb/ux500.c | 22 ++++++++++++++++++++++
4 files changed, 46 insertions(+), 33 deletions(-)
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 26f1bef..37c770e 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -1498,33 +1498,6 @@ static int __devinit musb_core_init(u16 musb_type, struct musb *musb)
/*-------------------------------------------------------------------------*/
-#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 +1880,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
+ * - sets the musb->isr
* - may initialize an integrated tranceiver
* - initializes musb->xceiv, usually by otg_get_phy()
* - stops powering VBUS
@@ -1917,7 +1891,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/musbhsdma.h b/drivers/usb/musb/musbhsdma.h
index 320fd4a..f7b13fd2 100644
--- a/drivers/usb/musb/musbhsdma.h
+++ b/drivers/usb/musb/musbhsdma.h
@@ -31,10 +31,6 @@
*
*/
-#if defined(CONFIG_SOC_OMAP2430) || defined(CONFIG_SOC_OMAP3430)
-#include "omap2430.h"
-#endif
-
#ifndef CONFIG_BLACKFIN
#define MUSB_HSDMA_BASE 0x200
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index 5fdb9da..c63aea8 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..bce5574 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);
@@ -44,6 +64,8 @@ static int ux500_musb_init(struct musb *musb)
return -ENODEV;
}
+ musb->isr = ux500_musb_interrupt;
+
return 0;
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] musb : remove generic_interrupt and have all drivers define the isr on their own. Remove some unneeded CONFIG_SOC_OMAP_3430 instances
2012-10-04 16:59 [PATCH 1/1] musb : remove generic_interrupt and have all drivers define the isr on their own. Remove some unneeded CONFIG_SOC_OMAP_3430 instances Philippe De Swert
@ 2012-10-08 16:34 ` Tony Lindgren
2012-10-15 12:15 ` Felipe Balbi
0 siblings, 1 reply; 3+ messages in thread
From: Tony Lindgren @ 2012-10-08 16:34 UTC (permalink / raw)
To: Philippe De Swert
Cc: Philippe De Swert, Praveena Nadahally, Felipe Balbi,
Greg Kroah-Hartman, linux-usb, linux-kernel, linux-omap
* Philippe De Swert <philippedeswert@gmail.com> [121004 10:00]:
> This patch is based on the discussion of a previous patch to fix an issue
> where the omap2430 musb driver is not working for N9/N950.
>
> Moving all the interrupt handling to the devices. Avoids inclusion of generic
> interrupt and breakage due to sometimes misleading CONFIG options. This makes
> sure usb always works if on of the subdrivers is chosen. Tested on Nokia N9/N950.
>
> Partially clean up CONFIG_SOC_OMAP3430 which is not necessary in the cases
> where I removed it. Also helps with the removal work of those options that
> Tony Lindgren predicted would happen at some point.
Thanks looks OK to me:
Acked-by: Tony Lindgren <tony@atomide.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] musb : remove generic_interrupt and have all drivers define the isr on their own. Remove some unneeded CONFIG_SOC_OMAP_3430 instances
2012-10-08 16:34 ` Tony Lindgren
@ 2012-10-15 12:15 ` Felipe Balbi
0 siblings, 0 replies; 3+ messages in thread
From: Felipe Balbi @ 2012-10-15 12:15 UTC (permalink / raw)
To: Tony Lindgren
Cc: Philippe De Swert, Philippe De Swert, Praveena Nadahally,
Felipe Balbi, Greg Kroah-Hartman, linux-usb, linux-kernel,
linux-omap
[-- Attachment #1: Type: text/plain, Size: 1011 bytes --]
Hi,
On Mon, Oct 08, 2012 at 09:34:51AM -0700, Tony Lindgren wrote:
> * Philippe De Swert <philippedeswert@gmail.com> [121004 10:00]:
> > This patch is based on the discussion of a previous patch to fix an issue
> > where the omap2430 musb driver is not working for N9/N950.
> >
> > Moving all the interrupt handling to the devices. Avoids inclusion of generic
> > interrupt and breakage due to sometimes misleading CONFIG options. This makes
> > sure usb always works if on of the subdrivers is chosen. Tested on Nokia N9/N950.
> >
> > Partially clean up CONFIG_SOC_OMAP3430 which is not necessary in the cases
> > where I removed it. Also helps with the removal work of those options that
> > Tony Lindgren predicted would happen at some point.
>
> Thanks looks OK to me:
>
> Acked-by: Tony Lindgren <tony@atomide.com>
Can someone please resend this patch with Tony's Ack ? We have some mail
server change recently and I lost a few mails in the process :-(
sorry
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-10-15 12:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-04 16:59 [PATCH 1/1] musb : remove generic_interrupt and have all drivers define the isr on their own. Remove some unneeded CONFIG_SOC_OMAP_3430 instances Philippe De Swert
2012-10-08 16:34 ` Tony Lindgren
2012-10-15 12:15 ` Felipe Balbi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).