On 12/10/2023 19:58, Thierry Reding wrote:
From: Thierry Reding <treding@xxxxxxxxxx> The SOCTHERM's built-in throttling mechanism doesn't map well to the concept of a cooling device because it will automatically start to throttle when the programmed temperature threshold is crossed. Remove the cooling device implementation and instead unconditionally program the throttling for the CPU and GPU thermal zones. Signed-off-by: Thierry Reding <treding@xxxxxxxxxx> ---
[ ... ]
+ ret = of_property_read_u32(np, "temperature-millicelsius", + &stc->temperature); + if (ret < 0) + goto err; + + ret = of_property_read_u32(np, "hysteresis-millicelsius", + &stc->hysteresis); + if (ret < 0) + goto err; + + stc->num_zones = of_count_phandle_with_args(np, "nvidia,thermal-zones", + NULL); + if (stc->num_zones > 0) { + struct device_node *zone; + unsigned int i; + + stc->zones = devm_kcalloc(ts->dev, stc->num_zones, sizeof(zone), + GFP_KERNEL); + if (!stc->zones) + return -ENOMEM; + + for (i = 0; i < stc->num_zones; i++) { + zone = of_parse_phandle(np, "nvidia,thermal-zones", i); + stc->zones[i] = zone; + } + }
What is the connection between the temperature sensor and the hardware limiter?
I mean, one hand there is the hardware limiter which is not connected to the sensor neither a thermal zone and it could be self contained in a separate driver. And then there is the temperature sensor.
The thermal zone phandle things connected with the throttling bindings sounds like strange to me.
What prevents to split the throttling and the sensor into separate code? -- <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog