[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251001-ntc-thermistor-ncp18wm474-v1-1-2c64b9b509ff@pengutronix.de>
Date: Wed, 01 Oct 2025 13:45:27 +0200
From: Sascha Hauer <s.hauer@...gutronix.de>
To: Jean Delvare <jdelvare@...e.com>, Guenter Roeck <linux@...ck-us.net>,
Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Linus Walleij <linus.walleij@...aro.org>
Cc: linux-hwmon@...r.kernel.org, linux-kernel@...r.kernel.org,
devicetree@...r.kernel.org, Sascha Hauer <s.hauer@...gutronix.de>,
Emil Dahl Juhl <juhl.emildahl@...il.com>
Subject: [PATCH 1/2] drivers: hwmon: ntc-thermistor: add Murata ncp18wm474
From: Emil Dahl Juhl <juhl.emildahl@...il.com>
Add support for the Murata NCP18WM474 NTC.
Compensation table has been constructed by linear interpolation between
well defined points[1] on the resistance vs. temperature graph in the
datasheet[2]. The readouts of the graph has been done to the best of my
abilities, but the compensation table will be subject to inaccuracies
nonetheless.
[1] -40, -25, 0, 25, 50, 75, 100, 125 degrees
[2] https://www.murata.com/en-eu/api/pdfdownloadapi?cate=&partno=NCP18WM474E03RB
Signed-off-by: Emil Dahl Juhl <juhl.emildahl@...il.com>
Signed-off-by: Sascha Hauer <s.hauer@...gutronix.de>
---
drivers/hwmon/ntc_thermistor.c | 43 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)
diff --git a/drivers/hwmon/ntc_thermistor.c b/drivers/hwmon/ntc_thermistor.c
index d21f7266c4119b3d0190cafd0f376874535de5cf..d6b48178343dbbf268f54004c1f6e39d97fbd532 100644
--- a/drivers/hwmon/ntc_thermistor.c
+++ b/drivers/hwmon/ntc_thermistor.c
@@ -24,6 +24,7 @@ enum ntc_thermistor_type {
TYPE_NCPXXWF104,
TYPE_NCPXXWL333,
TYPE_NCPXXXH103,
+ TYPE_NCPXXWM474,
};
struct ntc_compensation {
@@ -46,6 +47,7 @@ enum {
NTC_NCP18WB473,
NTC_NCP21WB473,
NTC_SSG1404001221,
+ NTC_NCP18WM474,
NTC_LAST,
};
@@ -60,6 +62,7 @@ static const struct platform_device_id ntc_thermistor_id[] = {
[NTC_NCP18WB473] = { "ncp18wb473", TYPE_NCPXXWB473 },
[NTC_NCP21WB473] = { "ncp21wb473", TYPE_NCPXXWB473 },
[NTC_SSG1404001221] = { "ssg1404_001221", TYPE_NCPXXWB473 },
+ [NTC_NCP18WM474] = { "ncp18wm474", TYPE_NCPXXWM474 },
[NTC_LAST] = { },
};
MODULE_DEVICE_TABLE(platform, ntc_thermistor_id);
@@ -217,6 +220,43 @@ static const struct ntc_compensation ncpXXxh103[] = {
{ .temp_c = 125, .ohm = 531 },
};
+static const struct ntc_compensation ncpXXwm474[] = {
+ { .temp_c = -40, .ohm = 10900000 },
+ { .temp_c = -35, .ohm = 9600000 },
+ { .temp_c = -30, .ohm = 8300000 },
+ { .temp_c = -25, .ohm = 7000000 },
+ { .temp_c = -20, .ohm = 5980000 },
+ { .temp_c = -15, .ohm = 4960000 },
+ { .temp_c = -10, .ohm = 3940000 },
+ { .temp_c = -5, .ohm = 2920000 },
+ { .temp_c = 0, .ohm = 1900000 },
+ { .temp_c = 5, .ohm = 1614000 },
+ { .temp_c = 10, .ohm = 1328000 },
+ { .temp_c = 15, .ohm = 1042000 },
+ { .temp_c = 20, .ohm = 756000 },
+ { .temp_c = 25, .ohm = 470000 },
+ { .temp_c = 30, .ohm = 404000 },
+ { .temp_c = 35, .ohm = 338000 },
+ { .temp_c = 40, .ohm = 272000 },
+ { .temp_c = 45, .ohm = 206000 },
+ { .temp_c = 50, .ohm = 140000 },
+ { .temp_c = 55, .ohm = 122000 },
+ { .temp_c = 60, .ohm = 104000 },
+ { .temp_c = 65, .ohm = 86000 },
+ { .temp_c = 70, .ohm = 68000 },
+ { .temp_c = 75, .ohm = 50000 },
+ { .temp_c = 80, .ohm = 44200 },
+ { .temp_c = 85, .ohm = 38400 },
+ { .temp_c = 90, .ohm = 32600 },
+ { .temp_c = 95, .ohm = 26800 },
+ { .temp_c = 100, .ohm = 21000 },
+ { .temp_c = 105, .ohm = 18600 },
+ { .temp_c = 110, .ohm = 16200 },
+ { .temp_c = 115, .ohm = 13800 },
+ { .temp_c = 120, .ohm = 11400 },
+ { .temp_c = 125, .ohm = 9000 },
+};
+
/*
* The following compensation tables are from the specifications in EPCOS NTC
* Thermistors Datasheets
@@ -319,6 +359,7 @@ static const struct ntc_type ntc_type[] = {
NTC_TYPE(TYPE_NCPXXWF104, ncpXXwf104),
NTC_TYPE(TYPE_NCPXXWL333, ncpXXwl333),
NTC_TYPE(TYPE_NCPXXXH103, ncpXXxh103),
+ NTC_TYPE(TYPE_NCPXXWM474, ncpXXwm474),
};
/*
@@ -675,6 +716,8 @@ static const struct of_device_id ntc_match[] = {
.data = &ntc_thermistor_id[NTC_NCP21WB473] },
{ .compatible = "samsung,1404-001221",
.data = &ntc_thermistor_id[NTC_SSG1404001221] },
+ { .compatible = "murata,ncp18wm474",
+ .data = &ntc_thermistor_id[NTC_NCP18WM474] },
/* Usage of vendor name "ntc" is deprecated */
{ .compatible = "ntc,ncp03wb473",
--
2.47.3
Powered by blists - more mailing lists