aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/db8500-prcmu.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-10-04 23:01:30 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-04 23:01:30 -0400
commit578f1ef91aa92beb571bfb9af8f4d18f405f3b9e (patch)
tree8ff59e772d09180b7e7f952a8c90a1bcf25e1d19 /drivers/mfd/db8500-prcmu.c
parentecefbd94b834fa32559d854646d777c56749ef1c (diff)
parent74d8378159de16a0a1d1975d4778120d263d6000 (diff)
Merge tag 'mfd-3.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6
Pull MFD changes from Samuel Ortiz: "MFD bits for the 3.7 merge window. As usual we have a few new drivers: - TI LP8788 - TI OMAP USB TLL - Maxim MAX8907 - SMSC ECE1099 - Dialog Semiconductor DA9055 - A simpler syscon driver that allow us to get rid of the anatop one. Drivers are also gradually getting Device Tree and IRQ domain support. The following drivers got DT support: - palmas, 88pm860x, tc3589x and twl4030-audio And those ones now use the IRQ domain APIs: - 88pm860x, tc3589x, db8500_prcmu Also some other interesting changes: - Intel's ICH LPC now supports Lynx Point - TI's twl4030-audio added a GPO child - tps6527 enabled its backlight subdevice - The twl6030 pwm driver moved to the new PWM subsystem And finally a bunch of cleanup and casual fixes for mc13xxx, 88pm860x, palmas, ab8500, wm8994, wm5110, max8907 and the tps65xxx family." Fix up various annoying conflicts: the DT and IRQ domain support came in twice and was already in 3.6. And then it was apparently rebased. Guys, DON'T REBASE! * tag 'mfd-3.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: (89 commits) ARM: dts: Enable 88pm860x pmic mfd: 88pm860x: Move gpadc init into touch mfd: 88pm860x: Device tree support mfd: 88pm860x: Use irqdomain mfd: smsc: Add support for smsc gpio io/keypad driver backlight: tps65217_bl: Add missing platform_set_drvdata in tps65217_bl_probe mfd: DA9055 core driver mfd: tps65910: Add alarm interrupt of TPS65910 RTC to mfd device list mfd: wm5110: Add register patches for revision B mfd: wm5110: Disable control interface error report for WM5110 rev B mfd: max8907: Remove regulator-compatible from DT docs backlight: Add TPS65217 WLED driver mfd: Add backlight as subdevice to the tps65217 mfd: Provide the PRCMU with its own IRQ domain mfd: Fix max8907 sparse warning mfd: Add lp8788 mfd driver mfd: dbx500: Provide a more accurate smp_twd clock mfd: rc5t583: Fix warning messages regulator: palmas: Add DT support mfd: palmas: Change regulator defns to better suite DT ...
Diffstat (limited to 'drivers/mfd/db8500-prcmu.c')
-rw-r--r--drivers/mfd/db8500-prcmu.c47
1 files changed, 35 insertions, 12 deletions
diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c
index 6b67edbdbd01..00b8b0f3dfb6 100644
--- a/drivers/mfd/db8500-prcmu.c
+++ b/drivers/mfd/db8500-prcmu.c
@@ -270,6 +270,8 @@ static struct {
270 struct prcmu_fw_version version; 270 struct prcmu_fw_version version;
271} fw_info; 271} fw_info;
272 272
273static struct irq_domain *db8500_irq_domain;
274
273/* 275/*
274 * This vector maps irq numbers to the bits in the bit field used in 276 * This vector maps irq numbers to the bits in the bit field used in
275 * communication with the PRCMU firmware. 277 * communication with the PRCMU firmware.
@@ -2624,7 +2626,7 @@ static void prcmu_irq_mask(struct irq_data *d)
2624 2626
2625 spin_lock_irqsave(&mb0_transfer.dbb_irqs_lock, flags); 2627 spin_lock_irqsave(&mb0_transfer.dbb_irqs_lock, flags);
2626 2628
2627 mb0_transfer.req.dbb_irqs &= ~prcmu_irq_bit[d->irq - IRQ_PRCMU_BASE]; 2629 mb0_transfer.req.dbb_irqs &= ~prcmu_irq_bit[d->hwirq];
2628 2630
2629 spin_unlock_irqrestore(&mb0_transfer.dbb_irqs_lock, flags); 2631 spin_unlock_irqrestore(&mb0_transfer.dbb_irqs_lock, flags);
2630 2632
@@ -2638,7 +2640,7 @@ static void prcmu_irq_unmask(struct irq_data *d)
2638 2640
2639 spin_lock_irqsave(&mb0_transfer.dbb_irqs_lock, flags); 2641 spin_lock_irqsave(&mb0_transfer.dbb_irqs_lock, flags);
2640 2642
2641 mb0_transfer.req.dbb_irqs |= prcmu_irq_bit[d->irq - IRQ_PRCMU_BASE]; 2643 mb0_transfer.req.dbb_irqs |= prcmu_irq_bit[d->hwirq];
2642 2644
2643 spin_unlock_irqrestore(&mb0_transfer.dbb_irqs_lock, flags); 2645 spin_unlock_irqrestore(&mb0_transfer.dbb_irqs_lock, flags);
2644 2646
@@ -2678,9 +2680,37 @@ static char *fw_project_name(u8 project)
2678 } 2680 }
2679} 2681}
2680 2682
2683static int db8500_irq_map(struct irq_domain *d, unsigned int virq,
2684 irq_hw_number_t hwirq)
2685{
2686 irq_set_chip_and_handler(virq, &prcmu_irq_chip,
2687 handle_simple_irq);
2688 set_irq_flags(virq, IRQF_VALID);
2689
2690 return 0;
2691}
2692
2693static struct irq_domain_ops db8500_irq_ops = {
2694 .map = db8500_irq_map,
2695 .xlate = irq_domain_xlate_twocell,
2696};
2697
2698static int db8500_irq_init(struct device_node *np)
2699{
2700 db8500_irq_domain = irq_domain_add_legacy(
2701 np, NUM_PRCMU_WAKEUPS, IRQ_PRCMU_BASE,
2702 0, &db8500_irq_ops, NULL);
2703
2704 if (!db8500_irq_domain) {
2705 pr_err("Failed to create irqdomain\n");
2706 return -ENOSYS;
2707 }
2708
2709 return 0;
2710}
2711
2681void __init db8500_prcmu_early_init(void) 2712void __init db8500_prcmu_early_init(void)
2682{ 2713{
2683 unsigned int i;
2684 if (cpu_is_u8500v2()) { 2714 if (cpu_is_u8500v2()) {
2685 void *tcpm_base = ioremap_nocache(U8500_PRCMU_TCPM_BASE, SZ_4K); 2715 void *tcpm_base = ioremap_nocache(U8500_PRCMU_TCPM_BASE, SZ_4K);
2686 2716
@@ -2725,15 +2755,6 @@ void __init db8500_prcmu_early_init(void)
2725 2755
2726 INIT_WORK(&mb0_transfer.mask_work, prcmu_mask_work); 2756 INIT_WORK(&mb0_transfer.mask_work, prcmu_mask_work);
2727 2757
2728 /* Initalize irqs. */
2729 for (i = 0; i < NUM_PRCMU_WAKEUPS; i++) {
2730 unsigned int irq;
2731
2732 irq = IRQ_PRCMU_BASE + i;
2733 irq_set_chip_and_handler(irq, &prcmu_irq_chip,
2734 handle_simple_irq);
2735 set_irq_flags(irq, IRQF_VALID);
2736 }
2737 compute_armss_rate(); 2758 compute_armss_rate();
2738} 2759}
2739 2760
@@ -3041,6 +3062,8 @@ static int __devinit db8500_prcmu_probe(struct platform_device *pdev)
3041 goto no_irq_return; 3062 goto no_irq_return;
3042 } 3063 }
3043 3064
3065 db8500_irq_init(np);
3066
3044 for (i = 0; i < ARRAY_SIZE(db8500_prcmu_devs); i++) { 3067 for (i = 0; i < ARRAY_SIZE(db8500_prcmu_devs); i++) {
3045 if (!strcmp(db8500_prcmu_devs[i].name, "ab8500-core")) { 3068 if (!strcmp(db8500_prcmu_devs[i].name, "ab8500-core")) {
3046 db8500_prcmu_devs[i].platform_data = ab8500_platdata; 3069 db8500_prcmu_devs[i].platform_data = ab8500_platdata;