[RFC PATCH 2/3] tmon: Add support for THERMAL_TRIP_PLUG type
From: John Madieu
Date: Sun Mar 09 2025 - 08:14:21 EST
Extend tmon to handle the new THERMAL_TRIP_PLUG trip type:
- Update UI legend to show 'G=Plug' in status display
- Map trip type to 'G' character in trip_type_to_char()
Align tmon with kernel thermal framework extensions that support
CPU hotplug-based cooling through dedicated trip points.
Signed-off-by: John Madieu <john.madieu.xa@xxxxxxxxxxxxxx>
---
tools/thermal/tmon/tmon.h | 1 +
tools/thermal/tmon/tui.c | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/tools/thermal/tmon/tmon.h b/tools/thermal/tmon/tmon.h
index 44d16d778f04..b9b413be5eac 100644
--- a/tools/thermal/tmon/tmon.h
+++ b/tools/thermal/tmon/tmon.h
@@ -57,6 +57,7 @@ struct cdev_info {
enum trip_type {
THERMAL_TRIP_CRITICAL,
+ THERMAL_TRIP_PLUG,
THERMAL_TRIP_HOT,
THERMAL_TRIP_PASSIVE,
THERMAL_TRIP_ACTIVE,
diff --git a/tools/thermal/tmon/tui.c b/tools/thermal/tmon/tui.c
index 7f5dd2b87f15..8579b9a0d00d 100644
--- a/tools/thermal/tmon/tui.c
+++ b/tools/thermal/tmon/tui.c
@@ -307,7 +307,7 @@ void show_dialogue(void)
wattroff(w, A_BOLD);
/* print legend at the bottom line */
mvwprintw(w, rows - 2, 1,
- "Legend: A=Active, P=Passive, C=Critical");
+ "Legend: A=Active, P=Passive, G=Plug, C=Critical");
wrefresh(dialogue_window);
}
@@ -535,6 +535,7 @@ static char trip_type_to_char(int type)
switch (type) {
case THERMAL_TRIP_CRITICAL: return 'C';
case THERMAL_TRIP_HOT: return 'H';
+ case THERMAL_TRIP_PLUG: return 'G';
case THERMAL_TRIP_PASSIVE: return 'P';
case THERMAL_TRIP_ACTIVE: return 'A';
default:
--
2.25.1