From patchwork Sun Dec 27 06:21:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "pi-cheng.chen" X-Patchwork-Id: 59003 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp1082243lbb; Sat, 26 Dec 2015 22:22:18 -0800 (PST) X-Received: by 10.98.14.65 with SMTP id w62mr33051527pfi.53.1451197338275; Sat, 26 Dec 2015 22:22:18 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 21si45428236pfj.91.2015.12.26.22.22.18; Sat, 26 Dec 2015 22:22:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751913AbbL0GWR (ORCPT + 11 others); Sun, 27 Dec 2015 01:22:17 -0500 Received: from mail-pf0-f175.google.com ([209.85.192.175]:35799 "EHLO mail-pf0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751718AbbL0GWP (ORCPT ); Sun, 27 Dec 2015 01:22:15 -0500 Received: by mail-pf0-f175.google.com with SMTP id 78so96446202pfw.2 for ; Sat, 26 Dec 2015 22:22:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=cUy2OR0Tjr4J+74ytebBlbQHqFFXe3w4fLqIks7uBwM=; b=ZW3JpFyR6OaByMV2OOo9pA+nYozK/ek2fZ4Hl+Im3jM89aB2CSjH6BugElUGCHFhox tWFX3tyoBSWHlgyuh0LHU/JffmGjXF6xwQmxjq1tJNz0snJyfn1Bfw0Lty91F/RuZ0Uk BI6+T+ugxfN3SSuQG/Mx6TgO1KDwxL8LRuz3s= 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; bh=cUy2OR0Tjr4J+74ytebBlbQHqFFXe3w4fLqIks7uBwM=; b=DBjQ7HEuAvg6l4phKrNH/eLl9qWaSoWcooEDoH3+rnjHIGopmySIQOwqoeAjubo24S qB55FSsKNtC4Doi6Iuy0JvHeKVzl+cNQ4XgnrCXWP8ZrLBaZnk8PaXzio9JZ2qfsmEPq L9CavxPwqcQ3W15pR/z13DnSgeT8ZSkgazXr3self2HRfhyBDXbf7D8W/zJDMhCG3Ou/ sA7xpzaeugdtKKgabgOPrtBStWxMj/rDR7Q+2SOlkB3uvPBmumTAHMqc0wgd2C5DX1H6 8CVYdHo3X5L0EWRTEUrVShYM14Io7PZenDWVnAQCFlHU0LQxJAl8ITHchKOyN0BLp0ok EuxA== X-Gm-Message-State: ALoCoQn/6DsLgnablxmKsCKz+iG+lEmfupwMqP1yX/yiUr+YdOhKzT1EfkD4FVC31Oa0o3Hn1fnxK0K2Pde+t5Xl8rpAdogAlg== X-Received: by 10.98.14.85 with SMTP id w82mr7987177pfi.131.1451197335372; Sat, 26 Dec 2015 22:22:15 -0800 (PST) Received: from localhost.localdomain ([124.219.30.17]) by smtp.googlemail.com with ESMTPSA id tu9sm73508609pac.0.2015.12.26.22.22.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 26 Dec 2015 22:22:14 -0800 (PST) From: Pi-Cheng Chen To: Viresh Kumar , Matthias Brugger Cc: Michael Turquette , Daniel Kurtz , linux-mediatek@lists.infradead.org, linaro-kernel@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v2 2/3] cpufreq: mt8173: migrate to use operating-points-v2 bindings Date: Sun, 27 Dec 2015 14:21:57 +0800 Message-Id: <1451197318-12418-3-git-send-email-pi-cheng.chen@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1451197318-12418-1-git-send-email-pi-cheng.chen@linaro.org> References: <1451197318-12418-1-git-send-email-pi-cheng.chen@linaro.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Modify mt8173-cpufreq driver to get OPP-sharing information and set up OPP table provided by operating-points-v2 bindings. Signed-off-by: Pi-Cheng Chen --- drivers/cpufreq/mt8173-cpufreq.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/cpufreq/mt8173-cpufreq.c b/drivers/cpufreq/mt8173-cpufreq.c index fd601b9..1efba34 100644 --- a/drivers/cpufreq/mt8173-cpufreq.c +++ b/drivers/cpufreq/mt8173-cpufreq.c @@ -390,7 +390,15 @@ static int mtk_cpu_dvfs_info_init(struct mtk_cpu_dvfs_info *info, int cpu) /* Both presence and absence of sram regulator are valid cases. */ sram_reg = regulator_get_exclusive(cpu_dev, "sram"); - ret = dev_pm_opp_of_add_table(cpu_dev); + /* Get OPP-sharing information from "operating-points-v2" bindings */ + ret = dev_pm_opp_of_get_sharing_cpus(cpu_dev, &info->cpus); + if (ret) { + pr_err("failed to get OPP-sharing information for cpu%d\n", + cpu); + goto out_free_resources; + } + + ret = dev_pm_opp_of_cpumask_add_table(&info->cpus); if (ret) { pr_warn("no OPP table for cpu%d\n", cpu); goto out_free_resources; @@ -421,13 +429,10 @@ static int mtk_cpu_dvfs_info_init(struct mtk_cpu_dvfs_info *info, int cpu) */ info->need_voltage_tracking = !IS_ERR(sram_reg); - /* CPUs in the same cluster share a clock and power domain. */ - cpumask_copy(&info->cpus, &cpu_topology[cpu].core_sibling); - return 0; out_free_opp_table: - dev_pm_opp_of_remove_table(cpu_dev); + dev_pm_opp_of_cpumask_remove_table(&info->cpus); out_free_resources: if (!IS_ERR(proc_reg)) @@ -453,7 +458,7 @@ static void mtk_cpu_dvfs_info_release(struct mtk_cpu_dvfs_info *info) if (!IS_ERR(info->inter_clk)) clk_put(info->inter_clk); - dev_pm_opp_of_remove_table(info->cpu_dev); + dev_pm_opp_of_cpumask_remove_table(&info->cpus); } static int mtk_cpufreq_init(struct cpufreq_policy *policy)