aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap
diff options
context:
space:
mode:
authorMiguel Vadillo <vadillo@ti.com>2011-09-12 16:32:33 -0500
committerIliyan Malchev <malchev@google.com>2011-09-14 08:45:55 -0700
commitdf4c73a914a2e6d72200d1c9bfd1a3d54d2f6d83 (patch)
tree21c89c6276aac94c046fed286a1563bcabe02500 /arch/arm/plat-omap
parentd0938b1c7518784ddd33372bcb5bc18ea8f9ce08 (diff)
downloadkernel_samsung_tuna-df4c73a914a2e6d72200d1c9bfd1a3d54d2f6d83.zip
kernel_samsung_tuna-df4c73a914a2e6d72200d1c9bfd1a3d54d2f6d83.tar.gz
kernel_samsung_tuna-df4c73a914a2e6d72200d1c9bfd1a3d54d2f6d83.tar.bz2
omap: mbox: save, restore and off support
- Fix an issue related with the offsets of the registers - Each user (Ducati, Tesla ...) should not have its own ctx memory since the mbox module is one for all of them. A share ctx is created to store the needed registers when saving. - save_context function is saving just the irqs per user currently that is the only thing needed. - restore_context function is restoring just the irqs per user. mbox_startup function is setting all the rest of the register to the original state. - Add a pm_qos constraint when calling the first get and release it when the last put is calling, this is to support off mode. Change-Id: I90cd5a8baa2c6343b6f3701a6accf14d5fcc3cf9 Signed-off-by: Miguel Vadillo <vadillo@ti.com>
Diffstat (limited to 'arch/arm/plat-omap')
-rw-r--r--arch/arm/plat-omap/mailbox.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c
index 5eda382..a80e424 100644
--- a/arch/arm/plat-omap/mailbox.c
+++ b/arch/arm/plat-omap/mailbox.c
@@ -29,6 +29,7 @@
#include <linux/kfifo.h>
#include <linux/err.h>
#include <linux/notifier.h>
+#include <linux/pm_qos_params.h>
#include <plat/mailbox.h>
@@ -36,6 +37,10 @@ static struct omap_mbox **mboxes;
static int mbox_configured;
static DEFINE_MUTEX(mbox_configured_lock);
+struct pm_qos_request_list mbox_qos_request;
+
+#define SET_MPU_CORE_CONSTRAINT 10
+#define CLEAR_MPU_CORE_CONSTRAINT -1
static unsigned int mbox_kfifo_size = CONFIG_OMAP_MBOX_KFIFO_SIZE;
module_param(mbox_kfifo_size, uint, S_IRUGO);
@@ -251,6 +256,8 @@ static int omap_mbox_startup(struct omap_mbox *mbox)
mutex_lock(&mbox_configured_lock);
if (!mbox_configured++) {
+ pm_qos_update_request(&mbox_qos_request,
+ SET_MPU_CORE_CONSTRAINT);
if (likely(mbox->ops->startup)) {
ret = mbox->ops->startup(mbox);
if (unlikely(ret))
@@ -294,7 +301,9 @@ fail_request_irq:
mbox->ops->shutdown(mbox);
mbox->use_count--;
fail_startup:
- mbox_configured--;
+ if (!--mbox_configured)
+ pm_qos_update_request(&mbox_qos_request,
+ CLEAR_MPU_CORE_CONSTRAINT);
mutex_unlock(&mbox_configured_lock);
return ret;
}
@@ -312,8 +321,11 @@ static void omap_mbox_fini(struct omap_mbox *mbox)
}
if (likely(mbox->ops->shutdown)) {
- if (!--mbox_configured)
+ if (!--mbox_configured) {
mbox->ops->shutdown(mbox);
+ pm_qos_update_request(&mbox_qos_request,
+ CLEAR_MPU_CORE_CONSTRAINT);
+ }
}
mutex_unlock(&mbox_configured_lock);
@@ -396,6 +408,7 @@ int omap_mbox_unregister(void)
for (i = 0; mboxes[i]; i++)
device_unregister(mboxes[i]->dev);
+
mboxes = NULL;
return 0;
}
@@ -414,6 +427,8 @@ static int __init omap_mbox_init(void)
mbox_kfifo_size = max_t(unsigned int, mbox_kfifo_size,
sizeof(mbox_msg_t));
+ pm_qos_add_request(&mbox_qos_request, PM_QOS_CPU_DMA_LATENCY,
+ PM_QOS_DEFAULT_VALUE);
return 0;
}
subsys_initcall(omap_mbox_init);
@@ -421,6 +436,7 @@ subsys_initcall(omap_mbox_init);
static void __exit omap_mbox_exit(void)
{
class_unregister(&omap_mbox_class);
+ pm_qos_remove_request(&mbox_qos_request);
}
module_exit(omap_mbox_exit);