Source
x
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* ntc_thermistor.c - NTC Thermistors
*
* Copyright (C) 2010 Samsung Electronics
* MyungJoo Ham <myungjoo.ham@samsung.com>
*/
struct ntc_compensation {
int temp_c;
unsigned int ohm;
};
/*
* Used as index in a zero-terminated array, holes not allowed so
* that NTC_LAST is the first empty array entry.
*/
enum {
NTC_B57330V2103,
NTC_B57891S0103,
NTC_NCP03WB473,
NTC_NCP03WF104,
NTC_NCP15WB473,
NTC_NCP15WL333,
NTC_NCP15XH103,
NTC_NCP18WB473,
NTC_NCP21WB473,
NTC_LAST,
};
static const struct platform_device_id ntc_thermistor_id[] = {
[NTC_B57330V2103] = { "b57330v2103", TYPE_B57330V2103 },
[NTC_B57891S0103] = { "b57891s0103", TYPE_B57891S0103 },
[NTC_NCP03WB473] = { "ncp03wb473", TYPE_NCPXXWB473 },
[NTC_NCP03WF104] = { "ncp03wf104", TYPE_NCPXXWF104 },
[NTC_NCP15WB473] = { "ncp15wb473", TYPE_NCPXXWB473 },
[NTC_NCP15WL333] = { "ncp15wl333", TYPE_NCPXXWL333 },
[NTC_NCP15XH103] = { "ncp15xh103", TYPE_NCPXXXH103 },
[NTC_NCP18WB473] = { "ncp18wb473", TYPE_NCPXXWB473 },
[NTC_NCP21WB473] = { "ncp21wb473", TYPE_NCPXXWB473 },
[NTC_LAST] = { },
};
/*
* A compensation table should be sorted by the values of .ohm
* in descending order.
* The following compensation tables are from the specification of Murata NTC
* Thermistors Datasheet
*/
static const struct ntc_compensation ncpXXwb473[] = {
{ .temp_c = -40, .ohm = 1747920 },
{ .temp_c = -35, .ohm = 1245428 },
{ .temp_c = -30, .ohm = 898485 },
{ .temp_c = -25, .ohm = 655802 },
{ .temp_c = -20, .ohm = 483954 },
{ .temp_c = -15, .ohm = 360850 },
{ .temp_c = -10, .ohm = 271697 },
{ .temp_c = -5, .ohm = 206463 },
{ .temp_c = 0, .ohm = 158214 },
{ .temp_c = 5, .ohm = 122259 },
{ .temp_c = 10, .ohm = 95227 },
{ .temp_c = 15, .ohm = 74730 },
{ .temp_c = 20, .ohm = 59065 },
{ .temp_c = 25, .ohm = 47000 },
{ .temp_c = 30, .ohm = 37643 },
{ .temp_c = 35, .ohm = 30334 },
{ .temp_c = 40, .ohm = 24591 },
{ .temp_c = 45, .ohm = 20048 },
{ .temp_c = 50, .ohm = 16433 },
{ .temp_c = 55, .ohm = 13539 },
{ .temp_c = 60, .ohm = 11209 },
{ .temp_c = 65, .ohm = 9328 },
{ .temp_c = 70, .ohm = 7798 },
{ .temp_c = 75, .ohm = 6544 },