Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 338602
b: refs/heads/master
c: baef653
h: refs/heads/master
v: v3
  • Loading branch information
Philippe De Swert authored and Felipe Balbi committed Nov 6, 2012
1 parent b8ca987 commit 85cc2bb
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 34 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8b416b0b25d5d8ddb3a91c1d20e1373582c50405
refs/heads/master: baef653a500476ccb2d08cf4bb648c56c0170e21
31 changes: 2 additions & 29 deletions trunk/drivers/usb/musb/musb_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1501,33 +1501,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
Expand Down Expand Up @@ -1896,7 +1869,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
Expand All @@ -1906,7 +1880,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;
Expand Down
4 changes: 0 additions & 4 deletions trunk/drivers/usb/musb/musbhsdma.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 22 additions & 0 deletions trunk/drivers/usb/musb/omap2430.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,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;
Expand All @@ -352,6 +372,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);
Expand Down
22 changes: 22 additions & 0 deletions trunk/drivers/usb/musb/ux500.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -44,6 +64,8 @@ static int ux500_musb_init(struct musb *musb)
return -ENODEV;
}

musb->isr = ux500_musb_interrupt;

return 0;
}

Expand Down

0 comments on commit 85cc2bb

Please sign in to comment.