#include <linux/bitfield.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/errno.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/iopoll.h>
#include <linux/math.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/pm.h>
#include <linux/reset.h>
#include <linux/slab.h>
#include <linux/thermal.h>
#include <linux/types.h>
#include <soc/tegra/fuse.h>
#include "../thermal_hwmon.h"
#define TSENSOR_SENSOR0_CONFIG0 …
#define TSENSOR_SENSOR0_CONFIG0_SENSOR_STOP …
#define TSENSOR_SENSOR0_CONFIG0_HW_FREQ_DIV_EN …
#define TSENSOR_SENSOR0_CONFIG0_THERMAL_RST_EN …
#define TSENSOR_SENSOR0_CONFIG0_DVFS_EN …
#define TSENSOR_SENSOR0_CONFIG0_INTR_OVERFLOW_EN …
#define TSENSOR_SENSOR0_CONFIG0_INTR_HW_FREQ_DIV_EN …
#define TSENSOR_SENSOR0_CONFIG0_INTR_THERMAL_RST_EN …
#define TSENSOR_SENSOR0_CONFIG0_M …
#define TSENSOR_SENSOR0_CONFIG0_N …
#define TSENSOR_SENSOR0_CONFIG1 …
#define TSENSOR_SENSOR0_CONFIG1_TH1 …
#define TSENSOR_SENSOR0_CONFIG1_TH2 …
#define TSENSOR_SENSOR0_CONFIG2 …
#define TSENSOR_SENSOR0_CONFIG2_TH3 …
#define TSENSOR_SENSOR0_STATUS0 …
#define TSENSOR_SENSOR0_STATUS0_STATE …
#define TSENSOR_SENSOR0_STATUS0_INTR …
#define TSENSOR_SENSOR0_STATUS0_CURRENT_VALID …
#define TSENSOR_SENSOR0_TS_STATUS1 …
#define TSENSOR_SENSOR0_TS_STATUS1_CURRENT_COUNT …
#define TEGRA30_FUSE_TEST_PROG_VER …
#define TEGRA30_FUSE_TSENSOR_CALIB …
#define TEGRA30_FUSE_TSENSOR_CALIB_LOW …
#define TEGRA30_FUSE_TSENSOR_CALIB_HIGH …
#define TEGRA30_FUSE_SPARE_BIT …
struct tegra_tsensor;
struct tegra_tsensor_calibration_data { … };
struct tegra_tsensor_channel { … };
struct tegra_tsensor { … };
static int tegra_tsensor_hw_enable(const struct tegra_tsensor *ts)
{ … }
static int tegra_tsensor_hw_disable(const struct tegra_tsensor *ts)
{ … }
static void devm_tegra_tsensor_hw_disable(void *data)
{ … }
static int tegra_tsensor_get_temp(struct thermal_zone_device *tz, int *temp)
{ … }
static int tegra_tsensor_temp_to_counter(const struct tegra_tsensor *ts, int temp)
{ … }
static int tegra_tsensor_set_trips(struct thermal_zone_device *tz, int low, int high)
{ … }
static const struct thermal_zone_device_ops ops = …;
static bool
tegra_tsensor_handle_channel_interrupt(const struct tegra_tsensor *ts,
unsigned int id)
{ … }
static irqreturn_t tegra_tsensor_isr(int irq, void *data)
{ … }
static int tegra_tsensor_disable_hw_channel(const struct tegra_tsensor *ts,
unsigned int id)
{ … }
struct trip_temps { … };
static int tegra_tsensor_get_trips_cb(struct thermal_trip *trip, void *arg)
{ … }
static void tegra_tsensor_get_hw_channel_trips(struct thermal_zone_device *tzd,
struct trip_temps *temps)
{ … }
static int tegra_tsensor_enable_hw_channel(const struct tegra_tsensor *ts,
unsigned int id)
{ … }
static bool tegra_tsensor_fuse_read_spare(unsigned int spare)
{ … }
static int tegra_tsensor_nvmem_setup(struct tegra_tsensor *ts)
{ … }
static int tegra_tsensor_register_channel(struct tegra_tsensor *ts,
unsigned int id)
{ … }
static int tegra_tsensor_probe(struct platform_device *pdev)
{ … }
static int __maybe_unused tegra_tsensor_suspend(struct device *dev)
{ … }
static int __maybe_unused tegra_tsensor_resume(struct device *dev)
{ … }
static const struct dev_pm_ops tegra_tsensor_pm_ops = …;
static const struct of_device_id tegra_tsensor_of_match[] = …;
MODULE_DEVICE_TABLE(of, tegra_tsensor_of_match);
static struct platform_driver tegra_tsensor_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;