From patchwork Mon Jul 27 05:02:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 51489 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by patches.linaro.org (Postfix) with ESMTPS id EB6D8214B7 for ; Mon, 27 Jul 2015 05:04:28 +0000 (UTC) Received: by laef2 with SMTP id f2sf23652794lae.0 for ; Sun, 26 Jul 2015 22:04:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:in-reply-to:references :sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=ECdd4b2DJvzDedkBUPeaolDdP60Tt3q77nevjZf6cPo=; b=IqVgnZ/XVxcWV8k1L7uNgFT8jRbA029GL3S1rDYrT/ookD3yuTLDBkfTSa4Tf6NuVi TRXO5wxugzwWT0SNHZ7bHudhuKpCX7uxhTExiD7N/BKCdYr8psmMXLZQ66H5oBhVGtA3 5k+niA/Xowcf/EoNY9jUHns4rWs+dR7bwUtVbsS4NvXFXJTRdP519ioFs2fV7lkqh7Zq uFgB0AsHJ+UDqhisEcIBlEt30hm/P6KCYkTh4JL1NquztAcudcW2ni+DGkHSSG5EsbEM R3Gd9RaOz5KO++gVOx1N0ksdLrVXjVK3qQTgewcto/jfnEqO9ExWBt4Fjf1GUesUo0xR bk9g== X-Gm-Message-State: ALoCoQmlccm3oJaZKXj4f986FScBd40i6cBFoqMjCtwvJhMLwjGqA2mZGTGaBhruPzNLAAPFTygw X-Received: by 10.113.11.3 with SMTP id ee3mr11458036lbd.9.1437973467931; Sun, 26 Jul 2015 22:04:27 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.180.232 with SMTP id dr8ls612847lac.9.gmail; Sun, 26 Jul 2015 22:04:27 -0700 (PDT) X-Received: by 10.112.212.33 with SMTP id nh1mr25077096lbc.114.1437973467764; Sun, 26 Jul 2015 22:04:27 -0700 (PDT) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com. [209.85.217.169]) by mx.google.com with ESMTPS id jv4si13612541lab.101.2015.07.26.22.04.27 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 26 Jul 2015 22:04:27 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) client-ip=209.85.217.169; Received: by lblf12 with SMTP id f12so45734969lbl.2 for ; Sun, 26 Jul 2015 22:04:27 -0700 (PDT) X-Received: by 10.152.37.228 with SMTP id b4mr25065120lak.117.1437973467323; Sun, 26 Jul 2015 22:04:27 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.7.198 with SMTP id l6csp1314950lba; Sun, 26 Jul 2015 22:04:26 -0700 (PDT) X-Received: by 10.50.178.133 with SMTP id cy5mr13348059igc.5.1437973465793; Sun, 26 Jul 2015 22:04:25 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fm4si39453142pab.148.2015.07.26.22.04.24; Sun, 26 Jul 2015 22:04:25 -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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753458AbbG0FEH (ORCPT + 28 others); Mon, 27 Jul 2015 01:04:07 -0400 Received: from mail-pd0-f180.google.com ([209.85.192.180]:36103 "EHLO mail-pd0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753252AbbG0FEA (ORCPT ); Mon, 27 Jul 2015 01:04:00 -0400 Received: by pdjr16 with SMTP id r16so46011494pdj.3 for ; Sun, 26 Jul 2015 22:03:59 -0700 (PDT) X-Received: by 10.70.3.98 with SMTP id b2mr64027838pdb.107.1437973439609; Sun, 26 Jul 2015 22:03:59 -0700 (PDT) Received: from localhost ([122.171.186.190]) by smtp.gmail.com with ESMTPSA id k3sm26809655pde.18.2015.07.26.22.03.58 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 26 Jul 2015 22:03:58 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, rob.herring@linaro.org, arnd.bergmann@linaro.org, nm@ti.com, broonie@kernel.org, mturquette@baylibre.com, sboyd@codeaurora.org, Sudeep.Holla@arm.com, viswanath.puttagunta@linaro.org, l.stach@pengutronix.de, thomas.petazzoni@free-electrons.com, linux-arm-kernel@lists.infradead.org, ta.omasab@gmail.com, kesavan.abhilash@gmail.com, khilman@linaro.org, santosh.shilimkar@oracle.com, b.zolnierkie@samsung.com, Viresh Kumar , Greg Kroah-Hartman , Len Brown , linux-kernel@vger.kernel.org (open list), Pavel Machek Subject: [PATCH V2 09/11] OPP: Add support for opp-suspend Date: Mon, 27 Jul 2015 10:32:39 +0530 Message-Id: X-Mailer: git-send-email 2.4.0 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , With "operating-points-v2" bindings, its possible to specify the OPP to which the device must be switched, before suspending. This patch adds support for getting that information. Signed-off-by: Viresh Kumar --- drivers/base/power/opp.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c index d6ab6af7e847..22b1e6ae7a94 100644 --- a/drivers/base/power/opp.c +++ b/drivers/base/power/opp.c @@ -133,6 +133,7 @@ struct device_opp { struct device_node *np; unsigned long clock_latency_ns_max; bool shared_opp; + struct dev_pm_opp *suspend_opp; }; /* @@ -909,6 +910,16 @@ static int _opp_add_static_v2(struct device *dev, struct device_node *np) if (ret) goto free_opp; + /* OPP to select on device suspend */ + if (of_property_read_bool(np, "opp-suspend")) { + if (dev_opp->suspend_opp) + dev_warn(dev, "%s: Multiple suspend OPPs found (%lu %lu)\n", + __func__, dev_opp->suspend_opp->rate, + new_opp->rate); + else + dev_opp->suspend_opp = new_opp; + } + if (new_opp->clock_latency_ns > dev_opp->clock_latency_ns_max) dev_opp->clock_latency_ns_max = new_opp->clock_latency_ns;