linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christian Marangi <ansuelsmth@gmail.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Zhang Rui <rui.zhang@intel.com>,
	Lukasz Luba <lukasz.luba@arm.com>,
	Christian Marangi <ansuelsmth@gmail.com>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] tools/thermal: tmon: add support for cold and critical cold trip point
Date: Tue, 12 Dec 2023 23:13:01 +0100	[thread overview]
Message-ID: <20231212221301.12581-2-ansuelsmth@gmail.com> (raw)
In-Reply-To: <20231212221301.12581-1-ansuelsmth@gmail.com>

Add support for cold and critical cold trip point.

Add new char to represent these new values.
Saddly trip point name initial char can't be used as it does conflicts
with the Critical trip name conflicts with them, still a more or less
symbolic char is used to represent these new trip points.

Use:
- N as Negative for Cold trip point
- Z as Zero for Critical Cold trip point

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
 tools/thermal/tmon/tmon.h | 2 ++
 tools/thermal/tmon/tui.c  | 4 +++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/thermal/tmon/tmon.h b/tools/thermal/tmon/tmon.h
index 44d16d778f04..26d1c829af7d 100644
--- a/tools/thermal/tmon/tmon.h
+++ b/tools/thermal/tmon/tmon.h
@@ -58,6 +58,8 @@ struct cdev_info {
 enum trip_type {
 	THERMAL_TRIP_CRITICAL,
 	THERMAL_TRIP_HOT,
+	THERMAL_TRIP_COLD,
+	THERMAL_TRIP_CRITICAL_COLD,
 	THERMAL_TRIP_PASSIVE,
 	THERMAL_TRIP_ACTIVE,
 	NR_THERMAL_TRIP_TYPE,
diff --git a/tools/thermal/tmon/tui.c b/tools/thermal/tmon/tui.c
index 031b258667d8..6b58ffa4df6c 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, C=Critical, N=Cold, Z=Critical Cold");
 
 	wrefresh(dialogue_window);
 }
@@ -535,6 +535,8 @@ 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_COLD: return 'N';
+	case THERMAL_TRIP_CRITICAL_COLD: return 'Z';
 	case THERMAL_TRIP_PASSIVE: return 'P';
 	case THERMAL_TRIP_ACTIVE: return 'A';
 	default:
-- 
2.40.1


  reply	other threads:[~2023-12-12 22:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-12 22:13 [PATCH 1/2] thermal: core: add initial support for cold and critical_cold trip point Christian Marangi
2023-12-12 22:13 ` Christian Marangi [this message]
2023-12-13 12:01 ` Rafael J. Wysocki
2023-12-13 12:06   ` Christian Marangi
2023-12-13 14:39     ` Rafael J. Wysocki
2023-12-13 14:12 ` Daniel Lezcano
2023-12-13 14:20   ` Christian Marangi
2023-12-13 14:43     ` Rafael J. Wysocki
2023-12-13 14:51       ` Rafael J. Wysocki
2023-12-13 14:56       ` Christian Marangi
2023-12-13 15:03         ` Rafael J. Wysocki
2023-12-13 16:00         ` Daniel Lezcano
2023-12-13 15:10     ` Daniel Lezcano
2023-12-13 15:16       ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231212221301.12581-2-ansuelsmth@gmail.com \
    --to=ansuelsmth@gmail.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lukasz.luba@arm.com \
    --cc=rafael@kernel.org \
    --cc=rui.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).