diff options
author | Naveen Krishna Chatradhi <ch.naveen@samsung.com> | 2013-03-13 04:08:20 (GMT) |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2013-04-08 04:16:38 (GMT) |
commit | 9e8269de100dd0be1199778dc175ff22417aebd2 (patch) | |
tree | 743aa1c1d90be98c11d297e055c557162e98d8c3 /include/linux/platform_data | |
parent | 4b5e536b0e948b5c756aa1d57218371c242f768d (diff) | |
download | linux-fsl-qoriq-9e8269de100dd0be1199778dc175ff22417aebd2.tar.xz |
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.h | 8 |
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 88734e8..fa95f9c 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); }; |