linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joshua Emele <jemele@gmail.com>
To: Kevin Hilman <khilman@ti.com>, "Rafael J. Wysocki" <rjw@sisk.pl>,
	linux-omap@vger.kernel.org, cpufreq@vger.kernel.org,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Joshua Emele <jemele@gmail.com>
Subject: [PATCH 4/4] cpufreq: OMAP: scale the iva coprocessor if available
Date: Tue,  6 Nov 2012 17:47:41 -0800	[thread overview]
Message-ID: <1352252861-18384-5-git-send-email-jemele@gmail.com> (raw)
In-Reply-To: <1352252861-18384-1-git-send-email-jemele@gmail.com>


Signed-off-by: Joshua Emele <jemele@gmail.com>
---
 drivers/cpufreq/omap-cpufreq.c |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/drivers/cpufreq/omap-cpufreq.c b/drivers/cpufreq/omap-cpufreq.c
index e8bcad8..103fa8b 100644
--- a/drivers/cpufreq/omap-cpufreq.c
+++ b/drivers/cpufreq/omap-cpufreq.c
@@ -79,7 +79,7 @@ static int omap_target(struct cpufreq_policy *policy,
 		       unsigned int target_freq,
 		       unsigned int relation)
 {
-	unsigned int i;
+	unsigned int i, opp_index;
 	int r, ret = 0;
 	struct cpufreq_freqs freqs;
 	struct opp *opp;
@@ -92,13 +92,13 @@ static int omap_target(struct cpufreq_policy *policy,
 	}
 
 	ret = cpufreq_frequency_table_target(policy, freq_table, target_freq,
-			relation, &i);
+			relation, &opp_index);
 	if (ret) {
 		dev_dbg(mpu_dev, "%s: cpu%d: no freq match for %d(ret=%d)\n",
 			__func__, policy->cpu, target_freq, ret);
 		return ret;
 	}
-	freqs.new = freq_table[i].frequency;
+	freqs.new = freq_table[opp_index].frequency;
 	if (!freqs.new) {
 		dev_err(mpu_dev, "%s: cpu%d: no match for freq %d\n", __func__,
 			policy->cpu, target_freq);
@@ -161,6 +161,17 @@ static int omap_target(struct cpufreq_policy *policy,
 	}
 
 	freqs.new = omap_getspeed(policy->cpu);
+
+	if (!ret && iva_freq_table && iva_clk) {
+		const unsigned long iva_rate =
+			iva_freq_table[opp_index].frequency * 1000;
+		ret = clk_set_rate(iva_clk, iva_rate);
+		if (ret) {
+			pr_err("%s: failed to set %s rate %lu[%d]\n",
+					__func__, iva_clk->name, iva_rate, ret);
+		}
+	}
+
 #ifdef CONFIG_SMP
 	/*
 	 * Note that loops_per_jiffy is not updated on SMP systems in
-- 
1.7.6.5

  parent reply	other threads:[~2012-11-07  1:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-07  1:47 [PATCH 0/4] cpufreq: OMAP: if available, scale the iva coprocessor Joshua Emele
2012-11-07  1:47 ` [PATCH 1/4] cpufreq: OMAP: if an iva clock name is specified, load iva resources Joshua Emele
2012-11-07 14:53   ` Nishanth Menon
     [not found]     ` <CALH_86ST1kF_csak_75Dk7dDupOqdCT=H11MKBeLsiyqi5vd_w@mail.gmail.com>
2012-11-07 21:07       ` Nishanth Menon
2012-11-07  1:47 ` [PATCH 2/4] cpufreq: OMAP: for omap3 devices, specify the iva clock name Joshua Emele
2012-11-07  1:47 ` [PATCH 3/4] cpufreq: OMAP: ensure the iva coprocessor is at the same opp as the mpu Joshua Emele
2012-11-07  1:47 ` Joshua Emele [this message]
2012-11-07 14:42 ` [PATCH 0/4] cpufreq: OMAP: if available, scale the iva coprocessor Santosh Shilimkar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1352252861-18384-5-git-send-email-jemele@gmail.com \
    --to=jemele@gmail.com \
    --cc=cpufreq@vger.kernel.org \
    --cc=khilman@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@sisk.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).