mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 03:15:31 +09:00
soc: rockchip_system_monitor: Add support to set init freq
As the scmi clk of npu may come from pvtpll, it should power up npu pd and enable the pclk of pvtpll before set scmi clk. The "assigned-clocks" in npu node will be set before npu driver probe, at this time the npu pd may be down, so add "rockchip,init-freq" in opp table node, make set scmi clk after npu pd is up and pclk of pvtpll is enabled. Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com> Change-Id: I20fc3b6414601134645fa7f157c8ce5db9569232
This commit is contained in:
@@ -675,6 +675,8 @@ static int monitor_device_parse_dt(struct device *dev,
|
||||
if (!np)
|
||||
return -EINVAL;
|
||||
|
||||
of_property_read_u32(np, "rockchip,init-freq", &info->init_freq);
|
||||
|
||||
ret = monitor_device_parse_wide_temp_config(np, info);
|
||||
ret &= monitor_device_parse_status_config(np, info);
|
||||
ret &= monitor_device_parse_early_min_volt(np, info);
|
||||
@@ -1107,7 +1109,12 @@ int rockchip_monitor_check_rate_volt(struct monitor_dev_info *info)
|
||||
old_mem_volt = regulator_get_voltage(mem_reg);
|
||||
}
|
||||
|
||||
new_rate = old_rate;
|
||||
if (info->init_freq) {
|
||||
new_rate = info->init_freq * 1000;
|
||||
info->init_freq = 0;
|
||||
} else {
|
||||
new_rate = old_rate;
|
||||
}
|
||||
opp = dev_pm_opp_find_freq_ceil(dev, &new_rate);
|
||||
if (IS_ERR(opp)) {
|
||||
opp = dev_pm_opp_find_freq_floor(dev, &new_rate);
|
||||
|
||||
@@ -98,6 +98,7 @@ struct monitor_dev_info {
|
||||
unsigned long high_temp_max_volt;
|
||||
unsigned int video_4k_freq;
|
||||
unsigned int reboot_freq;
|
||||
unsigned int init_freq;
|
||||
unsigned int status_min_limit;
|
||||
unsigned int status_max_limit;
|
||||
unsigned int early_min_volt;
|
||||
|
||||
Reference in New Issue
Block a user