@@ -943,6 +943,14 @@ struct opp_device *_add_opp_dev(const struct device *dev,
return opp_dev;
}
+int dev_pm_opp_add_opp_table(struct device *dev, struct opp_table *opp_table)
+{
+ if (!dev || !opp_table)
+ return -EINVAL;
+
+ return _add_opp_dev(dev, opp_table) ? 0 : -ENOMEM;
+}
+
static struct opp_table *_allocate_opp_table(struct device *dev, int index)
{
struct opp_table *opp_table;
@@ -81,6 +81,7 @@ struct dev_pm_set_opp_data {
struct opp_table *dev_pm_opp_get_opp_table(struct device *dev);
struct opp_table *dev_pm_opp_get_opp_table_indexed(struct device *dev, int index);
void dev_pm_opp_put_opp_table(struct opp_table *opp_table);
+int dev_pm_opp_add_opp_table(struct device *dev, struct opp_table *opp_table);
unsigned long dev_pm_opp_get_voltage(struct dev_pm_opp *opp);
@@ -158,6 +159,12 @@ static inline struct opp_table *dev_pm_opp_get_opp_table_indexed(struct device *
static inline void dev_pm_opp_put_opp_table(struct opp_table *opp_table) {}
+static int dev_pm_opp_add_opp_table(struct device *dev,
+ struct opp_table *opp_table)
+{
+ return -ENOTSUPP;
+}
+
static inline unsigned long dev_pm_opp_get_voltage(struct dev_pm_opp *opp)
{
return 0;
Some hardware devices might create multiple children devices to manage different components of the hardware. In these cases, it might be necessary for the original hardware device to copy specific OPP tables to a specific the new child device. Add dev_pm_opp_add_opp_table() to do that. Signed-off-by: Saravana Kannan <saravanak@google.com> --- drivers/opp/core.c | 8 ++++++++ include/linux/pm_opp.h | 7 +++++++ 2 files changed, 15 insertions(+)