summaryrefslogtreecommitdiff
path: root/drivers/mfd/ab5500-core.c
diff options
context:
space:
mode:
authorPhilippe Langlais <philippe.langlais@linaro.org>2011-07-07 13:39:47 +0200
committerPhilippe Langlais <philippe.langlais@linaro.org>2011-07-22 15:51:14 +0200
commit8464e00000facab7adbdb184148c812cd23d616e (patch)
treebf3dbd6abc014964ab1286bfddcda34cb7f59b48 /drivers/mfd/ab5500-core.c
parent4bf7f163dcaba6ab722b168bfdca9f0df07a6819 (diff)
ux500: align u5500 PRCMU & CPUFREQ management with u8500 (multiple commits in one)
Signed-off-by: Philippe Langlais <philippe.langlais@linaro.org> Merge of following commits too: u5500: add support for sysclk basic sysclk support added in PRCMU driver and clock framework driver updated. Signed-off-by: Shreshtha Kumar Sahu <shreshthakumar.sahu@stericsson.com> U5500: Support for ESRAM12 EPOD in PRCMU driver Signed-off-by: Vijaya Kumar Kilari <vijay.kilari@stericsson.com> ux500: regulator: handle different base offset of ePOD ID 5500 ePOD ids are offseted for some reason in the PRCMU driver. Adjust the ids to index the local arrays to avoid memory corruption. Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com> ux500: pm: support PRCMU status check on 5500 This also removes unused 8500v1 code. Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com> arm: ux500: prcmu_ac_wake_req workaround This patch adds a check in prcmu_ac_wake_req that the modem is awake (in terms of the value in the PRCM_MOD_AWAKE_STATUS register) after the AC_WAKE_ACK has been received from the PRCMU FW. If the check fails, a retry is made. This seems to be necessary, since the modem can generate an AC_WAKE_ACK, and then still go to sleep. Signed-off-by: Mattias Nilsson <mattias.i.nilsson@stericsson.com> U5500: Add support for PRCMU Mailbox0 Add PRCMU mailbox 0 support for irq wakeup enable and disable Signed-off-by: Vijaya Kumar K <vijay.kilari@stericsson.com> U5500: Add support for power state transition PRCMU driver is updated to provide API for system power state transition Signed-off-by: Vijaya Kumar K <vijay.kilari@stericsson.com> ARM: ux500: prcmu: Add A9 watchdog interface Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com> 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. Signed-off-by: Bibek Basu <bibek.basu@stericsson.com> ARM: ux500: prcmu-dbg: Tiny code clean-up Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com> u5500: add mailbox1 and related function support Add cpufreq-db5500.c file for db5500 CPUfreq support. PRCMU mailbox1 and related functions' support is added. List of functions implemented: - prcmu_get/set_arm_opp - read_mailbox_1 Signed-off-by: Shreshtha Kumar Sahu <shreshthakumar.sahu@stericsson.com> Fix for PRCMU u5500: PRCMU IRQ should be NO_SUSPEND As on 8500. Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com> ARM: u5500: PRCMU reset API Added API for rebooting the board and for getting the last reboot code. Signed-off-by: Pawel Szyszuk <pawel.szyszuk@stericsson.com>
Diffstat (limited to 'drivers/mfd/ab5500-core.c')
-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 75c773b232f..df0ce72e585 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 <linux/mfd/db5500-prcmu.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
@@ -1072,17 +1073,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,
@@ -1355,19 +1345,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);
@@ -1376,9 +1367,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
@@ -2416,7 +2410,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);