Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hwmon: (ntc-thermistor) Add Murata ncp18wm474

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@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Link: https://lore.kernel.org/r/20251001-ntc-thermistor-ncp18wm474-v1-1-2c64b9b509ff@pengutronix.de
Signed-off-by: Guenter Roeck <linux@roeck-us.net>

authored by

Emil Dahl Juhl and committed by
Guenter Roeck
13e6612f 8264528a

+43
+43
drivers/hwmon/ntc_thermistor.c
··· 24 24 TYPE_NCPXXWF104, 25 25 TYPE_NCPXXWL333, 26 26 TYPE_NCPXXXH103, 27 + TYPE_NCPXXWM474, 27 28 }; 28 29 29 30 struct ntc_compensation { ··· 47 46 NTC_NCP18WB473, 48 47 NTC_NCP21WB473, 49 48 NTC_SSG1404001221, 49 + NTC_NCP18WM474, 50 50 NTC_LAST, 51 51 }; 52 52 ··· 62 60 [NTC_NCP18WB473] = { "ncp18wb473", TYPE_NCPXXWB473 }, 63 61 [NTC_NCP21WB473] = { "ncp21wb473", TYPE_NCPXXWB473 }, 64 62 [NTC_SSG1404001221] = { "ssg1404_001221", TYPE_NCPXXWB473 }, 63 + [NTC_NCP18WM474] = { "ncp18wm474", TYPE_NCPXXWM474 }, 65 64 [NTC_LAST] = { }, 66 65 }; 67 66 MODULE_DEVICE_TABLE(platform, ntc_thermistor_id); ··· 220 217 { .temp_c = 125, .ohm = 531 }, 221 218 }; 222 219 220 + static const struct ntc_compensation ncpXXwm474[] = { 221 + { .temp_c = -40, .ohm = 10900000 }, 222 + { .temp_c = -35, .ohm = 9600000 }, 223 + { .temp_c = -30, .ohm = 8300000 }, 224 + { .temp_c = -25, .ohm = 7000000 }, 225 + { .temp_c = -20, .ohm = 5980000 }, 226 + { .temp_c = -15, .ohm = 4960000 }, 227 + { .temp_c = -10, .ohm = 3940000 }, 228 + { .temp_c = -5, .ohm = 2920000 }, 229 + { .temp_c = 0, .ohm = 1900000 }, 230 + { .temp_c = 5, .ohm = 1614000 }, 231 + { .temp_c = 10, .ohm = 1328000 }, 232 + { .temp_c = 15, .ohm = 1042000 }, 233 + { .temp_c = 20, .ohm = 756000 }, 234 + { .temp_c = 25, .ohm = 470000 }, 235 + { .temp_c = 30, .ohm = 404000 }, 236 + { .temp_c = 35, .ohm = 338000 }, 237 + { .temp_c = 40, .ohm = 272000 }, 238 + { .temp_c = 45, .ohm = 206000 }, 239 + { .temp_c = 50, .ohm = 140000 }, 240 + { .temp_c = 55, .ohm = 122000 }, 241 + { .temp_c = 60, .ohm = 104000 }, 242 + { .temp_c = 65, .ohm = 86000 }, 243 + { .temp_c = 70, .ohm = 68000 }, 244 + { .temp_c = 75, .ohm = 50000 }, 245 + { .temp_c = 80, .ohm = 44200 }, 246 + { .temp_c = 85, .ohm = 38400 }, 247 + { .temp_c = 90, .ohm = 32600 }, 248 + { .temp_c = 95, .ohm = 26800 }, 249 + { .temp_c = 100, .ohm = 21000 }, 250 + { .temp_c = 105, .ohm = 18600 }, 251 + { .temp_c = 110, .ohm = 16200 }, 252 + { .temp_c = 115, .ohm = 13800 }, 253 + { .temp_c = 120, .ohm = 11400 }, 254 + { .temp_c = 125, .ohm = 9000 }, 255 + }; 256 + 223 257 /* 224 258 * The following compensation tables are from the specifications in EPCOS NTC 225 259 * Thermistors Datasheets ··· 359 319 NTC_TYPE(TYPE_NCPXXWF104, ncpXXwf104), 360 320 NTC_TYPE(TYPE_NCPXXWL333, ncpXXwl333), 361 321 NTC_TYPE(TYPE_NCPXXXH103, ncpXXxh103), 322 + NTC_TYPE(TYPE_NCPXXWM474, ncpXXwm474), 362 323 }; 363 324 364 325 /* ··· 716 675 .data = &ntc_thermistor_id[NTC_NCP21WB473] }, 717 676 { .compatible = "samsung,1404-001221", 718 677 .data = &ntc_thermistor_id[NTC_SSG1404001221] }, 678 + { .compatible = "murata,ncp18wm474", 679 + .data = &ntc_thermistor_id[NTC_NCP18WM474] }, 719 680 720 681 /* Usage of vendor name "ntc" is deprecated */ 721 682 { .compatible = "ntc,ncp03wb473",