summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/baseband-xmm-power.c
diff options
context:
space:
mode:
authorVinayak Pane <vpane@nvidia.com>2012-04-04 19:25:34 -0700
committerSimone Willett <swillett@nvidia.com>2012-05-21 11:46:28 -0700
commit85103ffb05dc35d342e0ced8cab75aedf619beb1 (patch)
treec00e11171d377e53edd229b7290251a02691fb75 /arch/arm/mach-tegra/baseband-xmm-power.c
parent9874f9572f416e190befce95e0c53df4e0a62645 (diff)
arm: tegra: xmm: pm qos for modem enumeration
XMM modem first enumeration has timing requirement, so khubd should perform enum within 1 second. An issue is seen sometimes when the hub events are not sent on time (on fully loaded system) and then khubd timesout. This patch adds PM QOS request to bump up the cpu frequency for 2 seconds. Bug 946027 Change-Id: I1a43c043d42cfa442517a2a7ad8d69a934d4ab47 Signed-off-by: Vinayak Pane <vpane@nvidia.com> Reviewed-on: http://git-master/r/102697 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/baseband-xmm-power.c')
-rw-r--r--arch/arm/mach-tegra/baseband-xmm-power.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/baseband-xmm-power.c b/arch/arm/mach-tegra/baseband-xmm-power.c
index 75ad8d28d475..20f8d306f901 100644
--- a/arch/arm/mach-tegra/baseband-xmm-power.c
+++ b/arch/arm/mach-tegra/baseband-xmm-power.c
@@ -31,6 +31,7 @@
#include <linux/usb.h>
#include <linux/pm_runtime.h>
#include <linux/suspend.h>
+#include <linux/pm_qos_params.h>
#include <mach/usb_phy.h>
#include "board.h"
#include "board-enterprise.h"
@@ -109,6 +110,9 @@ static DEFINE_MUTEX(xmm_onoff_mutex);
static bool system_suspending;
static struct regulator *enterprise_hsic_reg;
static bool _hsic_reg_status;
+static struct pm_qos_request_list boost_cpu_freq_req;
+static struct delayed_work pm_qos_work;
+#define BOOST_CPU_FREQ_MIN 1500000
/* driver specific data - same structure is used for flashless
* & flashed modem drivers i.e. baseband-xmm-power2.c
@@ -190,6 +194,13 @@ static int baseband_modem_power_on(struct baseband_power_platform_data *data)
udelay(70);
gpio_set_value(data->modem.xmm.bb_on, 0);
+ pr_debug("%s: pm qos request CPU 1.5GHz\n", __func__);
+ pm_qos_update_request(&boost_cpu_freq_req, (s32)BOOST_CPU_FREQ_MIN);
+ /* Device enumeration should happen in 1 sec however in any case
+ * we want to request it back to normal so schedule work to restore
+ * CPU freq after 2 seconds */
+ schedule_delayed_work(&pm_qos_work, msecs_to_jiffies(2000));
+
return 0;
}
@@ -358,6 +369,13 @@ static ssize_t xmm_onoff(struct device *dev, struct device_attribute *attr,
return count;
}
+static void pm_qos_worker(struct work_struct *work)
+{
+ pr_debug("%s - pm qos CPU back to normal\n", __func__);
+ pm_qos_update_request(&boost_cpu_freq_req,
+ (s32)PM_QOS_CPU_FREQ_MIN_DEFAULT_VALUE);
+}
+
static DEVICE_ATTR(xmm_onoff, S_IRUSR | S_IWUSR | S_IRGRP,
NULL, xmm_onoff);
@@ -1144,6 +1162,11 @@ static struct platform_driver baseband_power_driver = {
static int __init xmm_power_init(void)
{
pr_debug("%s\n", __func__);
+
+ INIT_DELAYED_WORK(&pm_qos_work, pm_qos_worker);
+ pm_qos_add_request(&boost_cpu_freq_req, PM_QOS_CPU_FREQ_MIN,
+ (s32)PM_QOS_CPU_FREQ_MIN_DEFAULT_VALUE);
+
return platform_driver_register(&baseband_power_driver);
}
@@ -1151,6 +1174,8 @@ static void __exit xmm_power_exit(void)
{
pr_debug("%s\n", __func__);
platform_driver_unregister(&baseband_power_driver);
+
+ pm_qos_remove_request(&boost_cpu_freq_req);
}
module_init(xmm_power_init)