summaryrefslogtreecommitdiffstats
path: root/drivers/opp/opp.h
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2023-02-22 12:06:38 +0100
committerViresh Kumar <viresh.kumar@linaro.org>2023-04-03 06:15:09 +0200
commit528f2d8d540a3c374d6b765c769620d91536b176 (patch)
treeb71e2d6df288b7d9856a38739d3ccdfdbf03237a /drivers/opp/opp.h
parentOPP: Handle all genpd cases together in _set_required_opps() (diff)
downloadlinux-528f2d8d540a3c374d6b765c769620d91536b176.tar.xz
linux-528f2d8d540a3c374d6b765c769620d91536b176.zip
OPP: Move required opps configuration to specialized callback
The required-opps configuration is closely tied to genpd and performance states at the moment and it is not very obvious that required-opps can live without genpds. Though we don't support configuring required-opps for non-genpd cases currently. This commit aims at separating these parts, where configuring genpds would be a special case of configuring the required-opps. Add a specialized callback, set_required_opps(), to the opp table and set it to different callbacks accordingly. This shouldn't result in any functional changes for now. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/opp/opp.h')
-rw-r--r--drivers/opp/opp.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/opp/opp.h b/drivers/opp/opp.h
index 3a6e077df386..2a057c42ddf4 100644
--- a/drivers/opp/opp.h
+++ b/drivers/opp/opp.h
@@ -184,6 +184,7 @@ enum opp_table_access {
* @enabled: Set to true if the device's resources are enabled/configured.
* @genpd_performance_state: Device's power domain support performance state.
* @is_genpd: Marks if the OPP table belongs to a genpd.
+ * @set_required_opps: Helper responsible to set required OPPs.
* @dentry: debugfs dentry pointer of the real device directory (not links).
* @dentry_name: Name of the real dentry.
*
@@ -234,6 +235,8 @@ struct opp_table {
bool enabled;
bool genpd_performance_state;
bool is_genpd;
+ int (*set_required_opps)(struct device *dev,
+ struct opp_table *opp_table, struct dev_pm_opp *opp, bool scaling_down);
#ifdef CONFIG_DEBUG_FS
struct dentry *dentry;
@@ -257,6 +260,7 @@ void _dev_pm_opp_cpumask_remove_table(const struct cpumask *cpumask, int last_cp
struct opp_table *_add_opp_table_indexed(struct device *dev, int index, bool getclk);
void _put_opp_list_kref(struct opp_table *opp_table);
void _required_opps_available(struct dev_pm_opp *opp, int count);
+void _update_set_required_opps(struct opp_table *opp_table);
static inline bool lazy_linking_pending(struct opp_table *opp_table)
{