aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/ab8500-core.c
diff options
context:
space:
mode:
authorBengt Jonsson <bengt.g.jonsson@stericsson.com>2012-03-08 08:01:57 -0500
committerSamuel Ortiz <sameo@linux.intel.com>2012-03-16 14:44:20 -0400
commita982362c1723464fec0414f6460684844f2638f3 (patch)
treeb9cb1805fe8e8c2acd643e77576be87d28c8d709 /drivers/mfd/ab8500-core.c
parent392cbd1e608ba79bd2da652eb3a28d841e51eaee (diff)
mfd: Support for the AB8500 AB8505 variant
This builds upon the changes done to support AB9540 so as also to support the AB8505 derivative of the AB8500 circuit. Signed-off-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/ab8500-core.c')
-rw-r--r--drivers/mfd/ab8500-core.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
index f134a6cd4b8a..c637c8d2e7de 100644
--- a/drivers/mfd/ab8500-core.c
+++ b/drivers/mfd/ab8500-core.c
@@ -360,6 +360,8 @@ static int ab8500_irq_init(struct ab8500 *ab8500)
360 360
361 if (is_ab9540(ab8500)) 361 if (is_ab9540(ab8500))
362 num_irqs = AB9540_NR_IRQS; 362 num_irqs = AB9540_NR_IRQS;
363 else if (is_ab8505(ab8500))
364 num_irqs = AB8505_NR_IRQS;
363 else 365 else
364 num_irqs = AB8500_NR_IRQS; 366 num_irqs = AB8500_NR_IRQS;
365 367
@@ -386,6 +388,8 @@ static void ab8500_irq_remove(struct ab8500 *ab8500)
386 388
387 if (is_ab9540(ab8500)) 389 if (is_ab9540(ab8500))
388 num_irqs = AB9540_NR_IRQS; 390 num_irqs = AB9540_NR_IRQS;
391 else if (is_ab8505(ab8500))
392 num_irqs = AB8505_NR_IRQS;
389 else 393 else
390 num_irqs = AB8500_NR_IRQS; 394 num_irqs = AB8500_NR_IRQS;
391 395
@@ -546,12 +550,6 @@ static struct resource __devinitdata ab8500_charger_resources[] = {
546 .flags = IORESOURCE_IRQ, 550 .flags = IORESOURCE_IRQ,
547 }, 551 },
548 { 552 {
549 .name = "USB_CHARGE_DET_DONE",
550 .start = AB8500_INT_USB_CHG_DET_DONE,
551 .end = AB8500_INT_USB_CHG_DET_DONE,
552 .flags = IORESOURCE_IRQ,
553 },
554 {
555 .name = "VBUS_OVV", 553 .name = "VBUS_OVV",
556 .start = AB8500_INT_VBUS_OVV, 554 .start = AB8500_INT_VBUS_OVV,
557 .end = AB8500_INT_VBUS_OVV, 555 .end = AB8500_INT_VBUS_OVV,
@@ -589,14 +587,8 @@ static struct resource __devinitdata ab8500_charger_resources[] = {
589 }, 587 },
590 { 588 {
591 .name = "USB_CHARGER_NOT_OKR", 589 .name = "USB_CHARGER_NOT_OKR",
592 .start = AB8500_INT_USB_CHARGER_NOT_OK, 590 .start = AB8500_INT_USB_CHARGER_NOT_OKR,
593 .end = AB8500_INT_USB_CHARGER_NOT_OK, 591 .end = AB8500_INT_USB_CHARGER_NOT_OKR,
594 .flags = IORESOURCE_IRQ,
595 },
596 {
597 .name = "USB_CHARGER_NOT_OKF",
598 .start = AB8500_INT_USB_CHARGER_NOT_OKF,
599 .end = AB8500_INT_USB_CHARGER_NOT_OKF,
600 .flags = IORESOURCE_IRQ, 592 .flags = IORESOURCE_IRQ,
601 }, 593 },
602 { 594 {
@@ -671,6 +663,12 @@ static struct resource __devinitdata ab8500_fg_resources[] = {
671 .end = AB8500_INT_CC_INT_CALIB, 663 .end = AB8500_INT_CC_INT_CALIB,
672 .flags = IORESOURCE_IRQ, 664 .flags = IORESOURCE_IRQ,
673 }, 665 },
666 {
667 .name = "CCEOC",
668 .start = AB8500_INT_CCEOC,
669 .end = AB8500_INT_CCEOC,
670 .flags = IORESOURCE_IRQ,
671 },
674}; 672};
675 673
676static struct resource __devinitdata ab8500_chargalg_resources[] = {}; 674static struct resource __devinitdata ab8500_chargalg_resources[] = {};
@@ -685,8 +683,8 @@ static struct resource __devinitdata ab8500_debug_resources[] = {
685 }, 683 },
686 { 684 {
687 .name = "IRQ_LAST", 685 .name = "IRQ_LAST",
688 .start = AB8500_INT_USB_CHARGER_NOT_OKF, 686 .start = AB8500_INT_XTAL32K_KO,
689 .end = AB8500_INT_USB_CHARGER_NOT_OKF, 687 .end = AB8500_INT_XTAL32K_KO,
690 .flags = IORESOURCE_IRQ, 688 .flags = IORESOURCE_IRQ,
691 }, 689 },
692}; 690};
@@ -1033,7 +1031,7 @@ int __devinit ab8500_init(struct ab8500 *ab8500, enum ab8500_version version)
1033 ab8500->chip_id & 0x0F); 1031 ab8500->chip_id & 0x0F);
1034 1032
1035 /* Configure AB8500 or AB9540 IRQ */ 1033 /* Configure AB8500 or AB9540 IRQ */
1036 if (is_ab9540(ab8500)) { 1034 if (is_ab9540(ab8500) || is_ab8505(ab8500)) {
1037 ab8500->mask_size = AB9540_NUM_IRQ_REGS; 1035 ab8500->mask_size = AB9540_NUM_IRQ_REGS;
1038 ab8500->irq_reg_offset = ab9540_irq_regoffset; 1036 ab8500->irq_reg_offset = ab9540_irq_regoffset;
1039 } else { 1037 } else {