From: Johan Dahlin <jdahlin@gmail.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org,
Alwyn Kik <alwyn@kik.pw>,
Fabio Baltieri <fabio.baltieri@gmail.com>,
Hamza Mahfooz <someguy@effective-light.com>,
Johan Dahlin <jdahlin@gmail.com>
Subject: [PATCH v2 5/7] hwmon: (nct6683) Name the sensors of the ASRock B850 Steel Legend WiFi
Date: Wed, 11 Nov 2026 09:28:36 +0100 [thread overview]
Message-ID: <20261111082838.1418051-6-jdahlin@gmail.com> (raw)
In-Reply-To: <20261111082838.1418051-1-jdahlin@gmail.com>
The inputs are labeled after the monitoring source of the EC, such as
"Thermistor 14" or "VIN5", which says nothing about what they measure.
The UEFI setup of this board names them on its H/W Monitor page.
Add a per-board table of sensor names keyed on the monitoring source and
fill it in for the ASRock B850 Steel Legend WiFi. Sources without an
entry keep their generic name.
The CPU temperature matches k10temp and the voltages match their nominal
values. Which thermistor is the M/B one was inferred from the readings.
Signed-off-by: Johan Dahlin <jdahlin@gmail.com>
---
Documentation/hwmon/nct6683.rst | 3 ++
drivers/hwmon/nct6683.c | 53 +++++++++++++++++++++++++++++++--
2 files changed, 54 insertions(+), 2 deletions(-)
diff --git a/Documentation/hwmon/nct6683.rst b/Documentation/hwmon/nct6683.rst
index 8e5cd1d7dcd2..a9c53d6eab9c 100644
--- a/Documentation/hwmon/nct6683.rst
+++ b/Documentation/hwmon/nct6683.rst
@@ -61,6 +61,9 @@ It is also supported on the ASRock B850 Steel Legend WiFi (NCT6686D,
customer ID 0x164a), where pwm1 to pwm6 control the fan headers reported
by fan1 to fan6, and on the ASRock BC-250 (NCT6686D, customer ID 0x162b).
+On the ASRock B850 Steel Legend WiFi the temperature and voltage inputs
+are named after the H/W Monitor page of the BIOS setup.
+
pwmN_enable selects the fan control mode:
* 1: manual mode, the duty cycle is set with pwmN
diff --git a/drivers/hwmon/nct6683.c b/drivers/hwmon/nct6683.c
index f656b84ee8ac..4fcd0c74af44 100644
--- a/drivers/hwmon/nct6683.c
+++ b/drivers/hwmon/nct6683.c
@@ -328,6 +328,32 @@ static const char *const nct6683_mon_label[] = {
#define NUM_MON_LABELS ARRAY_SIZE(nct6683_mon_label)
#define MON_VOLTAGE_START 0x60
+/* Board specific names for the monitoring sources */
+struct nct6683_mon_desc {
+ u8 src; /* index into nct6683_mon_label */
+ const char *label;
+};
+
+/*
+ * ASRock B850 Steel Legend WiFi, named after the "H/W Monitor" page of the
+ * UEFI setup (BIOS 4.10). T_SENSOR1 is the thermistor cable header, see the
+ * ASRock B850 Steel Legend WiFi User Manual, section 2.12 "Onboard Headers
+ * and Connectors", page 49.
+ */
+static const struct nct6683_mon_desc asrock_b850sl_mon_desc[] = {
+ { 0x08, "M/B" }, /* Thermistor 14 */
+ { 0x0a, "T_SENSOR1" }, /* Thermistor 16 */
+ { 0x46, "CPU" }, /* AMD TSI Addr 98h */
+ { 0x60, "+3.3V" }, /* VCC */
+ { 0x66, "CPU Vcore" }, /* VIN0 */
+ { 0x69, "+5V" }, /* VIN3 */
+ { 0x6b, "VDDCR_SOC" }, /* VIN5 */
+ { 0x6c, "VDD_MISC" }, /* VIN6 */
+ { 0x6d, "DRAM" }, /* VIN7 */
+ { 0x76, "+12V" }, /* VIN16 */
+ { }
+};
+
/* ------------------------------------------------------- */
struct nct6683_data {
@@ -347,6 +373,9 @@ struct nct6683_data {
u8 in_index[NCT6683_NUM_REG_MON];
u8 in_src[NCT6683_NUM_REG_MON];
+ /* Board specific sensor names, NULL if none */
+ const struct nct6683_mon_desc *mon_desc;
+
struct mutex update_lock; /* used to protect sensor updates */
bool valid; /* true if following fields are valid */
u64 last_updated; /* In jiffies */
@@ -524,6 +553,25 @@ static inline long in_from_reg(u8 reg)
return reg * 16;
}
+static const struct nct6683_mon_desc *
+nct6683_find_mon_desc(struct nct6683_data *data, u8 src)
+{
+ const struct nct6683_mon_desc *desc;
+
+ for (desc = data->mon_desc; desc && desc->label; desc++)
+ if (desc->src == src)
+ return desc;
+
+ return NULL;
+}
+
+static const char *nct6683_mon_name(struct nct6683_data *data, u8 src)
+{
+ const struct nct6683_mon_desc *desc = nct6683_find_mon_desc(data, src);
+
+ return desc ? desc->label : nct6683_mon_label[src];
+}
+
static u16 nct6683_read(struct nct6683_data *data, u16 reg)
{
int res;
@@ -694,7 +742,7 @@ show_in_label(struct device *dev, struct device_attribute *attr, char *buf)
struct nct6683_data *data = nct6683_update_device(dev);
int nr = sattr->index;
- return sprintf(buf, "%s\n", nct6683_mon_label[data->in_src[nr]]);
+ return sprintf(buf, "%s\n", nct6683_mon_name(data, data->in_src[nr]));
}
static ssize_t
@@ -824,7 +872,7 @@ show_temp_label(struct device *dev, struct device_attribute *attr, char *buf)
struct nct6683_data *data = nct6683_update_device(dev);
int nr = sattr->index;
- return sprintf(buf, "%s\n", nct6683_mon_label[data->temp_src[nr]]);
+ return sprintf(buf, "%s\n", nct6683_mon_name(data, data->temp_src[nr]));
}
static ssize_t
@@ -1673,6 +1721,7 @@ static int nct6683_probe(struct platform_device *pdev)
case NCT6683_CUSTOMER_ID_ASROCK7:
break;
case NCT6683_CUSTOMER_ID_ASROCK8:
+ data->mon_desc = asrock_b850sl_mon_desc;
break;
default:
if (!force)
--
2.53.0
next prev parent reply other threads:[~2026-11-11 8:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-11 8:28 [PATCH v2 0/7] hwmon: (nct6683) Fan control and sensor names for ASRock NCT6686D boards Johan Dahlin
2026-11-11 8:28 ` [PATCH v2 1/7] hwmon: (nct6683) Add customer ID for ASRock B850 Steel Legend WiFi Johan Dahlin
2026-11-11 8:28 ` [PATCH v2 2/7] hwmon: (nct6683) Restore automatic fan control on driver removal Johan Dahlin
2026-11-11 8:28 ` [PATCH v2 3/7] hwmon: (nct6683) Enable fan control on ASRock B850 Steel Legend WiFi Johan Dahlin
2026-11-11 8:28 ` [PATCH v2 4/7] hwmon: (nct6683) Enable fan control on ASRock BC-250 Johan Dahlin
2026-11-11 8:28 ` Johan Dahlin [this message]
2026-11-11 8:28 ` [PATCH v2 6/7] hwmon: (nct6683) Name the fan headers of the ASRock B850 Steel Legend WiFi Johan Dahlin
2026-11-11 8:28 ` [PATCH v2 7/7] hwmon: (nct6683) Scale the +5V and +12V inputs " Johan Dahlin
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=20261111082838.1418051-6-jdahlin@gmail.com \
--to=jdahlin@gmail.com \
--cc=alwyn@kik.pw \
--cc=fabio.baltieri@gmail.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=someguy@effective-light.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
all inboxes | Powered by JetHome®