Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 187475
b: refs/heads/master
c: df0c382
h: refs/heads/master
i:
  187473: 42ec730
  187471: 393a06f
v: v3
  • Loading branch information
Haojian Zhuang authored and Eric Miao committed Mar 1, 2010
1 parent f534d21 commit bdae0d0
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 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: ce0ac4235972cc2533e4e2095396208b59117c57
refs/heads/master: df0c382436df5bdd74030baafa294b75c231ec8c
1 change: 1 addition & 0 deletions trunk/arch/arm/mach-mmp/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
struct sys_timer;

extern void timer_init(int irq);
extern void mmp2_clear_pmic_int(void);

extern struct sys_timer pxa168_timer;
extern struct sys_timer pxa910_timer;
Expand Down
12 changes: 11 additions & 1 deletion trunk/arch/arm/mach-mmp/irq-mmp2.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ static struct irq_chip icu_irq_chip = {
.unmask = icu_unmask_irq,
};

static void pmic_irq_ack(unsigned int irq)
{
if (irq == IRQ_MMP2_PMIC)
mmp2_clear_pmic_int();
}

#define SECOND_IRQ_MASK(_name_, irq_base, prefix) \
static void _name_##_mask_irq(unsigned int irq) \
{ \
Expand Down Expand Up @@ -82,7 +88,6 @@ SECOND_IRQ_DEMUX(_name_, irq_base, prefix) \
static struct irq_chip _name_##_irq_chip = { \
.name = #_name_, \
.mask = _name_##_mask_irq, \
.mask_ack = _name_##_mask_irq, \
.unmask = _name_##_unmask_irq, \
}

Expand Down Expand Up @@ -126,6 +131,11 @@ void __init mmp2_init_icu(void)
}
}

/* NOTE: IRQ_MMP2_PMIC requires the PMIC MFPR register
* to be written to clear the interrupt
*/
pmic_irq_chip.ack = pmic_irq_ack;

init_mux_irq(&pmic_irq_chip, IRQ_MMP2_PMIC_BASE, 2);
init_mux_irq(&rtc_irq_chip, IRQ_MMP2_RTC_BASE, 2);
init_mux_irq(&twsi_irq_chip, IRQ_MMP2_TWSI_BASE, 5);
Expand Down
10 changes: 10 additions & 0 deletions trunk/arch/arm/mach-mmp/mmp2.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ static struct mfp_addr_map mmp2_addr_map[] __initdata = {
MFP_ADDR_END,
};

void mmp2_clear_pmic_int(void)
{
unsigned long mfpr_pmic, data;

mfpr_pmic = APB_VIRT_BASE + 0x1e000 + 0x2c4;
data = __raw_readl(mfpr_pmic);
__raw_writel(data | (1 << 6), mfpr_pmic);
__raw_writel(data, mfpr_pmic);
}

static void __init mmp2_init_gpio(void)
{
int i;
Expand Down

0 comments on commit bdae0d0

Please sign in to comment.