From patchwork Fri Feb 7 15:55:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Abraham X-Patchwork-Id: 3606291 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6A4E39F2E9 for ; Fri, 7 Feb 2014 15:57:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 91FDF2012F for ; Fri, 7 Feb 2014 15:57:49 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (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 9866E2012B for ; Fri, 7 Feb 2014 15:57:48 +0000 (UTC) Received: from merlin.infradead.org ([205.233.59.134]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WBnns-0008EB-RB; Fri, 07 Feb 2014 15:57:21 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WBnnk-0006g8-B1; Fri, 07 Feb 2014 15:57:12 +0000 Received: from mail-pd0-x22c.google.com ([2607:f8b0:400e:c02::22c]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WBnnb-0006eL-MS for linux-arm-kernel@lists.infradead.org; Fri, 07 Feb 2014 15:57:05 +0000 Received: by mail-pd0-f172.google.com with SMTP id p10so3293011pdj.17 for ; Fri, 07 Feb 2014 07:56:42 -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:in-reply-to:references; bh=4y5u83U/dN6NkUusEdv0lgDXer+eELJgwwzliPycBrc=; b=p1FXpMlkrJrS8JHDmS4uR5GEru0OWRHGbcYxYNsaXq5fcVqqBqZzJYbx7UTUC+7TRe XE2Jcuksay65f++RnCZoe9BJjzKAqG9+ueOsItUmmHqYariZysPuzx1C4LXukJYRhEIe ZF9Uhf2J5CRb8eWtr1ElDixCGGvJs+GglAD298EcjezOrO5OU/Vax3uhJKRmP8YJ9gNv nThqNfDD8VdKEeaPITS9Vxk1YQBeIz7Imm98Q0beS1o3UAYCnE4ptuJX83vcqBvAphNl wsF5U42Vg+2nyBeqSqXIhmj5NzpDCvHdXIjMdSR97hA5CHbzsAZGvEpA/30yWf4pJTLi UjrA== X-Received: by 10.68.241.198 with SMTP id wk6mr20642473pbc.11.1391788602205; Fri, 07 Feb 2014 07:56:42 -0800 (PST) Received: from user-ubuntu.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPSA id qq5sm14869232pbb.24.2014.02.07.07.56.37 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 07 Feb 2014 07:56:41 -0800 (PST) From: Thomas Abraham To: cpufreq@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 1/7] cpufreq: cpufreq-cpu0: allow use of optional boost mode frequencies Date: Fri, 7 Feb 2014 21:25:42 +0530 Message-Id: <1391788548-13056-2-git-send-email-thomas.ab@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1391788548-13056-1-git-send-email-thomas.ab@samsung.com> References: <1391788548-13056-1-git-send-email-thomas.ab@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140207_105703_875452_A16237E8 X-CRM114-Status: GOOD ( 12.32 ) X-Spam-Score: -2.0 (--) Cc: l.majewski@samsung.com, kgene.kim@samsung.com, mturquette@linaro.org, heiko@sntech.de, viresh.kumar@linaro.org, t.figa@samsung.com, linux-samsung-soc@vger.kernel.org, thomas.ab@samsung.com, shawn.guo@linaro.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 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.6 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, KHOP_BIG_TO_CC, 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 From: Thomas Abraham Lookup for the optional boost-frequency property in cpu0 node and if available, enable support for boost mode frequencies. The frequencies usable in boost mode are determined while preparing the cpufreq table from the list of operating points available. In addition to this, enable the CPU_FREQ_BOOST_SW config option for this driver by default. On platforms that do not support boost mode, the boost mode frequencies will not be specified in cpu0 node and hence the boost mode support will not be enabled. Since this driver anyways depends on THERMAL config option, it is safe to enable CPU_FREQ_BOOST_SW config option as default. Cc: Shawn Guo Cc: Lukasz Majewski Signed-off-by: Thomas Abraham --- Documentation/devicetree/bindings/cpufreq/cpufreq-cpu0.txt | 2 ++ drivers/cpufreq/Kconfig | 1 + drivers/cpufreq/cpufreq-cpu0.c | 3 +++ 3 files changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/cpufreq/cpufreq-cpu0.txt b/Documentation/devicetree/bindings/cpufreq/cpufreq-cpu0.txt index f055515..60f321a 100644 --- a/Documentation/devicetree/bindings/cpufreq/cpufreq-cpu0.txt +++ b/Documentation/devicetree/bindings/cpufreq/cpufreq-cpu0.txt @@ -19,6 +19,8 @@ Optional properties: - cooling-min-level: - cooling-max-level: Please refer to Documentation/devicetree/bindings/thermal/thermal.txt. +- boost-frequency: + Please refer to Documentation/devicetree/bindings/cpufreq/cpufreq-boost.txt Examples: diff --git a/drivers/cpufreq/Kconfig b/drivers/cpufreq/Kconfig index 4b029c0..52cc704 100644 --- a/drivers/cpufreq/Kconfig +++ b/drivers/cpufreq/Kconfig @@ -187,6 +187,7 @@ config GENERIC_CPUFREQ_CPU0 tristate "Generic CPU0 cpufreq driver" depends on HAVE_CLK && REGULATOR && OF && THERMAL && CPU_THERMAL select PM_OPP + select CPU_FREQ_BOOST_SW help This adds a generic cpufreq driver for CPU0 frequency management. It supports both uniprocessor (UP) and symmetric multiprocessor (SMP) diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c index 0c12ffc..06539eb 100644 --- a/drivers/cpufreq/cpufreq-cpu0.c +++ b/drivers/cpufreq/cpufreq-cpu0.c @@ -195,6 +195,9 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev) transition_latency += ret * 1000; } + if (of_find_property(cpu_dev->of_node, "boost-frequency", NULL)) + cpu0_cpufreq_driver.boost_supported = true; + ret = cpufreq_register_driver(&cpu0_cpufreq_driver); if (ret) { pr_err("failed register driver: %d\n", ret);