问题
i want to bind thermal sensor with cooling device ( fan ) using lookup table. I know how to do it using DTs ( device tree) but never worked using lookup table in code for same. I need help on how to do same on code using lookup table what we use to do using device tree. for example
thermal-zones {
cpu_thermal: cpu-thermal {
polling-delay-passive = <250>; /* milliseconds */
polling-delay = <1000>; /* milliseconds */
thermal-sensors = <&bandgap0>;
trips {
cpu_alert0: cpu-alert0 {
temperature = <90000>; /* millicelsius */
hysteresis = <2000>; /* millicelsius */
type = "active";
};
cpu_alert1: cpu-alert1 {
temperature = <100000>; /* millicelsius */
hysteresis = <2000>; /* millicelsius */
type = "passive";
};
cpu_crit: cpu-crit {
temperature = <125000>; /* millicelsius */
hysteresis = <2000>; /* millicelsius */
type = "critical";
};
};
cooling-maps {
map0 {
trip = <&cpu_alert0>;
cooling-device = <&fan0 THERMAL_NO_LIMIT 4>;
};
map1 {
trip = <&cpu_alert1>;
cooling-device = <&fan0 5 THERMAL_NO_LIMIT>, <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
};
};
};
};
how can i do same binding in code itself
回答1:
Just don't use the devicetree bindings, instead use examples of non-DT thermal drivers such as drivers/acpi/thermal.c, drivers/net/ethernet/mellanox/mlxsw/core_thermal.c
来源:https://stackoverflow.com/questions/60289063/how-to-bind-thermal-sensor-with-cooling-device-using-lookup-table-in-code