Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 330007
b: refs/heads/master
c: f3f1f0a
h: refs/heads/master
i:
  330005: 1d6ca1d
  330003: 71a7211
  329999: 7215a17
v: v3
  • Loading branch information
Lee Jones authored and Samuel Ortiz committed Sep 24, 2012
1 parent 51da436 commit 1c0fc64
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 13 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: 0f471916d4d03503cf6fb696f7c8baf12fec30b9
refs/heads/master: f3f1f0a1eac6fd1529d552b8e2a0e1ac07293c62
47 changes: 35 additions & 12 deletions trunk/drivers/mfd/db8500-prcmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,8 @@ static struct {
struct prcmu_fw_version version;
} fw_info;

static struct irq_domain *db8500_irq_domain;

/*
* This vector maps irq numbers to the bits in the bit field used in
* communication with the PRCMU firmware.
Expand Down Expand Up @@ -2623,7 +2625,7 @@ static void prcmu_irq_mask(struct irq_data *d)

spin_lock_irqsave(&mb0_transfer.dbb_irqs_lock, flags);

mb0_transfer.req.dbb_irqs &= ~prcmu_irq_bit[d->irq - IRQ_PRCMU_BASE];
mb0_transfer.req.dbb_irqs &= ~prcmu_irq_bit[d->hwirq];

spin_unlock_irqrestore(&mb0_transfer.dbb_irqs_lock, flags);

Expand All @@ -2637,7 +2639,7 @@ static void prcmu_irq_unmask(struct irq_data *d)

spin_lock_irqsave(&mb0_transfer.dbb_irqs_lock, flags);

mb0_transfer.req.dbb_irqs |= prcmu_irq_bit[d->irq - IRQ_PRCMU_BASE];
mb0_transfer.req.dbb_irqs |= prcmu_irq_bit[d->hwirq];

spin_unlock_irqrestore(&mb0_transfer.dbb_irqs_lock, flags);

Expand Down Expand Up @@ -2677,9 +2679,37 @@ static char *fw_project_name(u8 project)
}
}

static int db8500_irq_map(struct irq_domain *d, unsigned int virq,
irq_hw_number_t hwirq)
{
irq_set_chip_and_handler(virq, &prcmu_irq_chip,
handle_simple_irq);
set_irq_flags(virq, IRQF_VALID);

return 0;
}

static struct irq_domain_ops db8500_irq_ops = {
.map = db8500_irq_map,
.xlate = irq_domain_xlate_twocell,
};

static int db8500_irq_init(struct device_node *np)
{
db8500_irq_domain = irq_domain_add_legacy(
np, NUM_PRCMU_WAKEUPS, IRQ_PRCMU_BASE,
0, &db8500_irq_ops, NULL);

if (!db8500_irq_domain) {
pr_err("Failed to create irqdomain\n");
return -ENOSYS;
}

return 0;
}

void __init db8500_prcmu_early_init(void)
{
unsigned int i;
if (cpu_is_u8500v2()) {
void *tcpm_base = ioremap_nocache(U8500_PRCMU_TCPM_BASE, SZ_4K);

Expand Down Expand Up @@ -2724,15 +2754,6 @@ void __init db8500_prcmu_early_init(void)

INIT_WORK(&mb0_transfer.mask_work, prcmu_mask_work);

/* Initalize irqs. */
for (i = 0; i < NUM_PRCMU_WAKEUPS; i++) {
unsigned int irq;

irq = IRQ_PRCMU_BASE + i;
irq_set_chip_and_handler(irq, &prcmu_irq_chip,
handle_simple_irq);
set_irq_flags(irq, IRQF_VALID);
}
compute_armss_rate();
}

Expand Down Expand Up @@ -3040,6 +3061,8 @@ static int __devinit db8500_prcmu_probe(struct platform_device *pdev)
goto no_irq_return;
}

db8500_irq_init(np);

for (i = 0; i < ARRAY_SIZE(db8500_prcmu_devs); i++) {
if (!strcmp(db8500_prcmu_devs[i].name, "ab8500-core")) {
db8500_prcmu_devs[i].platform_data = ab8500_platdata;
Expand Down

0 comments on commit 1c0fc64

Please sign in to comment.