Commit 559fef0d authored by Viresh Kumar's avatar Viresh Kumar
Browse files

opp: Add dev_pm_opp_of_add_table_noclk()



A few drivers have device's clk but they don't want the OPP core to
handle that. Add a new helper for them, dev_pm_opp_of_add_table_noclk().

Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Tested-by: default avatarDmitry Osipenko <digetx@gmail.com>
parent 32439ac7
Loading
Loading
Loading
Loading
+18 −0
Original line number Original line Diff line number Diff line
@@ -1030,6 +1030,24 @@ int dev_pm_opp_of_add_table_indexed(struct device *dev, int index)
}
}
EXPORT_SYMBOL_GPL(dev_pm_opp_of_add_table_indexed);
EXPORT_SYMBOL_GPL(dev_pm_opp_of_add_table_indexed);


/**
 * dev_pm_opp_of_add_table_noclk() - Initialize indexed opp table from device
 *		tree without getting clk for device.
 * @dev:	device pointer used to lookup OPP table.
 * @index:	Index number.
 *
 * Register the initial OPP table with the OPP library for given device only
 * using the "operating-points-v2" property. Do not try to get the clk for the
 * device.
 *
 * Return: Refer to dev_pm_opp_of_add_table() for return values.
 */
int dev_pm_opp_of_add_table_noclk(struct device *dev, int index)
{
	return _of_add_table_indexed(dev, index, false);
}
EXPORT_SYMBOL_GPL(dev_pm_opp_of_add_table_noclk);

/* CPU device specific helpers */
/* CPU device specific helpers */


/**
/**
+6 −0
Original line number Original line Diff line number Diff line
@@ -395,6 +395,7 @@ static inline int dev_pm_opp_sync_regulators(struct device *dev)
#if defined(CONFIG_PM_OPP) && defined(CONFIG_OF)
#if defined(CONFIG_PM_OPP) && defined(CONFIG_OF)
int dev_pm_opp_of_add_table(struct device *dev);
int dev_pm_opp_of_add_table(struct device *dev);
int dev_pm_opp_of_add_table_indexed(struct device *dev, int index);
int dev_pm_opp_of_add_table_indexed(struct device *dev, int index);
int dev_pm_opp_of_add_table_noclk(struct device *dev, int index);
void dev_pm_opp_of_remove_table(struct device *dev);
void dev_pm_opp_of_remove_table(struct device *dev);
int dev_pm_opp_of_cpumask_add_table(const struct cpumask *cpumask);
int dev_pm_opp_of_cpumask_add_table(const struct cpumask *cpumask);
void dev_pm_opp_of_cpumask_remove_table(const struct cpumask *cpumask);
void dev_pm_opp_of_cpumask_remove_table(const struct cpumask *cpumask);
@@ -419,6 +420,11 @@ static inline int dev_pm_opp_of_add_table_indexed(struct device *dev, int index)
	return -ENOTSUPP;
	return -ENOTSUPP;
}
}


static inline int dev_pm_opp_of_add_table_noclk(struct device *dev, int index)
{
	return -ENOTSUPP;
}

static inline void dev_pm_opp_of_remove_table(struct device *dev)
static inline void dev_pm_opp_of_remove_table(struct device *dev)
{
{
}
}