• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3  * ntc_thermistor.h - NTC Thermistors
4  *
5  *  Copyright (C) 2010 Samsung Electronics
6  *  MyungJoo Ham <myungjoo.ham@samsung.com>
7  */
8 #ifndef _LINUX_NTC_H
9 #define _LINUX_NTC_H
10 
11 struct iio_channel;
12 
13 enum ntc_thermistor_type {
14 	TYPE_B57330V2103,
15 	TYPE_B57891S0103,
16 	TYPE_NCPXXWB473,
17 	TYPE_NCPXXWF104,
18 	TYPE_NCPXXWL333,
19 	TYPE_NCPXXXH103,
20 };
21 
22 struct ntc_thermistor_platform_data {
23 	/*
24 	 * One (not both) of read_uV and read_ohm should be provided and only
25 	 * one of the two should be provided.
26 	 * Both functions should return negative value for an error case.
27 	 *
28 	 * pullup_uV, pullup_ohm, pulldown_ohm, and connect are required to use
29 	 * read_uV()
30 	 *
31 	 * How to setup pullup_ohm, pulldown_ohm, and connect is
32 	 * described at Documentation/hwmon/ntc_thermistor.rst
33 	 *
34 	 * pullup/down_ohm: 0 for infinite / not-connected
35 	 *
36 	 * chan: iio_channel pointer to communicate with the ADC which the
37 	 * thermistor is using for conversion of the analog values.
38 	 */
39 	int (*read_uv)(struct ntc_thermistor_platform_data *);
40 	unsigned int pullup_uv;
41 
42 	unsigned int pullup_ohm;
43 	unsigned int pulldown_ohm;
44 	enum { NTC_CONNECTED_POSITIVE, NTC_CONNECTED_GROUND } connect;
45 	struct iio_channel *chan;
46 
47 	int (*read_ohm)(void);
48 };
49 
50 #endif /* _LINUX_NTC_H */
51