summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorRakesh Bodla <rbodla@nvidia.com>2013-05-21 12:24:41 +0530
committerMandar Padmawar <mpadmawar@nvidia.com>2013-05-23 00:52:34 -0700
commitc2b7bf3f3a0414ef0216e822fa9f5205d5b3075d (patch)
tree58f0e2203eca788b842b8cb43189840bfebe508d /drivers/usb
parentfd2289697553352c75838a35a8898a168de85bdb (diff)
usb: gadget: tegra: set cpu normal in work context
Once USB transfers are completed, set cpu frequency to normal in work context. Bug 1292315 Change-Id: I34e6f6d85f3be8be31e5d87a742894d0ca10f8bc Signed-off-by: Rakesh Bodla <rbodla@nvidia.com> Reviewed-on: http://git-master/r/231064 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Bitan Biswas <bbiswas@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Bo Yan <byan@nvidia.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/tegra_udc.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/drivers/usb/gadget/tegra_udc.c b/drivers/usb/gadget/tegra_udc.c
index ab85a28d6cb4..27a1376eeaaf 100644
--- a/drivers/usb/gadget/tegra_udc.c
+++ b/drivers/usb/gadget/tegra_udc.c
@@ -104,7 +104,7 @@ static struct tegra_udc *the_udc;
#ifdef CONFIG_TEGRA_GADGET_BOOST_CPU_FREQ
static struct pm_qos_request boost_cpu_freq_req;
static u32 ep_queue_request_count;
- static u8 boost_cpufreq_work_flag;
+ static u8 boost_cpufreq_work_flag, set_cpufreq_normal_flag;
static struct timer_list boost_timer;
#endif
@@ -2321,17 +2321,26 @@ static void tegra_udc_set_current_limit_work(struct work_struct *work)
}
#ifdef CONFIG_TEGRA_GADGET_BOOST_CPU_FREQ
-void tegra_set_cpu_freq_normal(unsigned long data)
+void tegra_udc_set_cpu_freq_normal(unsigned long data)
{
- pm_qos_update_request(&boost_cpu_freq_req, PM_QOS_DEFAULT_VALUE);
- boost_cpufreq_work_flag = 1;
- DBG("%s(%d) set CPU frequency to normal\n", __func__, __LINE__);
+ set_cpufreq_normal_flag = 1;
+ schedule_work(&the_udc->boost_cpufreq_work);
}
static void tegra_udc_boost_cpu_frequency_work(struct work_struct *work)
{
- /* If CPU frequency is not boosted earlier boost it, otherwise
- * change timer expiry time to 2sec */
+ if (set_cpufreq_normal_flag) {
+ pm_qos_update_request(&boost_cpu_freq_req,
+ PM_QOS_DEFAULT_VALUE);
+ boost_cpufreq_work_flag = 1;
+ set_cpufreq_normal_flag = 0;
+ DBG("%s(%d) set CPU frequency to normal\n", __func__,
+ __LINE__);
+ return ;
+ }
+
+ /* If CPU frequency is not boosted earlier boost it, and modify
+ * timer expiry time to 2sec */
if (boost_cpufreq_work_flag) {
pm_qos_update_request(&boost_cpu_freq_req,
(s32)CONFIG_TEGRA_GADGET_BOOST_CPU_FREQ * 1000);
@@ -2871,7 +2880,7 @@ static int __init tegra_udc_probe(struct platform_device *pdev)
tegra_udc_boost_cpu_frequency_work);
pm_qos_add_request(&boost_cpu_freq_req, PM_QOS_CPU_FREQ_MIN,
PM_QOS_DEFAULT_VALUE);
- setup_timer(&boost_timer, tegra_set_cpu_freq_normal, 0);
+ setup_timer(&boost_timer, tegra_udc_set_cpu_freq_normal, 0);
#endif
/* Create work for controlling clocks to the phy if otg is disabled */