#include <linux/delay.h>
#include <linux/err.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/thermal.h>
#include "../thermal_hwmon.h"
#define REG_GEN3_IRQSTR …
#define REG_GEN3_IRQMSK …
#define REG_GEN3_IRQCTL …
#define REG_GEN3_IRQEN …
#define REG_GEN3_IRQTEMP1 …
#define REG_GEN3_IRQTEMP2 …
#define REG_GEN3_IRQTEMP3 …
#define REG_GEN3_THCTR …
#define REG_GEN3_TEMP …
#define REG_GEN3_THCODE1 …
#define REG_GEN3_THCODE2 …
#define REG_GEN3_THCODE3 …
#define REG_GEN3_PTAT1 …
#define REG_GEN3_PTAT2 …
#define REG_GEN3_PTAT3 …
#define REG_GEN3_THSCP …
#define REG_GEN4_THSFMON00 …
#define REG_GEN4_THSFMON01 …
#define REG_GEN4_THSFMON02 …
#define REG_GEN4_THSFMON15 …
#define REG_GEN4_THSFMON16 …
#define REG_GEN4_THSFMON17 …
#define IRQ_TEMP1 …
#define IRQ_TEMP2 …
#define IRQ_TEMP3 …
#define IRQ_TEMPD1 …
#define IRQ_TEMPD2 …
#define IRQ_TEMPD3 …
#define THCTR_PONM …
#define THCTR_THSST …
#define THSCP_COR_PARA_VLD …
#define CTEMP_MASK …
#define MCELSIUS(temp) …
#define GEN3_FUSE_MASK …
#define GEN4_FUSE_MASK …
#define TSC_MAX_NUM …
struct rcar_gen3_thermal_priv;
struct rcar_thermal_info { … };
struct equation_set_coef { … };
struct rcar_gen3_thermal_tsc { … };
struct rcar_gen3_thermal_priv { … };
static inline u32 rcar_gen3_thermal_read(struct rcar_gen3_thermal_tsc *tsc,
u32 reg)
{ … }
static inline void rcar_gen3_thermal_write(struct rcar_gen3_thermal_tsc *tsc,
u32 reg, u32 data)
{ … }
static void rcar_gen3_thermal_shared_coefs(struct rcar_gen3_thermal_priv *priv)
{ … }
static void rcar_gen3_thermal_tsc_coefs(struct rcar_gen3_thermal_priv *priv,
struct rcar_gen3_thermal_tsc *tsc)
{ … }
static int rcar_gen3_thermal_get_temp(struct thermal_zone_device *tz, int *temp)
{ … }
static int rcar_gen3_thermal_mcelsius_to_temp(struct rcar_gen3_thermal_tsc *tsc,
int mcelsius)
{ … }
static int rcar_gen3_thermal_set_trips(struct thermal_zone_device *tz, int low, int high)
{ … }
static const struct thermal_zone_device_ops rcar_gen3_tz_of_ops = …;
static irqreturn_t rcar_gen3_thermal_irq(int irq, void *data)
{ … }
static void rcar_gen3_thermal_read_fuses_gen3(struct rcar_gen3_thermal_priv *priv)
{ … }
static void rcar_gen3_thermal_read_fuses_gen4(struct rcar_gen3_thermal_priv *priv)
{ … }
static bool rcar_gen3_thermal_read_fuses(struct rcar_gen3_thermal_priv *priv)
{ … }
static void rcar_gen3_thermal_init(struct rcar_gen3_thermal_priv *priv,
struct rcar_gen3_thermal_tsc *tsc)
{ … }
static const struct rcar_thermal_info rcar_m3w_thermal_info = …;
static const struct rcar_thermal_info rcar_gen3_thermal_info = …;
static const struct rcar_thermal_info rcar_gen4_thermal_info = …;
static const struct of_device_id rcar_gen3_thermal_dt_ids[] = …;
MODULE_DEVICE_TABLE(of, rcar_gen3_thermal_dt_ids);
static void rcar_gen3_thermal_remove(struct platform_device *pdev)
{ … }
static void rcar_gen3_hwmon_action(void *data)
{ … }
static int rcar_gen3_thermal_request_irqs(struct rcar_gen3_thermal_priv *priv,
struct platform_device *pdev)
{ … }
static int rcar_gen3_thermal_probe(struct platform_device *pdev)
{ … }
static int __maybe_unused rcar_gen3_thermal_resume(struct device *dev)
{ … }
static SIMPLE_DEV_PM_OPS(rcar_gen3_thermal_pm_ops, NULL,
rcar_gen3_thermal_resume);
static struct platform_driver rcar_gen3_thermal_driver = …;
module_platform_driver(…) …;
MODULE_LICENSE(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;