diff options
author | Johannes Pointner <johannes.pointner@gmail.com> | 2014-07-01 02:05:52 -0400 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2014-08-04 10:01:35 -0400 |
commit | ed67f0872be1aa516831332c732752022d4edc7c (patch) | |
tree | 3c1ad73c7b1735ae78c85cfbfd9add48459339b3 /drivers/hwmon/ntc_thermistor.c | |
parent | 3ef0bb6f769bc61af0ec073cbf49db6598bdefc0 (diff) |
hwmon: (ntc_thermistor) Support B57330V2103 from EPCOS
This patch adds support for the ntc thermistor B57330V2103 from EPCOS.
Signed-off-by: Johannes Pointner <johannes.pointner@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/ntc_thermistor.c')
-rw-r--r-- | drivers/hwmon/ntc_thermistor.c | 50 |
1 files changed, 49 insertions, 1 deletions
diff --git a/drivers/hwmon/ntc_thermistor.c b/drivers/hwmon/ntc_thermistor.c index ae66f42c4d6d..bd410722cd4b 100644 --- a/drivers/hwmon/ntc_thermistor.c +++ b/drivers/hwmon/ntc_thermistor.c | |||
@@ -51,6 +51,7 @@ static const struct platform_device_id ntc_thermistor_id[] = { | |||
51 | { "ncp21wb473", TYPE_NCPXXWB473 }, | 51 | { "ncp21wb473", TYPE_NCPXXWB473 }, |
52 | { "ncp03wb473", TYPE_NCPXXWB473 }, | 52 | { "ncp03wb473", TYPE_NCPXXWB473 }, |
53 | { "ncp15wl333", TYPE_NCPXXWL333 }, | 53 | { "ncp15wl333", TYPE_NCPXXWL333 }, |
54 | { "b57330v2103", TYPE_B57330V2103}, | ||
54 | { }, | 55 | { }, |
55 | }; | 56 | }; |
56 | 57 | ||
@@ -133,6 +134,47 @@ static const struct ntc_compensation ncpXXwl333[] = { | |||
133 | { .temp_c = 125, .ohm = 707 }, | 134 | { .temp_c = 125, .ohm = 707 }, |
134 | }; | 135 | }; |
135 | 136 | ||
137 | /* | ||
138 | * The following compensation table is from the specification of EPCOS NTC | ||
139 | * Thermistors Datasheet | ||
140 | */ | ||
141 | static const struct ntc_compensation b57330v2103[] = { | ||
142 | { .temp_c = -40, .ohm = 190030 }, | ||
143 | { .temp_c = -35, .ohm = 145360 }, | ||
144 | { .temp_c = -30, .ohm = 112060 }, | ||
145 | { .temp_c = -25, .ohm = 87041 }, | ||
146 | { .temp_c = -20, .ohm = 68104 }, | ||
147 | { .temp_c = -15, .ohm = 53665 }, | ||
148 | { .temp_c = -10, .ohm = 42576 }, | ||
149 | { .temp_c = -5, .ohm = 34001 }, | ||
150 | { .temp_c = 0, .ohm = 27326 }, | ||
151 | { .temp_c = 5, .ohm = 22096 }, | ||
152 | { .temp_c = 10, .ohm = 17973 }, | ||
153 | { .temp_c = 15, .ohm = 14703 }, | ||
154 | { .temp_c = 20, .ohm = 12090 }, | ||
155 | { .temp_c = 25, .ohm = 10000 }, | ||
156 | { .temp_c = 30, .ohm = 8311 }, | ||
157 | { .temp_c = 35, .ohm = 6941 }, | ||
158 | { .temp_c = 40, .ohm = 5825 }, | ||
159 | { .temp_c = 45, .ohm = 4911 }, | ||
160 | { .temp_c = 50, .ohm = 4158 }, | ||
161 | { .temp_c = 55, .ohm = 3536 }, | ||
162 | { .temp_c = 60, .ohm = 3019 }, | ||
163 | { .temp_c = 65, .ohm = 2588 }, | ||
164 | { .temp_c = 70, .ohm = 2227 }, | ||
165 | { .temp_c = 75, .ohm = 1924 }, | ||
166 | { .temp_c = 80, .ohm = 1668 }, | ||
167 | { .temp_c = 85, .ohm = 1451 }, | ||
168 | { .temp_c = 90, .ohm = 1266 }, | ||
169 | { .temp_c = 95, .ohm = 1108 }, | ||
170 | { .temp_c = 100, .ohm = 973 }, | ||
171 | { .temp_c = 105, .ohm = 857 }, | ||
172 | { .temp_c = 110, .ohm = 757 }, | ||
173 | { .temp_c = 115, .ohm = 671 }, | ||
174 | { .temp_c = 120, .ohm = 596 }, | ||
175 | { .temp_c = 125, .ohm = 531 }, | ||
176 | }; | ||
177 | |||
136 | struct ntc_data { | 178 | struct ntc_data { |
137 | struct device *hwmon_dev; | 179 | struct device *hwmon_dev; |
138 | struct ntc_thermistor_platform_data *pdata; | 180 | struct ntc_thermistor_platform_data *pdata; |
@@ -173,6 +215,8 @@ static const struct of_device_id ntc_match[] = { | |||
173 | .data = &ntc_thermistor_id[3] }, | 215 | .data = &ntc_thermistor_id[3] }, |
174 | { .compatible = "murata,ncp15wl333", | 216 | { .compatible = "murata,ncp15wl333", |
175 | .data = &ntc_thermistor_id[4] }, | 217 | .data = &ntc_thermistor_id[4] }, |
218 | { .compatible = "epcos,b57330v2103", | ||
219 | .data = &ntc_thermistor_id[5]}, | ||
176 | 220 | ||
177 | /* Usage of vendor name "ntc" is deprecated */ | 221 | /* Usage of vendor name "ntc" is deprecated */ |
178 | { .compatible = "ntc,ncp15wb473", | 222 | { .compatible = "ntc,ncp15wb473", |
@@ -490,6 +534,10 @@ static int ntc_thermistor_probe(struct platform_device *pdev) | |||
490 | data->comp = ncpXXwl333; | 534 | data->comp = ncpXXwl333; |
491 | data->n_comp = ARRAY_SIZE(ncpXXwl333); | 535 | data->n_comp = ARRAY_SIZE(ncpXXwl333); |
492 | break; | 536 | break; |
537 | case TYPE_B57330V2103: | ||
538 | data->comp = b57330v2103; | ||
539 | data->n_comp = ARRAY_SIZE(b57330v2103); | ||
540 | break; | ||
493 | default: | 541 | default: |
494 | dev_err(&pdev->dev, "Unknown device type: %lu(%s)\n", | 542 | dev_err(&pdev->dev, "Unknown device type: %lu(%s)\n", |
495 | pdev_id->driver_data, pdev_id->name); | 543 | pdev_id->driver_data, pdev_id->name); |
@@ -546,7 +594,7 @@ static struct platform_driver ntc_thermistor_driver = { | |||
546 | 594 | ||
547 | module_platform_driver(ntc_thermistor_driver); | 595 | module_platform_driver(ntc_thermistor_driver); |
548 | 596 | ||
549 | MODULE_DESCRIPTION("NTC Thermistor Driver from Murata"); | 597 | MODULE_DESCRIPTION("NTC Thermistor Driver"); |
550 | MODULE_AUTHOR("MyungJoo Ham <myungjoo.ham@samsung.com>"); | 598 | MODULE_AUTHOR("MyungJoo Ham <myungjoo.ham@samsung.com>"); |
551 | MODULE_LICENSE("GPL"); | 599 | MODULE_LICENSE("GPL"); |
552 | MODULE_ALIAS("platform:ntc-thermistor"); | 600 | MODULE_ALIAS("platform:ntc-thermistor"); |