From patchwork Wed Sep 2 16:47:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 7113201 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 E1989BEEC1 for ; Wed, 2 Sep 2015 16:50:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 079CE203E5 for ; Wed, 2 Sep 2015 16:50:50 +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 127BE203C3 for ; Wed, 2 Sep 2015 16:50:49 +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 1ZXBDU-00084A-Uc; Wed, 02 Sep 2015 16:48:56 +0000 Received: from mailout1.samsung.com ([203.254.224.24]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZXBDR-0007yD-Pl for linux-arm-kernel@lists.infradead.org; Wed, 02 Sep 2015 16:48:54 +0000 Received: from epcpsbgm1new.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NU201ULY6OV4T70@mailout1.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 03 Sep 2015 01:48:31 +0900 (KST) X-AuditID: cbfee61a-f79a06d000005c6f-7c-55e7285f1822 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id BE.5B.23663.F5827E55; Thu, 3 Sep 2015 01:48:31 +0900 (KST) Received: from AMDC1976.DIGITAL.local ([106.120.53.102]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NU2007926OIAV40@mmp2.samsung.com>; Thu, 03 Sep 2015 01:48:30 +0900 (KST) From: Bartlomiej Zolnierkiewicz To: Thomas Abraham , Kukjin Kim , Kukjin Kim , Viresh Kumar , Krzysztof Kozlowski , Marek Szyprowski Subject: [PATCH v2] cpufreq-dt: add suspend frequency support Date: Wed, 02 Sep 2015 18:47:56 +0200 Message-id: <1441212476-21316-1-git-send-email-b.zolnierkie@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrHLMWRmVeSWpSXmKPExsVy+t9jQd14jeehBn/fKlhsnLGe1eL6l+es Fv8fvWa1ePN2DZPF6xeGFr0LrrJZ9D9+zWzx9fAKRos3DzczWmx6fI3V4mPPPVaLy7vmsFl8 7j3CaDHj/D4mi3Ubb7FbrD1yl93i4ilXi8Nv2lktOpYxWrSt/sBqsWrXH0aLjV89HMQ83t9o ZffYOesuu8emVZ1sHneu7WHz2Lyk3uPfMXaPLf1A4b4tqxg9tl+bx+zxeZNcAFcUl01Kak5m WWqRvl0CV8bM7yvZCnbzVvx6+I21gXENdxcjB4eEgInE1xViXYycQKaYxIV769m6GLk4hARm MUo8OLSAHcL5xShxdec9VpAqNgEriYntqxhBEiIC3xklvk7fBdbCLPCMRaL1XTdYlbCArcS7 O8sZQWwWAVWJrXveMYPYvAIeEu8Wn2CE2CcncfLYZNYJjNwLGBlWMUqkFiQXFCel5xrmpZbr FSfmFpfmpesl5+duYgSH+jOpHYwHd7kfYhTgYFTi4W1IfBYqxJpYVlyZe4hRgoNZSYQ36B9Q iDclsbIqtSg/vqg0J7X4EKM0B4uSOK/sSqCUQHpiSWp2ampBahFMlomDU6qB8fSa4ENzY89s EpWpX+22vnneMpXLh8RsZj9h6bmrZ1zGdkP68bGZ6oq3bk/ieJdktmrLs31GEy2jGe4uO5z1 5s1a7T37GsrMtx3dUq6b2rLSnv0Gi6/Xmugd7ZeKnFYe8FKb8vKFqD/X/TWfPxgY3zxz7cov jfhEcx2/5lP1EeVpXskPojYZTlViKc5INNRiLipOBADbQ8ZHcQIAAA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150902_094853_985890_BEF24335 X-CRM114-Status: GOOD ( 14.95 ) X-Spam-Score: -6.9 (------) 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: Lukasz Majewski , Kevin Hilman , Heiko Stuebner , Javier Martinez Canillas , Anand Moon , Michael Turquette , linux-pm@vger.kernel.org, Tomasz Figa , linux-kernel@vger.kernel.org, Chanwoo Choi , b.zolnierkie@samsung.com, Tobias Jakobi , linux-arm-kernel@lists.infradead.org, Sylwester Nawrocki , linux-clk@vger.kernel.org, linux-samsung-soc@vger.kernel.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.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, 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 Add suspend frequency support and set it to the boot frequency, this matches what the old exynos-cpufreq driver has been doing. This patch fixes suspend/resume support on Exynos4412 based Trats2 board and reboot hang on Exynos4412 based Odroid U3 board. Cc: Viresh Kumar Cc: Thomas Abraham Cc: Javier Martinez Canillas Cc: Krzysztof Kozlowski Cc: Marek Szyprowski Cc: Tobias Jakobi Signed-off-by: Bartlomiej Zolnierkiewicz --- This patch supersedes "[PATCH] ARM: dts: exynos4412-odroid-*: add workaround for CPUfreq/reboot issue" one from yesterday. v2: - remove superfluous ";" drivers/cpufreq/cpufreq-dt.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c index c3583cd..c9138c7 100644 --- a/drivers/cpufreq/cpufreq-dt.c +++ b/drivers/cpufreq/cpufreq-dt.c @@ -329,6 +329,10 @@ static int cpufreq_init(struct cpufreq_policy *policy) policy->driver_data = priv; policy->clk = cpu_clk; + + /* capture boot frequency */ + policy->suspend_freq = clk_get_rate(cpu_clk) / 1000; + ret = cpufreq_table_validate_and_show(policy, freq_table); if (ret) { dev_err(cpu_dev, "%s: invalid frequency table: %d\n", __func__, @@ -419,6 +423,9 @@ static struct cpufreq_driver dt_cpufreq_driver = { .ready = cpufreq_ready, .name = "cpufreq-dt", .attr = cpufreq_dt_attr, +#ifdef CONFIG_PM + .suspend = cpufreq_generic_suspend, +#endif }; static int dt_cpufreq_probe(struct platform_device *pdev)