Commit Graph

10 Commits

Author SHA1 Message Date
Finley Xiao
2b2bf23ccd opp: Ignore unavailable opp when show opp summary
Fixes: 37d5c1a6fd ("opp: Add a summary tree in debugfs")
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: I70c97957b48abe2417857f8aff5d4175d418b1e6
2022-03-08 11:43:55 +08:00
Finley Xiao
f93c9d6e78 OPP: Add two regulaters support for opp summary
device                rate(Hz)    target(uV)    min(uV)    max(uV)
-------------------------------------------------------------------
 cpu0
                      408000000       750000      750000      950000
                                      750000      750000      950000
                      600000000       750000      750000      950000
                                      750000      750000      950000
                      816000000       750000      750000      950000
                                      750000      750000      950000
                     1008000000       750000      750000      950000
                                      750000      750000      950000

Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: I589fab5579e74a7ed58c8eefb16c4671335c8c75
2021-11-13 14:12:24 +08:00
Finley Xiao
37d5c1a6fd opp: Add a summary tree in debugfs
On rk3568-evb1-ddr4-v10 the opp_summary looks something like as follow.

 device                rate(Hz)    target(uV)    min(uV)    max(uV)
-------------------------------------------------------------------
 platform-fde60000.gpu
                      200000000       825000      825000      825000
                      300000000       825000      825000      825000
                      400000000       825000      825000      825000
                      600000000       825000      825000      825000
                      700000000       900000      900000      900000
                      800000000      1000000     1000000     1000000
 platform-bus-npu
                      900000000            0           0           0
                     1000000000       925000      925000      925000
 cpu0
                      408000000       825000      825000     1150000
                      600000000       825000      825000     1150000
                      816000000       825000      825000     1150000
                     1104000000       825000      825000     1150000
                     1416000000       900000      900000     1150000
                     1608000000       975000      975000     1150000
                     1800000000      1050000     1050000     1150000
                     1992000000      1150000     1150000     1150000

Change-Id: Ia357b4088805cf640dd659f510dd031488bd3ab3
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2021-07-16 17:55:24 +08:00
Viresh Kumar
0430b1d570 opp: Expose bandwidth information via debugfs
Expose the bandwidth information as well via debugfs.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
2020-05-29 10:15:12 +05:30
Thomas Gleixner
d2912cb15b treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500
Based on 2 normalized pattern(s):

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license version 2 as
  published by the free software foundation

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license version 2 as
  published by the free software foundation #

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-only

has been chosen to replace the boilerplate/reference in 4122 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Enrico Weigelt <info@metux.net>
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Allison Randal <allison@lohutok.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-19 17:09:55 +02:00
Greg Kroah-Hartman
a2dea4cb90 opp: no need to check return value of debugfs_create functions
When calling debugfs functions, there is no need to ever check the
return value.  The function can work or not, but the code logic should
never do something different based on this.

Cc: Viresh Kumar <vireshk@kernel.org>
Cc: Nishanth Menon <nm@ti.com>
Cc: Stephen Boyd <sboyd@kernel.org>
Cc: linux-pm@vger.kernel.org
Reviewed-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2019-02-07 09:58:32 +05:30
Viresh Kumar
a1e8c13600 PM / OPP: "opp-hz" is optional for power domains
"opp-hz" property is optional for power domains now and we shouldn't
error out if it is missing for power domains.

This patch creates two new routines, _get_opp_count() and
_opp_is_duplicate(), by separating existing code from their parent
functions. Also skip duplicate OPP check for power domain OPPs as they
may not have any the "opp-hz" field, but a platform specific performance
state binding to uniquely identify OPP nodes.

By default the debugfs OPP nodes are named using the "rate" value, but
that isn't possible for the power domain OPP nodes and hence they use
the index of the OPP node in the OPP node list instead.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
2018-05-09 10:15:18 +05:30
Viresh Kumar
009acd196f PM / OPP: Support updating performance state of device's power domain
The genpd framework now provides an API to request device's power
domain to update its performance state.  Use that interface from the
OPP core for devices whose power domains support performance states.

Note that this commit doesn't add any mechanism by which performance
states are made available to the OPP core. That would be done by a
later commit.

Note that the current implementation is restricted to the case where
the device doesn't have separate regulators for itself. We shouldn't
over engineer the code before we have real use case for them. We can
always come back and add more code to support such cases later on.

Tested-by: Rajendra Nayak <rnayak@codeaurora.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-10-14 00:54:40 +02:00
Arvind Yadav
d741029a23 PM / OPP: Use snprintf() to avoid kasprintf() and kfree()
Use snprintf() to avoid unnecessary initializations, avoid calling
kfree().

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-10-11 01:49:17 +02:00
Viresh Kumar
7813dd6fc7 PM / OPP: Move the OPP directory out of power/
The drivers/base/power/ directory is special and contains code related
to power management core like system suspend/resume, hibernation, etc.
It was fine to keep the OPP code inside it when we had just one file for
it, but it is growing now and already has a directory for itself.

Lets move it directly under drivers/ directory, just like cpufreq and
cpuidle.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-10-03 02:45:12 +02:00