blob: 10b37980910e819ee3e9dbe43964906571a9331f [file] [log] [blame]
/* SPDX-License-Identifier: GPL-2.0 */
/*
* The driver is developed based on ntc_thermistor driver.
*
* Copyright 2019 Google LLC.
*/
#ifndef _LINUX_PTC_H
#define _LINUX_PTC_H
struct iio_channel;
enum ptc_thermistor_type {
TYPE_TMP6331DECR_VBIAS_1_8_V_100000_OHM,
};
struct ptc_thermistor_platform_data {
/*
* One (not both) of read_uV and read_ohm should be provided and only
* one of the two should be provided.
* Both functions should return negative value for an error case.
*
* pullup_uV and pull_ohm, and connect are required to use
* read_uV()
*
* How to setup pull_ohm, and connect is
* described at Documentation/hwmon/ptc_thermistor
*
* pull_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)(struct ptc_thermistor_platform_data *pdata);
unsigned int pullup_uv;
unsigned int pull_ohm;
enum { PTC_CONNECTED_POSITIVE, PTC_CONNECTED_GROUND } connect;
struct iio_channel *chan;
int (*read_ohm)(void);
};
#endif /* _LINUX_PTC_H */