mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
cpufreq: rockchip: Implement rockchip_cpufreq_online/offline()
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com> Change-Id: If6dfb5114a28e46aaad0f77ecb37f9029b607ee2
This commit is contained in:
@@ -571,6 +571,42 @@ static int rockchip_cpufreq_suspend(struct cpufreq_policy *policy)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int rockchip_cpufreq_online(int cpu)
|
||||
{
|
||||
struct cluster_info *cluster;
|
||||
struct rockchip_opp_info *opp_info;
|
||||
|
||||
cluster = rockchip_cluster_info_lookup(cpu);
|
||||
if (!cluster)
|
||||
return -EINVAL;
|
||||
opp_info = &cluster->opp_info;
|
||||
|
||||
opp_info->is_runtime_active = true;
|
||||
if (opp_info->data && opp_info->data->set_read_margin)
|
||||
opp_info->data->set_read_margin(opp_info->dev, opp_info,
|
||||
opp_info->target_rm);
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(rockchip_cpufreq_online);
|
||||
|
||||
int rockchip_cpufreq_offline(int cpu)
|
||||
{
|
||||
struct cluster_info *cluster;
|
||||
struct rockchip_opp_info *opp_info;
|
||||
|
||||
cluster = rockchip_cluster_info_lookup(cpu);
|
||||
if (!cluster)
|
||||
return -EINVAL;
|
||||
opp_info = &cluster->opp_info;
|
||||
|
||||
opp_info->is_runtime_active = false;
|
||||
opp_info->current_rm = UINT_MAX;
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(rockchip_cpufreq_offline);
|
||||
|
||||
static int rockchip_cpufreq_add_monitor(struct cluster_info *cluster,
|
||||
struct cpufreq_policy *policy)
|
||||
{
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#define __ROCKCHIP_CPUFREQ_H
|
||||
|
||||
#if IS_ENABLED(CONFIG_ARM_ROCKCHIP_CPUFREQ)
|
||||
int rockchip_cpufreq_online(int cpu);
|
||||
int rockchip_cpufreq_offline(int cpu);
|
||||
int rockchip_cpufreq_adjust_table(struct device *dev);
|
||||
int rockchip_cpufreq_opp_set_rate(struct device *dev, unsigned long target_freq);
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user