From 9e8269de100dd0be1199778dc175ff22417aebd2 Mon Sep 17 00:00:00 2001 From: Naveen Krishna Chatradhi Date: Wed, 13 Mar 2013 09:38:20 +0530 Subject: 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 [Guenter Roeck: fixed Kconfig dependencies; use ERR_CAST] Tested-by: Doug Anderson Signed-off-by: Guenter Roeck --- include/linux/platform_data/ntc_thermistor.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include') 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 @@ #ifndef _LINUX_NTC_H #define _LINUX_NTC_H +struct iio_channel; + enum ntc_thermistor_type { TYPE_NCPXXWB473, TYPE_NCPXXWL333, @@ -39,13 +41,17 @@ struct ntc_thermistor_platform_data { * described at Documentation/hwmon/ntc_thermistor * * pullup/down_ohm: 0 for infinite / not-connected + * + * chan: iio_channel pointer to communicate with the ADC which the + * thermistor is using for conversion of the analog values. */ - int (*read_uV)(void); + int (*read_uV)(struct ntc_thermistor_platform_data *); unsigned int pullup_uV; unsigned int pullup_ohm; unsigned int pulldown_ohm; enum { NTC_CONNECTED_POSITIVE, NTC_CONNECTED_GROUND } connect; + struct iio_channel *chan; int (*read_ohm)(void); }; -- cgit From 088ce2ac9ebac5c74faf4d39083627875fa6f0f0 Mon Sep 17 00:00:00 2001 From: Guenter Roeck Date: Wed, 13 Mar 2013 16:40:39 -0700 Subject: hwmon: Fix CamelCase checkpatch warnings Signed-off-by: Guenter Roeck --- include/linux/platform_data/ntc_thermistor.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/linux/platform_data/ntc_thermistor.h b/include/linux/platform_data/ntc_thermistor.h index fa95f9cbe7ea..c7285b575462 100644 --- a/include/linux/platform_data/ntc_thermistor.h +++ b/include/linux/platform_data/ntc_thermistor.h @@ -45,8 +45,8 @@ struct ntc_thermistor_platform_data { * chan: iio_channel pointer to communicate with the ADC which the * thermistor is using for conversion of the analog values. */ - int (*read_uV)(struct ntc_thermistor_platform_data *); - unsigned int pullup_uV; + int (*read_uv)(struct ntc_thermistor_platform_data *); + unsigned int pullup_uv; unsigned int pullup_ohm; unsigned int pulldown_ohm; -- cgit