From patchwork Wed May 14 01:11:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Abraham X-Patchwork-Id: 4171841 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 09312BFF02 for ; Wed, 14 May 2014 01:17:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 395D02017D for ; Wed, 14 May 2014 01:17:00 +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 15F212016C for ; Wed, 14 May 2014 01:16:59 +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 1WkNlf-0001Na-9y; Wed, 14 May 2014 01:13:59 +0000 Received: from mail-pb0-x22f.google.com ([2607:f8b0:400e:c01::22f]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WkNk8-0008JW-C0 for linux-arm-kernel@lists.infradead.org; Wed, 14 May 2014 01:12:24 +0000 Received: by mail-pb0-f47.google.com with SMTP id un15so944521pbc.6 for ; Tue, 13 May 2014 18:12:03 -0700 (PDT) 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=v1RT4ePQBYZrmeBG1yy1JgeKOVI41qfUV+AYrI0m0fA=; b=RiuFnUUTRzol8hzjxpI0sVik6UftUuUfNIyc5qXheCcd2/UFuuoDLnbrGkV+gVYzRJ bgBmR2BhsgaS3FaSveIktdlu7vyWS/uLAkLK9yR9cFoQriuf6aHnE40Y8qvEDFtK+oWc OzohnxA3ysn38S1XpR3ekBuws7y7zo95zrg+grJ6wpncM+Gn707b16EKcj/P1WcJNoCY UG2mZOfKNAvyCetvWWuW2lSOGV1pYfGantUaJay1jZgRZj1naQYu8NDWKdw1z30SRHcv V9L9xV/z/sDkA+KUQv07FTGJLPPJp558aKYMLPv4Pe7ebK6wxO+rJLRbHujEcFIj0Nb3 lyhQ== X-Received: by 10.66.122.36 with SMTP id lp4mr541715pab.82.1400029923556; Tue, 13 May 2014 18:12:03 -0700 (PDT) Received: from localhost.localdomain ([117.213.250.141]) by mx.google.com with ESMTPSA id tg9sm303528pbc.29.2014.05.13.18.11.52 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 13 May 2014 18:12:02 -0700 (PDT) X-Google-Original-From: Thomas Abraham From: Thomas Abraham To: cpufreq@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 1/8] cpufreq: cpufreq-cpu0: allow use of optional boost mode frequencies Date: Wed, 14 May 2014 06:41:09 +0530 Message-Id: <1400029876-5830-2-git-send-email-thomas.ab@samsung.com> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1400029876-5830-1-git-send-email-thomas.ab@samsung.com> References: <1400029876-5830-1-git-send-email-thomas.ab@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140513_181224_469343_3FE471BB X-CRM114-Status: GOOD ( 13.64 ) X-Spam-Score: -0.1 (/) Cc: devicetree@vger.kernel.org, l.majewski@samsung.com, kgene.kim@samsung.com, mturquette@linaro.org, heiko@sntech.de, viresh.kumar@linaro.org, t.figa@samsung.com, rjw@rjwysocki.net, 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=-2.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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. Cc: Shawn Guo Cc: Lukasz Majewski Signed-off-by: Thomas Abraham --- .../devicetree/bindings/cpufreq/cpufreq-cpu0.txt | 2 ++ drivers/cpufreq/Kconfig | 11 +++++++++++ drivers/cpufreq/cpufreq-cpu0.c | 5 +++++ 3 files changed, 18 insertions(+), 0 deletions(-) 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 1fbe11f..0ca4485 100644 --- a/drivers/cpufreq/Kconfig +++ b/drivers/cpufreq/Kconfig @@ -194,6 +194,17 @@ config GENERIC_CPUFREQ_CPU0 If in doubt, say N. +config GENERIC_CPUFREQ_CPU0_BOOST + bool "Boost frequency support for generic CPU0 cpufreq driver" + depends on GENERIC_CPUFREQ_CPU0 + select CPU_FREQ_BOOST_SW + help + This enables support for software managed overclocking (BOOST). It + allows usage of special frequencies (those beyond the normal operating + frequencies). + + If in doubt, say N. + menu "x86 CPU frequency scaling drivers" depends on X86 source "drivers/cpufreq/Kconfig.x86" diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c index 1bf6bba..e6c21a8 100644 --- a/drivers/cpufreq/cpufreq-cpu0.c +++ b/drivers/cpufreq/cpufreq-cpu0.c @@ -194,6 +194,11 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev) transition_latency += ret * 1000; } +#ifdef CONFIG_GENERIC_CPUFREQ_CPU0_BOOST + if (of_find_property(cpu_dev->of_node, "boost-frequency", NULL)) + cpu0_cpufreq_driver.boost_supported = true; +#endif + ret = cpufreq_register_driver(&cpu0_cpufreq_driver); if (ret) { pr_err("failed register driver: %d\n", ret);