From patchwork Wed Nov 7 01:47:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joshua Emele X-Patchwork-Id: 1707561 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 43580E00A5 for ; Wed, 7 Nov 2012 01:49:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753218Ab2KGBss (ORCPT ); Tue, 6 Nov 2012 20:48:48 -0500 Received: from mail-da0-f46.google.com ([209.85.210.46]:44385 "EHLO mail-da0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753722Ab2KGBsq (ORCPT ); Tue, 6 Nov 2012 20:48:46 -0500 Received: by mail-da0-f46.google.com with SMTP id n41so453872dak.19 for ; Tue, 06 Nov 2012 17:48:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=62RebXrZ+ylXH0R75Tl7je1hVK7MotAFlzlpzhZICpQ=; b=sYw0vDXGos+Y86RaGacHvpos/OzpFdiMKfvPPrzdfDxG4YCnrGimUKcyMHXhmoK686 bOGdYeJVE7Y+Crwk8keBCmR7x8VxykpWtqE0FgwMl5XVdNieiPevbNKOey2zPFGkyS2c hbJ4ixTERYjIqiQzSAVdMDH3KSQ6evOw4AShy9c6l3Ye2XRyRNwWPH0ilBXMzbsPi5yU jBIQskIn2lDw+DUpiPFIG9Te6t6YKUwDFSQ7UxuRVOGWcfxT5iwliK1i7MCTFMgrjS5x rzKBz5Sq0W0LSsCiapVPZaHdBlWmgcsEtKegigmUnwN7hkJP5CmuSTlJ+UDWZbveu+sW xDnA== Received: by 10.68.245.169 with SMTP id xp9mr8939711pbc.142.1352252925798; Tue, 06 Nov 2012 17:48:45 -0800 (PST) Received: from localhost.localdomain ([69.199.146.210]) by mx.google.com with ESMTPS id i4sm13347364pav.20.2012.11.06.17.48.42 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 06 Nov 2012 17:48:45 -0800 (PST) From: Joshua Emele To: Kevin Hilman , "Rafael J. Wysocki" , linux-omap@vger.kernel.org, cpufreq@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Joshua Emele Subject: [PATCH 4/4] cpufreq: OMAP: scale the iva coprocessor if available Date: Tue, 6 Nov 2012 17:47:41 -0800 Message-Id: <1352252861-18384-5-git-send-email-jemele@gmail.com> X-Mailer: git-send-email 1.7.6.5 In-Reply-To: <1352252861-18384-1-git-send-email-jemele@gmail.com> References: <1352252861-18384-1-git-send-email-jemele@gmail.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Signed-off-by: Joshua Emele --- 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