diff options
| author | Beomho Seo <beomho.seo@samsung.com> | 2015-04-30 00:07:43 -0400 |
|---|---|---|
| committer | Guenter Roeck <linux@roeck-us.net> | 2015-06-01 01:58:36 -0400 |
| commit | 887ee43477e4e327dbcd2aabc2d78a5116ed8a33 (patch) | |
| tree | 8211102c2ffe169be775ad90a5443dee81570983 | |
| parent | c65b99f046843d2455aa231747b5a07a999a9f3d (diff) | |
hwmon: (ntc_thermistor) Add support for ncpXXwf104
This patch adds support for the ntc thermistor NCPXXWF104 series.
Cc: Jean Delvare <jdelvare@suse.de>
Cc: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Beomho Seo <beomho.seo@samsung.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| -rw-r--r-- | Documentation/devicetree/bindings/hwmon/ntc_thermistor.txt | 1 | ||||
| -rw-r--r-- | Documentation/hwmon/ntc_thermistor | 6 | ||||
| -rw-r--r-- | drivers/hwmon/Kconfig | 4 | ||||
| -rw-r--r-- | drivers/hwmon/ntc_thermistor.c | 44 | ||||
| -rw-r--r-- | include/linux/platform_data/ntc_thermistor.h | 1 |
5 files changed, 52 insertions, 4 deletions
diff --git a/Documentation/devicetree/bindings/hwmon/ntc_thermistor.txt b/Documentation/devicetree/bindings/hwmon/ntc_thermistor.txt index fcca8e744f41..a04a80f9cc70 100644 --- a/Documentation/devicetree/bindings/hwmon/ntc_thermistor.txt +++ b/Documentation/devicetree/bindings/hwmon/ntc_thermistor.txt | |||
| @@ -9,6 +9,7 @@ Requires node properties: | |||
| 9 | "murata,ncp21wb473" | 9 | "murata,ncp21wb473" |
| 10 | "murata,ncp03wb473" | 10 | "murata,ncp03wb473" |
| 11 | "murata,ncp15wl333" | 11 | "murata,ncp15wl333" |
| 12 | "murata,ncp03wf104" | ||
| 12 | 13 | ||
| 13 | /* Usage of vendor name "ntc" is deprecated */ | 14 | /* Usage of vendor name "ntc" is deprecated */ |
| 14 | <DEPRECATED> "ntc,ncp15wb473" | 15 | <DEPRECATED> "ntc,ncp15wb473" |
diff --git a/Documentation/hwmon/ntc_thermistor b/Documentation/hwmon/ntc_thermistor index c5e05e2900a3..1d4cc847c6fe 100644 --- a/Documentation/hwmon/ntc_thermistor +++ b/Documentation/hwmon/ntc_thermistor | |||
| @@ -2,8 +2,10 @@ Kernel driver ntc_thermistor | |||
| 2 | ================= | 2 | ================= |
| 3 | 3 | ||
| 4 | Supported thermistors from Murata: | 4 | Supported thermistors from Murata: |
| 5 | * Murata NTC Thermistors NCP15WB473, NCP18WB473, NCP21WB473, NCP03WB473, NCP15WL333 | 5 | * Murata NTC Thermistors NCP15WB473, NCP18WB473, NCP21WB473, NCP03WB473, |
| 6 | Prefixes: 'ncp15wb473', 'ncp18wb473', 'ncp21wb473', 'ncp03wb473', 'ncp15wl333' | 6 | NCP15WL333, NCP03WF104 |
| 7 | Prefixes: 'ncp15wb473', 'ncp18wb473', 'ncp21wb473', 'ncp03wb473', | ||
| 8 | 'ncp15wl333', 'ncp03wf104' | ||
| 7 | Datasheet: Publicly available at Murata | 9 | Datasheet: Publicly available at Murata |
| 8 | 10 | ||
| 9 | Supported thermistors from EPCOS: | 11 | Supported thermistors from EPCOS: |
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig index 25d9e72627e9..4542ffc5468a 100644 --- a/drivers/hwmon/Kconfig +++ b/drivers/hwmon/Kconfig | |||
| @@ -1106,8 +1106,8 @@ config SENSORS_NTC_THERMISTOR | |||
| 1106 | send notifications about the temperature. | 1106 | send notifications about the temperature. |
| 1107 | 1107 | ||
| 1108 | Currently, this driver supports | 1108 | Currently, this driver supports |
| 1109 | NCP15WB473, NCP18WB473, NCP21WB473, NCP03WB473, and NCP15WL333 | 1109 | NCP15WB473, NCP18WB473, NCP21WB473, NCP03WB473, NCP15WL333, |
| 1110 | from Murata and B57330V2103 from EPCOS. | 1110 | and NCP03WF104 from Murata and B57330V2103 from EPCOS. |
| 1111 | 1111 | ||
| 1112 | This driver can also be built as a module. If so, the module | 1112 | This driver can also be built as a module. If so, the module |
| 1113 | will be called ntc-thermistor. | 1113 | will be called ntc-thermistor. |
diff --git a/drivers/hwmon/ntc_thermistor.c b/drivers/hwmon/ntc_thermistor.c index 68800115876b..fca92912269e 100644 --- a/drivers/hwmon/ntc_thermistor.c +++ b/drivers/hwmon/ntc_thermistor.c | |||
| @@ -53,6 +53,7 @@ static const struct platform_device_id ntc_thermistor_id[] = { | |||
| 53 | { "ncp03wb473", TYPE_NCPXXWB473 }, | 53 | { "ncp03wb473", TYPE_NCPXXWB473 }, |
| 54 | { "ncp15wl333", TYPE_NCPXXWL333 }, | 54 | { "ncp15wl333", TYPE_NCPXXWL333 }, |
| 55 | { "b57330v2103", TYPE_B57330V2103}, | 55 | { "b57330v2103", TYPE_B57330V2103}, |
| 56 | { "ncp03wf104", TYPE_NCPXXWF104 }, | ||
| 56 | { }, | 57 | { }, |
| 57 | }; | 58 | }; |
| 58 | 59 | ||
| @@ -135,6 +136,43 @@ static const struct ntc_compensation ncpXXwl333[] = { | |||
| 135 | { .temp_c = 125, .ohm = 707 }, | 136 | { .temp_c = 125, .ohm = 707 }, |
| 136 | }; | 137 | }; |
| 137 | 138 | ||
| 139 | static const struct ntc_compensation ncpXXwf104[] = { | ||
| 140 | { .temp_c = -40, .ohm = 4397119 }, | ||
| 141 | { .temp_c = -35, .ohm = 3088599 }, | ||
| 142 | { .temp_c = -30, .ohm = 2197225 }, | ||
| 143 | { .temp_c = -25, .ohm = 1581881 }, | ||
| 144 | { .temp_c = -20, .ohm = 1151037 }, | ||
| 145 | { .temp_c = -15, .ohm = 846579 }, | ||
| 146 | { .temp_c = -10, .ohm = 628988 }, | ||
| 147 | { .temp_c = -5, .ohm = 471632 }, | ||
| 148 | { .temp_c = 0, .ohm = 357012 }, | ||
| 149 | { .temp_c = 5, .ohm = 272500 }, | ||
| 150 | { .temp_c = 10, .ohm = 209710 }, | ||
| 151 | { .temp_c = 15, .ohm = 162651 }, | ||
| 152 | { .temp_c = 20, .ohm = 127080 }, | ||
| 153 | { .temp_c = 25, .ohm = 100000 }, | ||
| 154 | { .temp_c = 30, .ohm = 79222 }, | ||
| 155 | { .temp_c = 35, .ohm = 63167 }, | ||
| 156 | { .temp_c = 40, .ohm = 50677 }, | ||
| 157 | { .temp_c = 45, .ohm = 40904 }, | ||
| 158 | { .temp_c = 50, .ohm = 33195 }, | ||
| 159 | { .temp_c = 55, .ohm = 27091 }, | ||
| 160 | { .temp_c = 60, .ohm = 22224 }, | ||
| 161 | { .temp_c = 65, .ohm = 18323 }, | ||
| 162 | { .temp_c = 70, .ohm = 15184 }, | ||
| 163 | { .temp_c = 75, .ohm = 12635 }, | ||
| 164 | { .temp_c = 80, .ohm = 10566 }, | ||
| 165 | { .temp_c = 85, .ohm = 8873 }, | ||
| 166 | { .temp_c = 90, .ohm = 7481 }, | ||
| 167 | { .temp_c = 95, .ohm = 6337 }, | ||
| 168 | { .temp_c = 100, .ohm = 5384 }, | ||
| 169 | { .temp_c = 105, .ohm = 4594 }, | ||
| 170 | { .temp_c = 110, .ohm = 3934 }, | ||
| 171 | { .temp_c = 115, .ohm = 3380 }, | ||
| 172 | { .temp_c = 120, .ohm = 2916 }, | ||
| 173 | { .temp_c = 125, .ohm = 2522 }, | ||
| 174 | }; | ||
| 175 | |||
| 138 | /* | 176 | /* |
| 139 | * The following compensation table is from the specification of EPCOS NTC | 177 | * The following compensation table is from the specification of EPCOS NTC |
| 140 | * Thermistors Datasheet | 178 | * Thermistors Datasheet |
| @@ -219,6 +257,8 @@ static const struct of_device_id ntc_match[] = { | |||
| 219 | .data = &ntc_thermistor_id[4] }, | 257 | .data = &ntc_thermistor_id[4] }, |
| 220 | { .compatible = "epcos,b57330v2103", | 258 | { .compatible = "epcos,b57330v2103", |
| 221 | .data = &ntc_thermistor_id[5]}, | 259 | .data = &ntc_thermistor_id[5]}, |
| 260 | { .compatible = "murata,ncp03wf104", | ||
| 261 | .data = &ntc_thermistor_id[6] }, | ||
| 222 | 262 | ||
| 223 | /* Usage of vendor name "ntc" is deprecated */ | 263 | /* Usage of vendor name "ntc" is deprecated */ |
| 224 | { .compatible = "ntc,ncp15wb473", | 264 | { .compatible = "ntc,ncp15wb473", |
| @@ -567,6 +607,10 @@ static int ntc_thermistor_probe(struct platform_device *pdev) | |||
| 567 | data->comp = b57330v2103; | 607 | data->comp = b57330v2103; |
| 568 | data->n_comp = ARRAY_SIZE(b57330v2103); | 608 | data->n_comp = ARRAY_SIZE(b57330v2103); |
| 569 | break; | 609 | break; |
| 610 | case TYPE_NCPXXWF104: | ||
| 611 | data->comp = ncpXXwf104; | ||
| 612 | data->n_comp = ARRAY_SIZE(ncpXXwf104); | ||
| 613 | break; | ||
| 570 | default: | 614 | default: |
| 571 | dev_err(&pdev->dev, "Unknown device type: %lu(%s)\n", | 615 | dev_err(&pdev->dev, "Unknown device type: %lu(%s)\n", |
| 572 | pdev_id->driver_data, pdev_id->name); | 616 | pdev_id->driver_data, pdev_id->name); |
diff --git a/include/linux/platform_data/ntc_thermistor.h b/include/linux/platform_data/ntc_thermistor.h index 0a6de4ca4930..aed170588b74 100644 --- a/include/linux/platform_data/ntc_thermistor.h +++ b/include/linux/platform_data/ntc_thermistor.h | |||
| @@ -27,6 +27,7 @@ enum ntc_thermistor_type { | |||
| 27 | TYPE_NCPXXWB473, | 27 | TYPE_NCPXXWB473, |
| 28 | TYPE_NCPXXWL333, | 28 | TYPE_NCPXXWL333, |
| 29 | TYPE_B57330V2103, | 29 | TYPE_B57330V2103, |
| 30 | TYPE_NCPXXWF104, | ||
| 30 | }; | 31 | }; |
| 31 | 32 | ||
| 32 | struct ntc_thermistor_platform_data { | 33 | struct ntc_thermistor_platform_data { |
