diff --git a/Documentation/devicetree/bindings/soc/rockchip/rockchip_system_monitor.txt b/Documentation/devicetree/bindings/soc/rockchip/rockchip_system_monitor.txt index 2cdd8842327b..9adc7e93f0ea 100644 --- a/Documentation/devicetree/bindings/soc/rockchip/rockchip_system_monitor.txt +++ b/Documentation/devicetree/bindings/soc/rockchip/rockchip_system_monitor.txt @@ -17,6 +17,9 @@ Optional properties: property (above). - rockchip,temp-offline-cpus: A string containing cpus which will be killed when temperature is high. +- rockchip,thermal-governor-dummy: This property allows system monitor to + change thermal governor to dummy, and the system + monitor will manage cooling devices. Example: diff --git a/drivers/soc/rockchip/rockchip_system_monitor.c b/drivers/soc/rockchip/rockchip_system_monitor.c index 39fc7fc0915a..fea48aa9e91e 100644 --- a/drivers/soc/rockchip/rockchip_system_monitor.c +++ b/drivers/soc/rockchip/rockchip_system_monitor.c @@ -1160,12 +1160,20 @@ void rockchip_system_monitor_unregister(struct monitor_dev_info *info) } EXPORT_SYMBOL(rockchip_system_monitor_unregister); +static int notify_dummy(struct thermal_zone_device *tz, int trip) +{ + return 0; +} + +static struct thermal_governor thermal_gov_dummy = { + .name = "dummy", + .throttle = notify_dummy, +}; + static int rockchip_system_monitor_parse_dt(struct system_monitor *monitor) { struct device_node *np = monitor->dev->of_node; - struct thermal_governor **governor; const char *tz_name, *buf = NULL; - const char *gov_name; if (of_property_read_string(np, "rockchip,video-4k-offline-cpus", &buf)) cpumask_clear(&system_monitor->video_4k_offline_cpus); @@ -1195,19 +1203,12 @@ static int rockchip_system_monitor_parse_dt(struct system_monitor *monitor) of_property_read_u32(np, "rockchip,temp-hysteresis", &system_monitor->temp_hysteresis); - if (of_property_read_string(np, "rockchip,thermal-governor", &gov_name)) - goto out; - for_each_governor_table(governor) { - if (!strncasecmp((*governor)->name, gov_name, - THERMAL_NAME_LENGTH)) { - if (monitor->tz->governor->unbind_from_tz) - monitor->tz->governor->unbind_from_tz(monitor->tz); - if ((*governor)->bind_to_tz) - (*governor)->bind_to_tz(monitor->tz); - monitor->tz->governor = (*governor); - break; - } + if (of_find_property(np, "rockchip,thermal-governor-dummy", NULL)) { + if (monitor->tz->governor->unbind_from_tz) + monitor->tz->governor->unbind_from_tz(monitor->tz); + monitor->tz->governor = &thermal_gov_dummy; } + out: return 0; }