aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/platform_data
diff options
context:
space:
mode:
authorNaveen Krishna Chatradhi <ch.naveen@samsung.com>2013-03-13 00:08:20 -0400
committerGuenter Roeck <linux@roeck-us.net>2013-04-08 00:16:38 -0400
commit9e8269de100dd0be1199778dc175ff22417aebd2 (patch)
tree743aa1c1d90be98c11d297e055c557162e98d8c3 /include/linux/platform_data
parent4b5e536b0e948b5c756aa1d57218371c242f768d (diff)
hwmon: (ntc_thermistor) Add DT with IIO support to NTC thermistor driver
This patch adds DT support to NTC driver to parse the platform data. Also adds the support to work as an iio device client. During the probe ntc driver gets the respective channels of ADC and uses iio_raw_read calls to get the ADC converted value. Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com> [Guenter Roeck: fixed Kconfig dependencies; use ERR_CAST] Tested-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'include/linux/platform_data')
-rw-r--r--include/linux/platform_data/ntc_thermistor.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/linux/platform_data/ntc_thermistor.h b/include/linux/platform_data/ntc_thermistor.h
index 88734e871e3a..fa95f9cbe7ea 100644
--- a/include/linux/platform_data/ntc_thermistor.h
+++ b/include/linux/platform_data/ntc_thermistor.h
@@ -21,6 +21,8 @@
21#ifndef _LINUX_NTC_H 21#ifndef _LINUX_NTC_H
22#define _LINUX_NTC_H 22#define _LINUX_NTC_H
23 23
24struct iio_channel;
25
24enum ntc_thermistor_type { 26enum ntc_thermistor_type {
25 TYPE_NCPXXWB473, 27 TYPE_NCPXXWB473,
26 TYPE_NCPXXWL333, 28 TYPE_NCPXXWL333,
@@ -39,13 +41,17 @@ struct ntc_thermistor_platform_data {
39 * described at Documentation/hwmon/ntc_thermistor 41 * described at Documentation/hwmon/ntc_thermistor
40 * 42 *
41 * pullup/down_ohm: 0 for infinite / not-connected 43 * pullup/down_ohm: 0 for infinite / not-connected
44 *
45 * chan: iio_channel pointer to communicate with the ADC which the
46 * thermistor is using for conversion of the analog values.
42 */ 47 */
43 int (*read_uV)(void); 48 int (*read_uV)(struct ntc_thermistor_platform_data *);
44 unsigned int pullup_uV; 49 unsigned int pullup_uV;
45 50
46 unsigned int pullup_ohm; 51 unsigned int pullup_ohm;
47 unsigned int pulldown_ohm; 52 unsigned int pulldown_ohm;
48 enum { NTC_CONNECTED_POSITIVE, NTC_CONNECTED_GROUND } connect; 53 enum { NTC_CONNECTED_POSITIVE, NTC_CONNECTED_GROUND } connect;
54 struct iio_channel *chan;
49 55
50 int (*read_ohm)(void); 56 int (*read_ohm)(void);
51}; 57};