aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBibek Basu <bibek.basu@stericsson.com>2011-06-09 15:36:39 +0530
committersaid m bagheri <ebgheri@steludxu2848.(none)>2011-06-29 10:30:33 +0200
commita0528ff5583ccea06676194ecc074c4f17b9bd3e (patch)
tree30f2d278f126608f461f2c0b6ea75c492c3c0ac7
parent12d28112ce6b2a66e5b6afdd017cf2148a36b92b (diff)
U5500 : ab5500 core interrupt hander update
AB5500 interrupts will be now handled by PRCMU and then routed to AB5500 core driver.AB5500 irq handler will no more read the latch registers to find the interrupt reason.Instead PRCMU will read the latch registers and provide the values to core driver. ST-Ericsson Linux next: 336280 Depends-On : http://gerrit.lud.stericsson.com/gerrit/24271 ST-Ericsson ID: 334774 ST-Ericsson FOSS-OUT ID: STETL-FOSS-OUT-10006 Change-Id: I4f62eb768c1d1443e9af9a5e1b79f4bb7a25406f Signed-off-by: Bibek Basu <bibek.basu@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/24777 Reviewed-by: QATEST Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
-rwxr-xr-xdrivers/mfd/ab5500-core.c42
1 files changed, 18 insertions, 24 deletions
diff --git a/drivers/mfd/ab5500-core.c b/drivers/mfd/ab5500-core.c
index c69d089597b..819aaee7ce9 100755
--- a/drivers/mfd/ab5500-core.c
+++ b/drivers/mfd/ab5500-core.c
@@ -28,7 +28,8 @@
#include <linux/spinlock.h>
#include <linux/mfd/core.h>
#include <linux/version.h>
-#include <mach/prcmu-db5500.h>
+#include <linux/io.h>
+#include <mach/prcmu.h>
#define AB5500_NAME_STRING "ab5500"
#define AB5500_ID_FORMAT_STRING "AB5500 %s"
@@ -48,7 +49,7 @@
#define AB5500_MASK_BASE (0x60)
#define AB5500_MASK_END (0x79)
#define AB5500_CHIP_ID (0x20)
-
+#define AB5500_INTERRUPTS 0x007FFFFF
/**
* struct ab5500_bank
* @slave_addr: I2C slave_addr found in AB5500 specification
@@ -1391,17 +1392,6 @@ static struct mfd_cell ab5500_devs[AB5500_NUM_DEVICES] = {
};
/*
- * This stubbed prcmu functionality should be removed when the prcmu driver
- * implements it.
- */
-static u8 prcmu_event_buf[AB5500_NUM_EVENT_REG];
-
-void prcmu_get_abb_event_buf(u8 **buf)
-{
- *buf = prcmu_event_buf;
-}
-
-/*
* Functionality for getting/setting register values.
*/
static int get_register_interruptible(struct ab5500 *ab, u8 bank, u8 reg,
@@ -1674,19 +1664,20 @@ static irqreturn_t ab5500_irq(int irq, void *data)
{
struct ab5500 *ab = data;
u8 i;
+ u8 *pvalue;
+ u8 value;
- /*
- * TODO: use the ITMASTER registers to reduce the number of i2c reads.
- */
-
+ prcmu_get_abb_event_buffer((void **)&pvalue);
+ if (unlikely(pvalue == NULL)) {
+ dev_err(ab->dev, "PRCMU not enabled!!!\n");
+ goto error_irq;
+ }
for (i = 0; i < AB5500_NUM_EVENT_REG; i++) {
- int status;
- u8 value;
-
- status = get_register_interruptible(ab, AB5500_BANK_IT,
- AB5500_IT_LATCH0_REG + i, &value);
- if (status < 0 || value == 0)
+ value = readb(pvalue);
+ if (value == 0) {
+ pvalue++;
continue;
+ }
do {
int bit = __ffs(value);
@@ -1695,9 +1686,12 @@ static irqreturn_t ab5500_irq(int irq, void *data)
handle_nested_irq(ab->irq_base + line);
value &= ~(1 << bit);
} while (value);
+ pvalue++;
}
return IRQ_HANDLED;
+error_irq:
+ return IRQ_NONE;
}
#ifdef CONFIG_DEBUG_FS
@@ -2735,7 +2729,7 @@ static int __init ab5500_probe(struct platform_device *pdev)
goto exit_remove_irq;
}
-
+ prcmu_config_abb_event_readout(AB5500_INTERRUPTS);
/* This real unpredictable IRQ is of course sampled for entropy */
rand_initialize_irq(res->start);