Commit f22aaaa7 authored by Donggeun Kim's avatar Donggeun Kim Committed by Guenter Roeck

hwmon: Driver for NTC Thermistors

Add support for NTC Thermistor series. In this release, the
following thermistors are supported: NCP15WB473, NCP18WB473, NCP03WB473,
and NCP15WL333. This driver is based on the datasheet of MURATA.

The driver in the patch does conversion from the raw ADC value
(either voltage or resistence) to temperature. In order to use
voltage values as input, the circuit schematics should be provided
with the platform data. A compensation table for each type of thermistor
is provided for the conversion.
Signed-off-by: default avatarDonggeun Kim <dg77.kim@samsung.com>
Signed-off-by: default avatarMyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: default avatarKyungMin Park <kyungmin.park@samsung.com>
Reviewed-by: default avatarShubhrajyoti D <shubhrajyoti@ti.com>
Signed-off-by: default avatarGuenter Roeck <guenter.roeck@ericsson.com>
parent dabaa0d2
Kernel driver ntc_thermistor
=================
Supported thermistors:
* Murata NTC Thermistors NCP15WB473, NCP18WB473, NCP21WB473, NCP03WB473, NCP15WL333
Prefixes: 'ncp15wb473', 'ncp18wb473', 'ncp21wb473', 'ncp03wb473', 'ncp15wl333'
Datasheet: Publicly available at Murata
Other NTC thermistors can be supported simply by adding compensation
tables; e.g., NCP15WL333 support is added by the table ncpXXwl333.
Authors:
MyungJoo Ham <myungjoo.ham@samsung.com>
Description
-----------
The NTC thermistor is a simple thermistor that requires users to provide the
resistance and lookup the corresponding compensation table to get the
temperature input.
The NTC driver provides lookup tables with a linear approximation function
and four circuit models with an option not to use any of the four models.
The four circuit models provided are:
$: resister, [TH]: the thermistor
1. connect = NTC_CONNECTED_POSITIVE, pullup_ohm > 0
[pullup_uV]
| |
[TH] $ (pullup_ohm)
| |
+----+-----------------------[read_uV]
|
$ (pulldown_ohm)
|
--- (ground)
2. connect = NTC_CONNECTED_POSITIVE, pullup_ohm = 0 (not-connected)
[pullup_uV]
|
[TH]
|
+----------------------------[read_uV]
|
$ (pulldown_ohm)
|
--- (ground)
3. connect = NTC_CONNECTED_GROUND, pulldown_ohm > 0
[pullup_uV]
|
$ (pullup_ohm)
|
+----+-----------------------[read_uV]
| |
[TH] $ (pulldown_ohm)
| |
-------- (ground)
4. connect = NTC_CONNECTED_GROUND, pulldown_ohm = 0 (not-connected)
[pullup_uV]
|
$ (pullup_ohm)
|
+----------------------------[read_uV]
|
[TH]
|
--- (ground)
When one of the four circuit models is used, read_uV, pullup_uV, pullup_ohm,
pulldown_ohm, and connect should be provided. When none of the four models
are suitable or the user can get the resistance directly, the user should
provide read_ohm and _not_ provide the others.
Sysfs Interface
---------------
name the mandatory global attribute, the thermistor name.
temp1_type always 4 (thermistor)
RO
temp1_input measure the temperature and provide the measured value.
(reading this file initiates the reading procedure.)
RO
Note that each NTC thermistor has only _one_ thermistor; thus, only temp1 exists.
......@@ -777,6 +777,20 @@ config SENSORS_MAX6650
This driver can also be built as a module. If so, the module
will be called max6650.
config SENSORS_NTC_THERMISTOR
tristate "NTC thermistor support"
depends on EXPERIMENTAL
help
This driver supports NTC thermistors sensor reading and its
interpretation. The driver can also monitor the temperature and
send notifications about the temperature.
Currently, this driver supports
NCP15WB473, NCP18WB473, NCP21WB473, NCP03WB473, and NCP15WL333.
This driver can also be built as a module. If so, the module
will be called ntc-thermistor.
config SENSORS_PC87360
tristate "National Semiconductor PC87360 family"
select HWMON_VID
......
......@@ -92,6 +92,7 @@ obj-$(CONFIG_SENSORS_MAX6639) += max6639.o
obj-$(CONFIG_SENSORS_MAX6642) += max6642.o
obj-$(CONFIG_SENSORS_MAX6650) += max6650.o
obj-$(CONFIG_SENSORS_MC13783_ADC)+= mc13783-adc.o
obj-$(CONFIG_SENSORS_NTC_THERMISTOR) += ntc_thermistor.o
obj-$(CONFIG_SENSORS_PC87360) += pc87360.o
obj-$(CONFIG_SENSORS_PC87427) += pc87427.o
obj-$(CONFIG_SENSORS_PCF8591) += pcf8591.o
......
This diff is collapsed.
/*
* ntc_thermistor.h - NTC Thermistors
*
* Copyright (C) 2010 Samsung Electronics
* MyungJoo Ham <myungjoo.ham@samsung.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _LINUX_NTC_H
#define _LINUX_NTC_H
enum ntc_thermistor_type {
TYPE_NCPXXWB473,
TYPE_NCPXXWL333,
};
struct ntc_thermistor_platform_data {
/*
* One (not both) of read_uV and read_ohm should be provided and only
* one of the two should be provided.
* Both functions should return negative value for an error case.
*
* pullup_uV, pullup_ohm, pulldown_ohm, and connect are required to use
* read_uV()
*
* How to setup pullup_ohm, pulldown_ohm, and connect is
* described at Documentation/hwmon/ntc
*
* pullup/down_ohm: 0 for infinite / not-connected
*/
int (*read_uV)(void);
unsigned int pullup_uV;
unsigned int pullup_ohm;
unsigned int pulldown_ohm;
enum { NTC_CONNECTED_POSITIVE, NTC_CONNECTED_GROUND } connect;
int (*read_ohm)(void);
};
#endif /* _LINUX_NTC_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment