aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorPhilippe De Swert <philippedeswert@gmail.com>2012-11-06 08:32:13 -0500
committerFelipe Balbi <balbi@ti.com>2012-11-06 08:32:13 -0500
commitbaef653a500476ccb2d08cf4bb648c56c0170e21 (patch)
tree10908e12fd8cc4f21305f1fa763455c3d86fb76f /drivers
parent8b416b0b25d5d8ddb3a91c1d20e1373582c50405 (diff)
usb: musb: remove generic_interrupt
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> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/musb/musb_core.c31
-rw-r--r--drivers/usb/musb/musbhsdma.h4
-rw-r--r--drivers/usb/musb/omap2430.c22
-rw-r--r--drivers/usb/musb/ux500.c22
4 files changed, 46 insertions, 33 deletions
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 78037bfad96e..774d8154a286 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -1501,33 +1501,6 @@ static int __devinit musb_core_init(u16 musb_type, struct musb *musb)
1501 1501
1502/*-------------------------------------------------------------------------*/ 1502/*-------------------------------------------------------------------------*/
1503 1503
1504#if defined(CONFIG_SOC_OMAP2430) || defined(CONFIG_SOC_OMAP3430) || \
1505 defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_ARCH_U8500)
1506
1507static irqreturn_t generic_interrupt(int irq, void *__hci)
1508{
1509 unsigned long flags;
1510 irqreturn_t retval = IRQ_NONE;
1511 struct musb *musb = __hci;
1512
1513 spin_lock_irqsave(&musb->lock, flags);
1514
1515 musb->int_usb = musb_readb(musb->mregs, MUSB_INTRUSB);
1516 musb->int_tx = musb_readw(musb->mregs, MUSB_INTRTX);
1517 musb->int_rx = musb_readw(musb->mregs, MUSB_INTRRX);
1518
1519 if (musb->int_usb || musb->int_tx || musb->int_rx)
1520 retval = musb_interrupt(musb);
1521
1522 spin_unlock_irqrestore(&musb->lock, flags);
1523
1524 return retval;
1525}
1526
1527#else
1528#define generic_interrupt NULL
1529#endif
1530
1531/* 1504/*
1532 * handle all the irqs defined by the HDRC core. for now we expect: other 1505 * handle all the irqs defined by the HDRC core. for now we expect: other
1533 * irq sources (phy, dma, etc) will be handled first, musb->int_* values 1506 * irq sources (phy, dma, etc) will be handled first, musb->int_* values
@@ -1896,7 +1869,8 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
1896 musb->ops = plat->platform_ops; 1869 musb->ops = plat->platform_ops;
1897 1870
1898 /* The musb_platform_init() call: 1871 /* The musb_platform_init() call:
1899 * - adjusts musb->mregs and musb->isr if needed, 1872 * - adjusts musb->mregs
1873 * - sets the musb->isr
1900 * - may initialize an integrated tranceiver 1874 * - may initialize an integrated tranceiver
1901 * - initializes musb->xceiv, usually by otg_get_phy() 1875 * - initializes musb->xceiv, usually by otg_get_phy()
1902 * - stops powering VBUS 1876 * - stops powering VBUS
@@ -1906,7 +1880,6 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
1906 * external/discrete ones in various flavors (twl4030 family, 1880 * external/discrete ones in various flavors (twl4030 family,
1907 * isp1504, non-OTG, etc) mostly hooking up through ULPI. 1881 * isp1504, non-OTG, etc) mostly hooking up through ULPI.
1908 */ 1882 */
1909 musb->isr = generic_interrupt;
1910 status = musb_platform_init(musb); 1883 status = musb_platform_init(musb);
1911 if (status < 0) 1884 if (status < 0)
1912 goto fail1; 1885 goto fail1;
diff --git a/drivers/usb/musb/musbhsdma.h b/drivers/usb/musb/musbhsdma.h
index 320fd4afb93f..f7b13fd25257 100644
--- a/drivers/usb/musb/musbhsdma.h
+++ b/drivers/usb/musb/musbhsdma.h
@@ -31,10 +31,6 @@
31 * 31 *
32 */ 32 */
33 33
34#if defined(CONFIG_SOC_OMAP2430) || defined(CONFIG_SOC_OMAP3430)
35#include "omap2430.h"
36#endif
37
38#ifndef CONFIG_BLACKFIN 34#ifndef CONFIG_BLACKFIN
39 35
40#define MUSB_HSDMA_BASE 0x200 36#define MUSB_HSDMA_BASE 0x200
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index dddd8f71a176..32f531e7a2e6 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -333,6 +333,26 @@ static void omap_musb_mailbox_work(struct work_struct *mailbox_work)
333 omap_musb_set_mailbox(glue); 333 omap_musb_set_mailbox(glue);
334} 334}
335 335
336static irqreturn_t omap2430_musb_interrupt(int irq, void *__hci)
337{
338 unsigned long flags;
339 irqreturn_t retval = IRQ_NONE;
340 struct musb *musb = __hci;
341
342 spin_lock_irqsave(&musb->lock, flags);
343
344 musb->int_usb = musb_readb(musb->mregs, MUSB_INTRUSB);
345 musb->int_tx = musb_readw(musb->mregs, MUSB_INTRTX);
346 musb->int_rx = musb_readw(musb->mregs, MUSB_INTRRX);
347
348 if (musb->int_usb || musb->int_tx || musb->int_rx)
349 retval = musb_interrupt(musb);
350
351 spin_unlock_irqrestore(&musb->lock, flags);
352
353 return retval;
354}
355
336static int omap2430_musb_init(struct musb *musb) 356static int omap2430_musb_init(struct musb *musb)
337{ 357{
338 u32 l; 358 u32 l;
@@ -352,6 +372,8 @@ static int omap2430_musb_init(struct musb *musb)
352 return -ENODEV; 372 return -ENODEV;
353 } 373 }
354 374
375 musb->isr = omap2430_musb_interrupt;
376
355 status = pm_runtime_get_sync(dev); 377 status = pm_runtime_get_sync(dev);
356 if (status < 0) { 378 if (status < 0) {
357 dev_err(dev, "pm_runtime_get_sync FAILED %d\n", status); 379 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 5e9053eb4298..286f1be6594a 100644
--- a/drivers/usb/musb/ux500.c
+++ b/drivers/usb/musb/ux500.c
@@ -36,6 +36,26 @@ struct ux500_glue {
36}; 36};
37#define glue_to_musb(g) platform_get_drvdata(g->musb) 37#define glue_to_musb(g) platform_get_drvdata(g->musb)
38 38
39static irqreturn_t ux500_musb_interrupt(int irq, void *__hci)
40{
41 unsigned long flags;
42 irqreturn_t retval = IRQ_NONE;
43 struct musb *musb = __hci;
44
45 spin_lock_irqsave(&musb->lock, flags);
46
47 musb->int_usb = musb_readb(musb->mregs, MUSB_INTRUSB);
48 musb->int_tx = musb_readw(musb->mregs, MUSB_INTRTX);
49 musb->int_rx = musb_readw(musb->mregs, MUSB_INTRRX);
50
51 if (musb->int_usb || musb->int_tx || musb->int_rx)
52 retval = musb_interrupt(musb);
53
54 spin_unlock_irqrestore(&musb->lock, flags);
55
56 return retval;
57}
58
39static int ux500_musb_init(struct musb *musb) 59static int ux500_musb_init(struct musb *musb)
40{ 60{
41 musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2); 61 musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
@@ -44,6 +64,8 @@ static int ux500_musb_init(struct musb *musb)
44 return -ENODEV; 64 return -ENODEV;
45 } 65 }
46 66
67 musb->isr = ux500_musb_interrupt;
68
47 return 0; 69 return 0;
48} 70}
49 71