From patchwork Mon Dec 19 02:16:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Jakobi X-Patchwork-Id: 9479609 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A81D260838 for ; Mon, 19 Dec 2016 02:18:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 97EAE28456 for ; Mon, 19 Dec 2016 02:18:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8CC8C2845B; Mon, 19 Dec 2016 02:18:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 330EC28459 for ; Mon, 19 Dec 2016 02:18:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762057AbcLSCSY (ORCPT ); Sun, 18 Dec 2016 21:18:24 -0500 Received: from smtp.math.uni-bielefeld.de ([129.70.45.10]:43825 "EHLO smtp.math.uni-bielefeld.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761849AbcLSCSX (ORCPT ); Sun, 18 Dec 2016 21:18:23 -0500 Received: from chidori.lan (unknown [5.146.177.82]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client did not present a certificate) by smtp.math.uni-bielefeld.de (Postfix) with ESMTPSA id 7A0BD5F85C; Mon, 19 Dec 2016 03:18:20 +0100 (CET) From: Tobias Jakobi To: linux-samsung-soc@vger.kernel.org Cc: linux-pm@vger.kernel.org, m.reichl@fivetechno.de, myungjoo.ham@gmail.com, cw00.choi@samsung.com, Tobias Jakobi Subject: [RFC v2 5/7] PM / devfreq: exynos-bus: add support for suspend OPP Date: Mon, 19 Dec 2016 03:16:25 +0100 Message-Id: <1482113787-28422-6-git-send-email-tjakobi@math.uni-bielefeld.de> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1482113787-28422-1-git-send-email-tjakobi@math.uni-bielefeld.de> References: <1482113787-28422-1-git-send-email-tjakobi@math.uni-bielefeld.de> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Set the frequency of the suspend OPP, so that DevFreq core can use it during system sleep/reboot/power-off. Signed-off-by: Tobias Jakobi --- drivers/devfreq/exynos-bus.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c index 29866f7..16fb37a 100644 --- a/drivers/devfreq/exynos-bus.c +++ b/drivers/devfreq/exynos-bus.c @@ -389,6 +389,7 @@ static int exynos_bus_probe(struct platform_device *pdev) struct devfreq_passive_data *passive_data; struct devfreq *parent_devfreq; struct exynos_bus *bus; + struct dev_pm_opp *suspend_opp; int ret, max_state; unsigned long min_freq, max_freq; @@ -449,6 +450,13 @@ static int exynos_bus_probe(struct platform_device *pdev) goto err; } + /* Check for suspend OPP and store the corresponding frequency. */ + rcu_read_lock(); + suspend_opp = dev_pm_opp_get_suspend_opp(dev); + if (suspend_opp) + bus->devfreq->suspend_freq = dev_pm_opp_get_freq(suspend_opp); + rcu_read_unlock(); + /* Register opp_notifier to catch the change of OPP */ ret = devm_devfreq_register_opp_notifier(dev, bus->devfreq); if (ret < 0) {