From patchwork Wed Jul 29 10:53:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 51644 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by patches.linaro.org (Postfix) with ESMTPS id DB46722DB5 for ; Wed, 29 Jul 2015 10:54:46 +0000 (UTC) Received: by lbcjj5 with SMTP id jj5sf2504848lbc.1 for ; Wed, 29 Jul 2015 03:54:45 -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=EIOIeN5jpehj3FFgdNDVqYm6gTI/3uGF29oE8n73TIg=; b=SXqgw0FmIJGwRc58cRXxOhBAR4KXbLnEwwxWuRtoHdNG5B39ZrnZHiXdtJ+09Ce8Rg jWzax6YL1I77KcCXVexR33YpG9sxwXqI4xOpw08zV9fRm0afZPbnQwEckuutJ3QlTfgi 0Cn+b1PEr6EYl7twqEegenenEThgQQ9JZVihLqdbMV6wRdgFjbiGghCezJbE7VS+qYfv h+AYWeEML1ysZ/zQx4LMEndXhIskybaudLqntclHSq3c40ocQFgf52XsTTfJhBODrh5F JWkoKqhW/TaattYP827EQgt+iHPKeP6hN8XDTWH7Vdk6dL+81cFrwOJ6SbsJ+P+Q/JsQ mANQ== X-Gm-Message-State: ALoCoQncLH6haGnfb0PwqhlDd88L94NFPONqtVVoxh+U5hmUy5MV1TXGSv86YksB/76SdZf5K16U X-Received: by 10.194.60.73 with SMTP id f9mr15779873wjr.6.1438167285830; Wed, 29 Jul 2015 03:54:45 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.21.200 with SMTP id x8ls29574lae.10.gmail; Wed, 29 Jul 2015 03:54:45 -0700 (PDT) X-Received: by 10.152.10.72 with SMTP id g8mr37624170lab.97.1438167285504; Wed, 29 Jul 2015 03:54:45 -0700 (PDT) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com. [209.85.217.180]) by mx.google.com with ESMTPS id n14si21199941laa.83.2015.07.29.03.54.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Jul 2015 03:54:45 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) client-ip=209.85.217.180; Received: by lblf12 with SMTP id f12so4249118lbl.2 for ; Wed, 29 Jul 2015 03:54:45 -0700 (PDT) X-Received: by 10.152.36.161 with SMTP id r1mr37769983laj.88.1438167285401; Wed, 29 Jul 2015 03:54:45 -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 l6csp2675940lba; Wed, 29 Jul 2015 03:54:44 -0700 (PDT) X-Received: by 10.70.34.207 with SMTP id b15mr92210384pdj.151.1438167283382; Wed, 29 Jul 2015 03:54:43 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y5si60902025par.87.2015.07.29.03.54.42; Wed, 29 Jul 2015 03:54:43 -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 S1753056AbbG2Ky3 (ORCPT + 27 others); Wed, 29 Jul 2015 06:54:29 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:35062 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752984AbbG2Ky0 (ORCPT ); Wed, 29 Jul 2015 06:54:26 -0400 Received: by pabkd10 with SMTP id kd10so3952523pab.2 for ; Wed, 29 Jul 2015 03:54:26 -0700 (PDT) X-Received: by 10.66.176.202 with SMTP id ck10mr82717539pac.15.1438167266134; Wed, 29 Jul 2015 03:54:26 -0700 (PDT) Received: from localhost ([122.171.186.190]) by smtp.gmail.com with ESMTPSA id ow5sm1592189pdb.30.2015.07.29.03.54.24 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 29 Jul 2015 03:54:25 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , sboyd@codeaurora.org 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, 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 V3 10/16] PM / OPP: Add support for opp-suspend Date: Wed, 29 Jul 2015 16:23:05 +0530 Message-Id: <3d1b8d7de9f2ad34d979540e367ed691bcb7bb77.1438166099.git.viresh.kumar@linaro.org> 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.180 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. Reviewed-by: Bartlomiej Zolnierkiewicz 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 5d699e3ec136..0ebcea49145a 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; }; /* @@ -923,6 +924,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;