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: 44552 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C27B02151F for ; Wed, 11 Feb 2015 08:17:45 +0000 (UTC) Received: by mail-lb0-f197.google.com with SMTP id w7sf1178688lbi.0 for ; Wed, 11 Feb 2015 00:17:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:in-reply-to:references :sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=N6810qMO0y6TGBp3L1zl5e4ZvwmM/Iqormd62EoOVUU=; b=SueFVvmbHa70yjmfOuwifvWB/NSprTYUQNLn/pd80dvbfCVnFHUvW7ftKQYHsfUyeq RgszKLbfmdqlvzg+HlllJY5+tcFm/zZR3/qNwPypwt2YwgrCbbkVxVPmakPuG//iuqC7 Nm691uNeWx1+dgikPgiRe9n1RgoTNEIQmWTJBeh2wh24ETrVeAVs1ykkkE5/8Yzh9duZ OVPwBtjmm9kHSV+uO/ozdcF/eZyGkWD6WQskVRR/CK9hPGPWbtGWFydYSS5x135NZhqb ODd08K4hpxMSbOT9M0I8NwaJqeS2YMXiI/5YIFmTTT5UJgxdbsqthIlZLmqPbq7wpPUa a6CQ== X-Gm-Message-State: ALoCoQmSFueeljLdA7YlAWfp8OXGUImZFvCmmgRTgBzvislrXac1uq9KhwsBfLGZYOIsuDZ9My55 X-Received: by 10.194.178.234 with SMTP id db10mr3244404wjc.2.1423642664699; Wed, 11 Feb 2015 00:17:44 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.25.229 with SMTP id f5ls30320lag.15.gmail; Wed, 11 Feb 2015 00:17:44 -0800 (PST) X-Received: by 10.152.161.204 with SMTP id xu12mr27231553lab.12.1423642664540; Wed, 11 Feb 2015 00:17:44 -0800 (PST) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com. [209.85.217.178]) by mx.google.com with ESMTPS id na4si13709648lbb.169.2015.02.11.00.17.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Feb 2015 00:17:44 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) client-ip=209.85.217.178; Received: by mail-lb0-f178.google.com with SMTP id w7so1736098lbi.9 for ; Wed, 11 Feb 2015 00:17:44 -0800 (PST) X-Received: by 10.112.114.230 with SMTP id jj6mr26352776lbb.112.1423642664454; Wed, 11 Feb 2015 00:17:44 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp1103003lbj; Wed, 11 Feb 2015 00:17:43 -0800 (PST) X-Received: by 10.70.96.7 with SMTP id do7mr44911830pdb.82.1423642640885; Wed, 11 Feb 2015 00:17:20 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id pn5si73267pbb.72.2015.02.11.00.17.20; Wed, 11 Feb 2015 00:17:20 -0800 (PST) Received-SPF: none (google.com: devicetree-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752039AbbBKIRT (ORCPT + 5 others); Wed, 11 Feb 2015 03:17:19 -0500 Received: from mail-pa0-f52.google.com ([209.85.220.52]:61555 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751927AbbBKIRS (ORCPT ); Wed, 11 Feb 2015 03:17:18 -0500 Received: by mail-pa0-f52.google.com with SMTP id ey11so2450463pad.11 for ; Wed, 11 Feb 2015 00:17:17 -0800 (PST) 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 Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, arnd.bergmann@linaro.org, grant.likely@linaro.org, olof@lixom.net, nm@ti.com, Sudeep.Holla@arm.com, sboyd@codeaurora.org, devicetree@vger.kernel.org, santosh.shilimkar@oracle.com, mike.turquette@linaro.org, kesavan.abhilash@gmail.com, catalin.marinas@arm.com, ta.omasab@gmail.com, linux-arm-kernel@lists.infradead.org, thomas.petazzoni@free-electrons.com, l.stach@pengutronix.de, broonie@kernel.org, viswanath.puttagunta@linaro.org, Viresh Kumar 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: Sender: devicetree-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: devicetree@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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);