From patchwork Wed Feb 11 08:16:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 5810781 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 029959F39D for ; Wed, 11 Feb 2015 08:21:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3945E20107 for ; Wed, 11 Feb 2015 08:21:36 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5DB7C200F3 for ; Wed, 11 Feb 2015 08:21:35 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YLSWH-0004oe-P9; Wed, 11 Feb 2015 08:19:37 +0000 Received: from mail-pd0-f173.google.com ([209.85.192.173]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YLSUM-0003Dj-VE for linux-arm-kernel@lists.infradead.org; Wed, 11 Feb 2015 08:17:39 +0000 Received: by pdbfp1 with SMTP id fp1so2873060pdb.9 for ; Wed, 11 Feb 2015 00:17:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=cNGmo7cLK/917213r33gPryxH5dyNIAXEgtr5zqLj/s=; b=CA1UhroIK38naLRCc81cCP05gDAJ1Fkk5juotBK7+aEsixK/oKXoz4kYzdG4WKOkql KHO3mGLIsHSMoF/Ql2ZJx2W1qPjxQtTov5stFaC8HyYYs75PcnB9thbq46TD06NTo62+ 8cEDKyTFnV2t4xPJQOYex3BJIfNVwDyGuPAm+vVHHKT/Vl3mN92gCiFON6r4hVwgm3VD tkNfU0jJmKk4eaVNxDHLTonH4PAN/xULdN5VMxGygqaKV3SwNMNxy0gODHwo8DbBLSQm OBXi7+tQp+gRCkn2X+0U0A4+OZXxdC1nZWv11LuTnapZe4kLOMONolCBQQXEbx3kE2KM ssgw== X-Gm-Message-State: ALoCoQk1LwOZ05H8kFcnFWx/Xvk5yusz3OqjM+/0M+ntUPuiNHygaok26YCvE2mH4EO7Cvy0qah8 X-Received: by 10.66.220.131 with SMTP id pw3mr44486045pac.123.1423642637864; Wed, 11 Feb 2015 00:17:17 -0800 (PST) Received: from localhost ([210.177.145.249]) by mx.google.com with ESMTPSA id pe9sm101556pbb.57.2015.02.11.00.17.16 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 11 Feb 2015 00:17:17 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki , rob.herring@linaro.org Subject: [PATCH 7/7] cpufreq-dt: Use DT to set policy->cpus/related_cpus Date: Wed, 11 Feb 2015 16:16:30 +0800 Message-Id: <7f6fcfa7cbbcc48148487330011b05005c002ab5.1423642246.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.3.0.rc0.44.ga94655d In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150211_001739_120122_6B7F6097 X-CRM114-Status: GOOD ( 11.21 ) X-Spam-Score: -0.7 (/) Cc: nm@ti.com, devicetree@vger.kernel.org, kesavan.abhilash@gmail.com, linaro-kernel@lists.linaro.org, ta.omasab@gmail.com, linux-pm@vger.kernel.org, viswanath.puttagunta@linaro.org, catalin.marinas@arm.com, santosh.shilimkar@oracle.com, sboyd@codeaurora.org, olof@lixom.net, broonie@kernel.org, Viresh Kumar , mike.turquette@linaro.org, Sudeep.Holla@arm.com, grant.likely@linaro.org, arnd.bergmann@linaro.org, thomas.petazzoni@free-electrons.com, linux-arm-kernel@lists.infradead.org, l.stach@pengutronix.de X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This updates cpufreq-dt driver to read clock sharing information from new OPP bindings. And then initialize OPPs for CPUs with help of new bindings. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq-dt.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c index bab67db54b7e..6f307897e17a 100644 --- a/drivers/cpufreq/cpufreq-dt.c +++ b/drivers/cpufreq/cpufreq-dt.c @@ -208,8 +208,14 @@ static int cpufreq_init(struct cpufreq_policy *policy) goto out_put_reg_clk; } + pd = cpufreq_get_driver_data(); + if (!pd || !pd->independent_clocks) { + if (of_get_cpus_sharing_opps(cpu_dev, policy->cpus)) + cpumask_setall(policy->cpus); + } + /* OPPs might be populated at runtime, don't check for error here */ - of_init_opp_table(cpu_dev); + of_cpumask_init_opp_table(policy->cpus); /* * But we need OPP table to function so if it is not there let's @@ -293,10 +299,6 @@ static int cpufreq_init(struct cpufreq_policy *policy) policy->cpuinfo.transition_latency = transition_latency; - pd = cpufreq_get_driver_data(); - if (!pd || !pd->independent_clocks) - cpumask_setall(policy->cpus); - of_node_put(np); return 0; @@ -306,7 +308,7 @@ static int cpufreq_init(struct cpufreq_policy *policy) out_free_priv: kfree(priv); out_free_opp: - of_free_opp_table(cpu_dev); + of_cpumask_free_opp_table(policy->cpus); of_node_put(np); out_put_reg_clk: clk_put(cpu_clk); @@ -322,7 +324,7 @@ static int cpufreq_exit(struct cpufreq_policy *policy) cpufreq_cooling_unregister(priv->cdev); dev_pm_opp_free_cpufreq_table(priv->cpu_dev, &policy->freq_table); - of_free_opp_table(priv->cpu_dev); + of_cpumask_free_opp_table(policy->related_cpus); clk_put(policy->clk); if (!IS_ERR(priv->cpu_reg)) regulator_put(priv->cpu_reg);