From patchwork Tue Dec 22 10:16:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 58848 Delivered-To: patch@linaro.org Received: by 10.112.89.199 with SMTP id bq7csp3139634lbb; Tue, 22 Dec 2015 02:16:44 -0800 (PST) X-Received: by 10.66.55.105 with SMTP id r9mr34370744pap.137.1450779403882; Tue, 22 Dec 2015 02:16:43 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id sw10si3585212pab.55.2015.12.22.02.16.43; Tue, 22 Dec 2015 02:16:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-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-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932658AbbLVKQm (ORCPT + 11 others); Tue, 22 Dec 2015 05:16:42 -0500 Received: from mail-pf0-f174.google.com ([209.85.192.174]:36103 "EHLO mail-pf0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932181AbbLVKQm (ORCPT ); Tue, 22 Dec 2015 05:16:42 -0500 Received: by mail-pf0-f174.google.com with SMTP id o64so104282815pfb.3 for ; Tue, 22 Dec 2015 02:16:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=Z0SEgBPr825SEIjxwtDLnqdbb2y06DZeRym5bEQVEPE=; b=kArhLhzR/Q6KgWxQWeJlKD1ErW1EZ11HE/lM+NqxIKPFMctywXxky8S3ZL5DLYOvM3 W0tBW//7MizsoHXYl/zmlE1nLQ/+JWaA1Tlchx+IpPP9k6lhtonDyeKV8iTnpHT3KNek Y1SqPrXVlB8vfduS+cIEbW2+rU73DF94UbgG8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=Z0SEgBPr825SEIjxwtDLnqdbb2y06DZeRym5bEQVEPE=; b=OZfLGOACrPi9iT7I7r8Crokel38kSFi+2MZrVVvr6qWbrXj5eN5ygIZ6/mKvScLWWd rwbDDTLAhZeEdqEyWnOdTbAS2kqg3cjBRBWdtlpjmr+hO1h640nqfeh/4G+9gYTwv9jr WNjR8uWWiJXyf2e4cB///JD7XiWpxk02NmVedy1Nj0zvWJogSOJZw8IGS7opYoec967X oQPNjfS8HHunbteHL7Y/27zX2wY8I2YA9uLr2ByKoXX44lGciQxulTZCt4Oj1cTDVw8j u3RaR4eZf68Otsb+l+8+M9EgxFamy0rh1oVwY30sGvflBDtLZwebjNuhNa7zh55HN2YX YH4w== X-Gm-Message-State: ALoCoQmK1JqnrY6jq12eyFcuu/sjn21yIZbCKwReSaqyDQZhPTJLbxxoVCoaKtFSGAeD0OfV5lpmykuAugfr9c55M46UlLRIaQ== X-Received: by 10.98.89.207 with SMTP id k76mr18334726pfj.36.1450779401981; Tue, 22 Dec 2015 02:16:41 -0800 (PST) Received: from localhost ([122.171.29.67]) by smtp.gmail.com with ESMTPSA id o2sm44938314pap.31.2015.12.22.02.16.40 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 22 Dec 2015 02:16:41 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, Stephen Boyd , nm@ti.com, Viresh Kumar Subject: [PATCH 05/17] PM / OPP: Introduce dev_pm_opp_get_max_transition_latency() Date: Tue, 22 Dec 2015 15:46:06 +0530 Message-Id: <0dd4be8d1e6dec70cd859c99bb597726317ced1e.1450777582.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.7.0.rc1.186.g94414c4 In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org 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(+) -- 2.7.0.rc1.186.g94414c4 -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/base/power/opp/core.c b/drivers/base/power/opp/core.c index bf296c459e06..5746993aa71d 100644 --- a/drivers/base/power/opp/core.c +++ b/drivers/base/power/opp/core.c @@ -279,6 +279,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 5daa43058ac1..59da3d9e11ea 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, @@ -94,6 +95,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;