Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6499301ybi; Mon, 8 Jul 2019 04:03:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqy8ZWzm40ETiQm7AGOHcAmXQwDdR2Le4w3C7HandjHUdljIZ3sSdpDkho6BjHIsx4ybQFiw X-Received: by 2002:a63:224a:: with SMTP id t10mr22645428pgm.289.1562583822106; Mon, 08 Jul 2019 04:03:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562583822; cv=none; d=google.com; s=arc-20160816; b=XPUSpufDYzIp5WnklNvN4ZG1VDM71IWB306MVYZcjZtM597yjsIvsUAFlM76Y437X4 bY7JUPzlrDg3zKHA8ViZ77fkebLkSiUMvMovJeU9x+aDCkOmEvClR1JMpuWE85WsEcBj 1LEL/1VrlrRa9OFsQVXXll1SYrAMtguAEz+sn5pkLhfM8xeWHYWLRKaJmtSW44G4ixHU 7KGPz/9QjQAA9tv4fjJzVFL7ohCaE5tGGXpY7U0qEzZFzAlo8lRfx1CDQ8QkYOJAllE1 aoY1nk4KzMNhOnsj4sSFuK3QnqPsGeMVTOAVci2VFe7+xqOPlyuzpMcwjqGAa+KlmkMT gOTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=g24kvWtLTj/hko63jIdAWTPxKQzs4KkrjJyeyo41qoA=; b=bGR446FrR40A7lLHM0UjaN++VefgX255MPiUz9bpnO7GirBR5FG24HJnG7JjM2EA8f 5GyrT247gyBSoAyti+sS671670ez7a/pLwxjLWesuG9KI7lY2cRv0NaRnm2UTZnYHxDf K3ilnpLbyVjWrulQathvCN6t1gMokvG4u81QisnR7SakrgjrExydfZrfcvra+DtFXWzJ a/CVaAIrBP7ydLP8r9lBIDmGD3UD2BPJQjlvrmh4tqnmyap9jWz6gz/ZhLst+VmoUD63 XQ4r2mVyAP9+tXCQHf+do+LUyUo8hddaKIuDkRukKkn1j4UzkWkrC7Ei4fDSicFSBLef WGSA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 64si17726156plw.37.2019.07.08.04.03.26; Mon, 08 Jul 2019 04:03:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727543AbfGHHzk (ORCPT + 99 others); Mon, 8 Jul 2019 03:55:40 -0400 Received: from inva020.nxp.com ([92.121.34.13]:47222 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725836AbfGHHzk (ORCPT ); Mon, 8 Jul 2019 03:55:40 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 66E7E1A0136; Mon, 8 Jul 2019 09:55:39 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 223641A0238; Mon, 8 Jul 2019 09:55:34 +0200 (CEST) Received: from titan.ap.freescale.net (TITAN.ap.freescale.net [10.192.208.233]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 6C55B402DB; Mon, 8 Jul 2019 15:55:27 +0800 (SGT) From: Anson.Huang@nxp.com To: rjw@rjwysocki.net, viresh.kumar@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Linux-imx@nxp.com Subject: [PATCH] cpufreq: imx-cpufreq-dt: Assign max supported frequency as suspend frequency Date: Mon, 8 Jul 2019 15:46:24 +0800 Message-Id: <20190708074624.910-1-Anson.Huang@nxp.com> X-Mailer: git-send-email 2.14.1 X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Anson Huang To reduce the suspend/resume latency, CPU's max supported frequency should be used during low level suspend/resume phase, "opp-suspend" property is NOT feasible since OPP defined in DT could be NOT supported according to speed garding and market segment fuse settings. So we can assign the cpufreq policy's suspend_freq with max available frequency provided by cpufreq driver. Signed-off-by: Anson Huang --- drivers/cpufreq/imx-cpufreq-dt.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/cpufreq/imx-cpufreq-dt.c b/drivers/cpufreq/imx-cpufreq-dt.c index 4f85f31..b6607e8 100644 --- a/drivers/cpufreq/imx-cpufreq-dt.c +++ b/drivers/cpufreq/imx-cpufreq-dt.c @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -84,6 +85,16 @@ static int imx_cpufreq_dt_remove(struct platform_device *pdev) return 0; } +static int __init imx_cpufreq_dt_setup_suspend_opp(void) +{ + struct cpufreq_policy *policy = cpufreq_cpu_get(0); + + policy->suspend_freq = cpufreq_quick_get_max(0); + + return 0; +} +late_initcall(imx_cpufreq_dt_setup_suspend_opp); + static struct platform_driver imx_cpufreq_dt_driver = { .probe = imx_cpufreq_dt_probe, .remove = imx_cpufreq_dt_remove, -- 2.7.4