From patchwork Tue Feb 9 05:00:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 61492 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp1831157lbl; Mon, 8 Feb 2016 21:02:18 -0800 (PST) X-Received: by 10.66.119.71 with SMTP id ks7mr48163293pab.151.1454994137823; Mon, 08 Feb 2016 21:02:17 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 10si49909379pfk.172.2016.02.08.21.02.17; Mon, 08 Feb 2016 21:02:17 -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 S1753026AbcBIFCG (ORCPT + 11 others); Tue, 9 Feb 2016 00:02:06 -0500 Received: from mail-pa0-f45.google.com ([209.85.220.45]:34057 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752734AbcBIFB2 (ORCPT ); Tue, 9 Feb 2016 00:01:28 -0500 Received: by mail-pa0-f45.google.com with SMTP id kp3so1842122pab.1 for ; Mon, 08 Feb 2016 21:01:28 -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=4SNR+SJXPNIoNJJs/ZaKPAEXbQ5t080bR/4wMNvVcYQ=; b=D1Jry6CCDiEBr1Q28JmOeBJdvVnLFAvzdBZGq3YtPVFq3/QjYfkmEBPsuvip0c3F19 f485j55TGs0CDNEtjG2wUM7YjxywW9SDo4mKg04H2bPrYIi/MWQWDXJQGYo4z17ytYcw 6Zrn2FK7OLB/a6sFfPapZ2V47cevWdaDaQMsE= 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=4SNR+SJXPNIoNJJs/ZaKPAEXbQ5t080bR/4wMNvVcYQ=; b=LwKykiMweQkqcdEl/BtL4nSs7Iu+OfZQcR9CUk2DZ5AFj5rHn4evLyPoZWLIEH7H45 oziAteJO1Yvs0qjHQZIIDYKyiEJp1LnN2IsMf0hpnw068Vd95DPbBkzg6dxmQ99eLSCd zYa+rNBmzZZQEBYvvcxakYN72uRyWcfr1uiu5vbgtbgbOx1Tz3JA9kla4vORUlBWjjeT kI2HerZzUx5pQwp0Xhq4SnZEGA5IAh7fRganwFFLP1xUKRHhjudg4AWiLMHH3FUQK9oz 8ctWJuQgUkPidEFRBeh3n8uhq/dCLov9KpdpR3nG86OKsbSYS4b2ONBW/C+xZU0AZjls uDVA== X-Gm-Message-State: AG10YORjMMY5eJnu2O4BpBMBwfd32U6zolX06mVge0DroxQ7pEmmcp2WiHYK7VE8IYqHg8zI X-Received: by 10.67.1.164 with SMTP id bh4mr47871565pad.118.1454994087886; Mon, 08 Feb 2016 21:01:27 -0800 (PST) Received: from localhost ([122.172.22.246]) by smtp.gmail.com with ESMTPSA id 69sm46947270pfj.20.2016.02.08.21.01.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Feb 2016 21:01:27 -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 , Greg Kroah-Hartman , Len Brown , linux-kernel@vger.kernel.org (open list), Pavel Machek , Viresh Kumar Subject: [PATCH V3 04/16] PM / OPP: Introduce dev_pm_opp_get_max_transition_latency() Date: Tue, 9 Feb 2016 10:30:36 +0530 Message-Id: X-Mailer: git-send-email 2.7.1.370.gb2aa7f8 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 Reviewed-by: Stephen Boyd --- drivers/base/power/opp/core.c | 17 +++++++++++++++++ include/linux/pm_opp.h | 6 ++++++ 2 files changed, 23 insertions(+) -- 2.7.1.370.gb2aa7f8 -- 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 ffe2406af882..b0f5c72f0fc3 100644 --- a/drivers/base/power/opp/core.c +++ b/drivers/base/power/opp/core.c @@ -290,6 +290,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;