diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2018-06-07 14:50:43 +0530 |
---|---|---|
committer | Viresh Kumar <viresh.kumar@linaro.org> | 2018-11-05 07:40:42 +0530 |
commit | 5d6d106fa45501ea6494a8653adbf2bee4a6f803 (patch) | |
tree | cbaea1ef9c2dc2bfb65bd8bb390f1922ca71a1db /drivers/opp/opp.h | |
parent | 7e535993fa4f671dbbd7fd95c93ce90181ddd9e1 (diff) |
OPP: Populate required opp tables from "required-opps" property
The current implementation works only for the case where a single
phandle is present in the "required-opps" property, while DT allows
multiple phandles to be present there.
This patch adds new infrastructure to parse all the phandles present in
"required-opps" property and save pointers of the required OPP's OPP
tables. These will be used by later commits.
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Diffstat (limited to 'drivers/opp/opp.h')
-rw-r--r-- | drivers/opp/opp.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/opp/opp.h b/drivers/opp/opp.h index cdb0c2b095e2..024e1be23d37 100644 --- a/drivers/opp/opp.h +++ b/drivers/opp/opp.h @@ -133,6 +133,9 @@ enum opp_table_access { * @parsed_static_opps: True if OPPs are initialized from DT. * @shared_opp: OPP is shared between multiple devices. * @suspend_opp: Pointer to OPP to be used during device suspend. + * @required_opp_tables: List of device OPP tables that are required by OPPs in + * this table. + * @required_opp_count: Number of required devices. * @supported_hw: Array of version number to support. * @supported_hw_count: Number of elements in supported_hw array. * @prop_name: A name to postfix to many DT properties, while parsing them. @@ -172,6 +175,9 @@ struct opp_table { enum opp_table_access shared_opp; struct dev_pm_opp *suspend_opp; + struct opp_table **required_opp_tables; + unsigned int required_opp_count; + unsigned int *supported_hw; unsigned int supported_hw_count; const char *prop_name; @@ -208,9 +214,11 @@ void _put_opp_list_kref(struct opp_table *opp_table); #ifdef CONFIG_OF void _of_init_opp_table(struct opp_table *opp_table, struct device *dev, int index); +void _of_clear_opp_table(struct opp_table *opp_table); struct opp_table *_managed_opp(struct device *dev, int index); #else static inline void _of_init_opp_table(struct opp_table *opp_table, struct device *dev, int index) {} +static inline void _of_clear_opp_table(struct opp_table *opp_table) {} static inline struct opp_table *_managed_opp(struct device *dev, int index) { return NULL; } #endif |