treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156
[linux-block.git] / include / linux / platform_data / ntc_thermistor.h
CommitLineData
1a59d1b8 1/* SPDX-License-Identifier: GPL-2.0-or-later */
f22aaaa7
DK
2/*
3 * ntc_thermistor.h - NTC Thermistors
4 *
5 * Copyright (C) 2010 Samsung Electronics
6 * MyungJoo Ham <myungjoo.ham@samsung.com>
f22aaaa7
DK
7 */
8#ifndef _LINUX_NTC_H
9#define _LINUX_NTC_H
10
9e8269de
NKC
11struct iio_channel;
12
f22aaaa7 13enum ntc_thermistor_type {
ed67f087 14 TYPE_B57330V2103,
737c086e
PR
15 TYPE_B57891S0103,
16 TYPE_NCPXXWB473,
887ee434 17 TYPE_NCPXXWF104,
737c086e 18 TYPE_NCPXXWL333,
54ce3a0d 19 TYPE_NCPXXXH103,
f22aaaa7
DK
20};
21
22struct 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
7ebd8b66 32 * described at Documentation/hwmon/ntc_thermistor.rst
f22aaaa7
DK
33 *
34 * pullup/down_ohm: 0 for infinite / not-connected
9e8269de
NKC
35 *
36 * chan: iio_channel pointer to communicate with the ADC which the
37 * thermistor is using for conversion of the analog values.
f22aaaa7 38 */
088ce2ac
GR
39 int (*read_uv)(struct ntc_thermistor_platform_data *);
40 unsigned int pullup_uv;
f22aaaa7
DK
41
42 unsigned int pullup_ohm;
43 unsigned int pulldown_ohm;
44 enum { NTC_CONNECTED_POSITIVE, NTC_CONNECTED_GROUND } connect;
9e8269de 45 struct iio_channel *chan;
f22aaaa7
DK
46
47 int (*read_ohm)(void);
48};
49
50#endif /* _LINUX_NTC_H */