#include <linux/bitops.h>
#include <linux/delay.h>
#include <linux/err.h>
#include <linux/iio/consumer.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/thermal.h>
#include "../thermal_hwmon.h"
#define QPNP_TM_REG_DIG_MAJOR …
#define QPNP_TM_REG_TYPE …
#define QPNP_TM_REG_SUBTYPE …
#define QPNP_TM_REG_STATUS …
#define QPNP_TM_REG_SHUTDOWN_CTRL1 …
#define QPNP_TM_REG_ALARM_CTRL …
#define QPNP_TM_TYPE …
#define QPNP_TM_SUBTYPE_GEN1 …
#define QPNP_TM_SUBTYPE_GEN2 …
#define STATUS_GEN1_STAGE_MASK …
#define STATUS_GEN2_STATE_MASK …
#define STATUS_GEN2_STATE_SHIFT …
#define SHUTDOWN_CTRL1_OVERRIDE_S2 …
#define SHUTDOWN_CTRL1_THRESHOLD_MASK …
#define SHUTDOWN_CTRL1_RATE_25HZ …
#define ALARM_CTRL_FORCE_ENABLE …
#define THRESH_COUNT …
#define STAGE_COUNT …
static const long temp_map_gen1[THRESH_COUNT][STAGE_COUNT] = …;
static const long temp_map_gen2_v1[THRESH_COUNT][STAGE_COUNT] = …;
#define TEMP_THRESH_STEP …
#define THRESH_MIN …
#define THRESH_MAX …
#define TEMP_STAGE_HYSTERESIS …
#define DEFAULT_TEMP …
struct qpnp_tm_chip { … };
static const unsigned int alarm_state_map[8] = …;
static int qpnp_tm_read(struct qpnp_tm_chip *chip, u16 addr, u8 *data)
{ … }
static int qpnp_tm_write(struct qpnp_tm_chip *chip, u16 addr, u8 data)
{ … }
static long qpnp_tm_decode_temp(struct qpnp_tm_chip *chip, unsigned int stage)
{ … }
static int qpnp_tm_get_temp_stage(struct qpnp_tm_chip *chip)
{ … }
static int qpnp_tm_update_temp_no_adc(struct qpnp_tm_chip *chip)
{ … }
static int qpnp_tm_get_temp(struct thermal_zone_device *tz, int *temp)
{ … }
static int qpnp_tm_update_critical_trip_temp(struct qpnp_tm_chip *chip,
int temp)
{ … }
static int qpnp_tm_set_trip_temp(struct thermal_zone_device *tz,
const struct thermal_trip *trip, int temp)
{ … }
static const struct thermal_zone_device_ops qpnp_tm_sensor_ops = …;
static irqreturn_t qpnp_tm_isr(int irq, void *data)
{ … }
static int qpnp_tm_get_critical_trip_temp(struct qpnp_tm_chip *chip)
{ … }
static int qpnp_tm_init(struct qpnp_tm_chip *chip)
{ … }
static int qpnp_tm_probe(struct platform_device *pdev)
{ … }
static const struct of_device_id qpnp_tm_match_table[] = …;
MODULE_DEVICE_TABLE(of, qpnp_tm_match_table);
static struct platform_driver qpnp_tm_driver = …;
module_platform_driver(…) …;
MODULE_ALIAS(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;