From patchwork Fri Sep 11 12:02:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 53459 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by patches.linaro.org (Postfix) with ESMTPS id E295D215BF for ; Fri, 11 Sep 2015 12:04:18 +0000 (UTC) Received: by wicgb1 with SMTP id gb1sf17734121wic.3 for ; Fri, 11 Sep 2015 05:04:18 -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=YxnWVcTigBob6F29SdvkV70V4TZUfJL1n0SNQVzqFyg=; b=gyZ/1sUM/474AIdM8Esq9y9faegoMGHJaJhgiThza8gbpnEApjcBHrSb5gnUeHwzpW gl/JSQWTMezJ1OhOsyF1GxeAQ7AVNIZrHqFSG1WHi5ag9Sz+bTJ+f1oJrEajsCo7/+91 FsZTzuuGz4loWcjf3vXwEj9FkwKo4r+eaP+Z/59BjZ3918E9TrAbp5ia/5w0daE9/jGx nbdgJJVZHtn6iZN7GbbN3ITNzwFjtYmVpdk7yyJ+0gBc43m2cHgSYy9NvIR3basMrv9i R7InttmDIODrnYhjm2OEIcTFZf/D2x1P2XFNleOOdSP1ZfizA7Sugf3IQl5cREyiK7Ut rilA== X-Gm-Message-State: ALoCoQnSTT9GpY/Utp7EbAHkJjynmSujKw+5zKZYOdNBVqUwGcwqDjL2Y6RxoKCXD6Jsm3R3TTwc X-Received: by 10.112.78.101 with SMTP id a5mr11412371lbx.9.1441973058237; Fri, 11 Sep 2015 05:04:18 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.224.129 with SMTP id rc1ls319500lac.6.gmail; Fri, 11 Sep 2015 05:04:18 -0700 (PDT) X-Received: by 10.112.156.137 with SMTP id we9mr41393742lbb.110.1441973058057; Fri, 11 Sep 2015 05:04:18 -0700 (PDT) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com. [209.85.215.47]) by mx.google.com with ESMTPS id db5si15661lac.117.2015.09.11.05.04.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Sep 2015 05:04:18 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) client-ip=209.85.215.47; Received: by lahg1 with SMTP id g1so16322853lah.1 for ; Fri, 11 Sep 2015 05:04:18 -0700 (PDT) X-Received: by 10.152.18.133 with SMTP id w5mr31211842lad.72.1441973057933; Fri, 11 Sep 2015 05:04:17 -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.59.35 with SMTP id w3csp1545721lbq; Fri, 11 Sep 2015 05:04:02 -0700 (PDT) X-Received: by 10.50.47.81 with SMTP id b17mr13251431ign.39.1441973040051; Fri, 11 Sep 2015 05:04:00 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x3si173583igl.3.2015.09.11.05.03.59; Fri, 11 Sep 2015 05:04:00 -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 S1753246AbbIKMD4 (ORCPT + 28 others); Fri, 11 Sep 2015 08:03:56 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:34337 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752168AbbIKMDx (ORCPT ); Fri, 11 Sep 2015 08:03:53 -0400 Received: by padhy16 with SMTP id hy16so73645285pad.1 for ; Fri, 11 Sep 2015 05:03:53 -0700 (PDT) X-Received: by 10.67.6.73 with SMTP id cs9mr85958379pad.130.1441973033251; Fri, 11 Sep 2015 05:03:53 -0700 (PDT) Received: from localhost ([122.171.186.190]) by smtp.gmail.com with ESMTPSA id gs2sm80831pbc.15.2015.09.11.05.03.52 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 11 Sep 2015 05:03:52 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , nm@ti.com, sboyd@codeaurora.org Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, rob.herring@linaro.org, lee.jones@linaro.org, Viresh Kumar , Bartlomiej Zolnierkiewicz , Dmitry Torokhov , Greg Kroah-Hartman , Len Brown , linux-kernel@vger.kernel.org (open list), Pavel Machek Subject: [PATCH 11/16] PM / OPP: Introduce dev_pm_opp_get_max_transition_latency() Date: Fri, 11 Sep 2015 17:32:07 +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.215.47 as permitted sender) smtp.mailfrom=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: , In few use cases (like: cpufreq), it is desired to get the maximum latency for changing OPPs. Add support for that. Signed-off-by: Viresh Kumar --- drivers/base/power/opp/core.c | 17 +++++++++++++++++ include/linux/pm_opp.h | 6 ++++++ 2 files changed, 23 insertions(+) diff --git a/drivers/base/power/opp/core.c b/drivers/base/power/opp/core.c index e272e738a8d0..d0678e804a75 100644 --- a/drivers/base/power/opp/core.c +++ b/drivers/base/power/opp/core.c @@ -285,6 +285,23 @@ unsigned long dev_pm_opp_get_max_volt_latency(struct device *dev) EXPORT_SYMBOL_GPL(dev_pm_opp_get_max_volt_latency); /** + * dev_pm_opp_get_max_transition_latency() - Get max transition latency in + * nanoseconds + * @dev: device for which we do this operation + * + * Return: This function returns the max transition latency, in nanoseconds, to + * switch from one OPP to other. + * + * Locking: This function takes rcu_read_lock(). + */ +unsigned long dev_pm_opp_get_max_transition_latency(struct device *dev) +{ + return dev_pm_opp_get_max_volt_latency(dev) + + dev_pm_opp_get_max_clock_latency(dev); +} +EXPORT_SYMBOL_GPL(dev_pm_opp_get_max_transition_latency); + +/** * dev_pm_opp_get_suspend_opp() - Get suspend opp * @dev: device for which we do this operation * diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h index fd58e2074721..e36f347ff32b 100644 --- a/include/linux/pm_opp.h +++ b/include/linux/pm_opp.h @@ -35,6 +35,7 @@ bool dev_pm_opp_is_turbo(struct dev_pm_opp *opp); int dev_pm_opp_get_opp_count(struct device *dev); unsigned long dev_pm_opp_get_max_clock_latency(struct device *dev); unsigned long dev_pm_opp_get_max_volt_latency(struct device *dev); +unsigned long dev_pm_opp_get_max_transition_latency(struct device *dev); struct dev_pm_opp *dev_pm_opp_get_suspend_opp(struct device *dev); struct dev_pm_opp *dev_pm_opp_find_freq_exact(struct device *dev, @@ -87,6 +88,11 @@ static inline unsigned long dev_pm_opp_get_max_volt_latency(struct device *dev) return 0; } +static inline unsigned long dev_pm_opp_get_max_transition_latency(struct device *dev) +{ + return 0; +} + static inline struct dev_pm_opp *dev_pm_opp_get_suspend_opp(struct device *dev) { return NULL;