mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 14:42:37 +02:00
PM / OPP: Rename dev_pm_opp_check_initial_rate to dev_pm_opp_check_rate_volt
Make the function more general. Change-Id: Ic10b84ddb6b7eff33e1a1fe491f05f10a9c6015a Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
This commit is contained in:
parent
9d01f91893
commit
87c0821959
|
|
@ -704,15 +704,15 @@ int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq)
|
|||
EXPORT_SYMBOL_GPL(dev_pm_opp_set_rate);
|
||||
|
||||
/**
|
||||
* dev_pm_opp_check_initial_rate() - Configure new OPP based on initial rate
|
||||
* dev_pm_opp_check_rate_volt() - Configure new OPP based on current rate
|
||||
* @dev: device for which we do this operation
|
||||
*
|
||||
* This configures the power-supplies and clock source to the levels specified
|
||||
* by the OPP corresponding to the system initial rate.
|
||||
* by the OPP corresponding to current rate.
|
||||
*
|
||||
* Locking: This function takes rcu_read_lock().
|
||||
*/
|
||||
int dev_pm_opp_check_initial_rate(struct device *dev, unsigned long *cur_freq)
|
||||
int dev_pm_opp_check_rate_volt(struct device *dev, bool force)
|
||||
{
|
||||
struct opp_table *opp_table;
|
||||
struct dev_pm_opp *opp;
|
||||
|
|
@ -741,7 +741,6 @@ int dev_pm_opp_check_initial_rate(struct device *dev, unsigned long *cur_freq)
|
|||
}
|
||||
|
||||
old_freq = clk_get_rate(clk);
|
||||
*cur_freq = old_freq;
|
||||
target_freq = old_freq;
|
||||
|
||||
opp = dev_pm_opp_find_freq_ceil(dev, &target_freq);
|
||||
|
|
@ -772,11 +771,14 @@ int dev_pm_opp_check_initial_rate(struct device *dev, unsigned long *cur_freq)
|
|||
target_freq, u_volt);
|
||||
|
||||
if (old_freq == target_freq) {
|
||||
ret = _set_opp_voltage(dev, reg, u_volt, u_volt_min,
|
||||
u_volt_max);
|
||||
if (ret) {
|
||||
dev_err(dev, "failed to set volt %lu\n", u_volt);
|
||||
return ret;
|
||||
if (old_volt != u_volt || force) {
|
||||
ret = _set_opp_voltage(dev, reg, u_volt, u_volt_min,
|
||||
u_volt_max);
|
||||
if (ret) {
|
||||
dev_err(dev, "failed to set volt %lu\n",
|
||||
u_volt);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -798,8 +800,6 @@ int dev_pm_opp_check_initial_rate(struct device *dev, unsigned long *cur_freq)
|
|||
return ret;
|
||||
}
|
||||
|
||||
*cur_freq = clk_get_rate(clk);
|
||||
|
||||
/* Scaling down? Scale voltage after frequency */
|
||||
if (target_freq < old_freq) {
|
||||
ret = _set_opp_voltage(dev, reg, u_volt, u_volt_min,
|
||||
|
|
@ -812,7 +812,7 @@ int dev_pm_opp_check_initial_rate(struct device *dev, unsigned long *cur_freq)
|
|||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(dev_pm_opp_check_initial_rate);
|
||||
EXPORT_SYMBOL_GPL(dev_pm_opp_check_rate_volt);
|
||||
|
||||
/* OPP-dev Helpers */
|
||||
static void _kfree_opp_dev_rcu(struct rcu_head *head)
|
||||
|
|
|
|||
|
|
@ -158,7 +158,6 @@ static int cpufreq_init(struct cpufreq_policy *policy)
|
|||
struct cpumask cpus;
|
||||
#endif
|
||||
unsigned int transition_latency;
|
||||
unsigned long cur_freq;
|
||||
bool opp_v1 = false;
|
||||
const char *name;
|
||||
int ret, scale;
|
||||
|
|
@ -314,9 +313,7 @@ static int cpufreq_init(struct cpufreq_policy *policy)
|
|||
policy->down_transition_delay_us = 50000; /* 50ms */
|
||||
|
||||
if (check_init < MAX_CLUSTERS) {
|
||||
ret = dev_pm_opp_check_initial_rate(cpu_dev, &cur_freq);
|
||||
if (!ret)
|
||||
policy->cur = cur_freq / 1000;
|
||||
dev_pm_opp_check_rate_volt(cpu_dev, true);
|
||||
check_init++;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ void dev_pm_opp_put_prop_name(struct device *dev);
|
|||
int dev_pm_opp_set_regulator(struct device *dev, const char *name);
|
||||
void dev_pm_opp_put_regulator(struct device *dev);
|
||||
int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq);
|
||||
int dev_pm_opp_check_initial_rate(struct device *dev, unsigned long *cur_freq);
|
||||
int dev_pm_opp_check_rate_volt(struct device *dev, bool force);
|
||||
#else
|
||||
static inline unsigned long dev_pm_opp_get_voltage(struct dev_pm_opp *opp)
|
||||
{
|
||||
|
|
@ -180,8 +180,7 @@ static inline int dev_pm_opp_set_rate(struct device *dev, unsigned long target_f
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
static inline int dev_pm_opp_check_initial_rate(struct device *dev,
|
||||
unsigned long *cur_freq)
|
||||
static inline int dev_pm_opp_check_rate_volt(struct device *dev, bool force)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user