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: 7923031 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 06BF5BEEE5 for ; Sun, 27 Dec 2015 06:26:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3F244202E6 for ; Sun, 27 Dec 2015 06:26:18 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 71F9F202C8 for ; Sun, 27 Dec 2015 06:26:17 +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 1aD4jA-0004BV-4U; Sun, 27 Dec 2015 06:22:48 +0000 Received: from mail-pf0-x22e.google.com ([2607:f8b0:400e:c00::22e]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aD4iu-00046f-OZ for linux-arm-kernel@lists.infradead.org; Sun, 27 Dec 2015 06:22:35 +0000 Received: by mail-pf0-x22e.google.com with SMTP id 65so53118489pff.3 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=HW84xpUsZ2l0vzL5xUJJVIwxWWet+aRC+ITB/dBIz3eq4OA/IySgZLbLKuIvX45LNz nUSvsou+arNgUBYVwpixB6foWcILbxwKkKzGG9RyzE0+B3HJUHXQf98CwnZvanMYBbnY KeI7Ea1a5DKFhTPLix/Ze9FDmihDccEuPeEWx350qRpHoMxSlrEX090Z2dBj6y9qLEVJ YDoMizXNUBLEzrcAZceLY3J4BpsN1EEO0KXBYyqceFOx0RdvHb1E0krEJgeJKwfaR6V6 A6hULMsWj+y/xpZGlB4Tlvy2tnMT7sroResdFi1fkTl7srCcHEcNyLjN2lTDMEvpVL57 bgPg== X-Gm-Message-State: ALoCoQmE14f3HTBQf1iUPsgR6dwLIUqTpVA3l6fM78dUy/ojS6+qiVUMN/dyl0uewnYjBvJjhxqFQQupeC7i9qaA4kCyZJLdZA== 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151226_222232_966226_371F328C X-CRM114-Status: GOOD ( 13.80 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, Michael Turquette , Daniel Kurtz , linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org 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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,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 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 Acked-by: Viresh Kumar --- drivers/cpufreq/mt8173-cpufreq.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) 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)