#include <linux/device.h>
#include <linux/err.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/of.h>
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/platform_device.h>
#include <linux/of_device.h>
#include <linux/thermal.h>
#include <linux/iopoll.h>
#include <linux/mfd/syscon.h>
#include <linux/regmap.h>
#include <linux/interrupt.h>
#define PMU_TDC0_SW_RST_MASK …
#define PMU_TM_DISABLE_OFFS …
#define PMU_TM_DISABLE_MASK …
#define PMU_TDC0_REF_CAL_CNT_OFFS …
#define PMU_TDC0_REF_CAL_CNT_MASK …
#define PMU_TDC0_OTF_CAL_MASK …
#define PMU_TDC0_START_CAL_MASK …
#define A375_UNIT_CONTROL_SHIFT …
#define A375_UNIT_CONTROL_MASK …
#define A375_READOUT_INVERT …
#define A375_HW_RESETn …
#define CONTROL0_TSEN_TC_TRIM_MASK …
#define CONTROL0_TSEN_TC_TRIM_VAL …
#define CONTROL0_TSEN_START …
#define CONTROL0_TSEN_RESET …
#define CONTROL0_TSEN_ENABLE …
#define CONTROL0_TSEN_AVG_BYPASS …
#define CONTROL0_TSEN_CHAN_SHIFT …
#define CONTROL0_TSEN_CHAN_MASK …
#define CONTROL0_TSEN_OSR_SHIFT …
#define CONTROL0_TSEN_OSR_MAX …
#define CONTROL0_TSEN_MODE_SHIFT …
#define CONTROL0_TSEN_MODE_EXTERNAL …
#define CONTROL0_TSEN_MODE_MASK …
#define CONTROL1_TSEN_AVG_MASK …
#define CONTROL1_EXT_TSEN_SW_RESET …
#define CONTROL1_EXT_TSEN_HW_RESETn …
#define CONTROL1_TSEN_INT_EN …
#define CONTROL1_TSEN_SELECT_OFF …
#define CONTROL1_TSEN_SELECT_MASK …
#define STATUS_POLL_PERIOD_US …
#define STATUS_POLL_TIMEOUT_US …
#define OVERHEAT_INT_POLL_DELAY_MS …
struct armada_thermal_data;
struct armada_thermal_priv { … };
struct armada_thermal_data { … };
struct armada_drvdata { … };
struct armada_thermal_sensor { … };
static void armadaxp_init(struct platform_device *pdev,
struct armada_thermal_priv *priv)
{ … }
static void armada370_init(struct platform_device *pdev,
struct armada_thermal_priv *priv)
{ … }
static void armada375_init(struct platform_device *pdev,
struct armada_thermal_priv *priv)
{ … }
static int armada_wait_sensor_validity(struct armada_thermal_priv *priv)
{ … }
static void armada380_init(struct platform_device *pdev,
struct armada_thermal_priv *priv)
{ … }
static void armada_ap80x_init(struct platform_device *pdev,
struct armada_thermal_priv *priv)
{ … }
static void armada_cp110_init(struct platform_device *pdev,
struct armada_thermal_priv *priv)
{ … }
static bool armada_is_valid(struct armada_thermal_priv *priv)
{ … }
static void armada_enable_overheat_interrupt(struct armada_thermal_priv *priv)
{ … }
static void __maybe_unused
armada_disable_overheat_interrupt(struct armada_thermal_priv *priv)
{ … }
static int armada_select_channel(struct armada_thermal_priv *priv, int channel)
{ … }
static int armada_read_sensor(struct armada_thermal_priv *priv, int *temp)
{ … }
static int armada_get_temp_legacy(struct thermal_zone_device *thermal,
int *temp)
{ … }
static struct thermal_zone_device_ops legacy_ops = …;
static int armada_get_temp(struct thermal_zone_device *tz, int *temp)
{ … }
static const struct thermal_zone_device_ops of_ops = …;
static unsigned int armada_mc_to_reg_temp(struct armada_thermal_data *data,
unsigned int temp_mc)
{ … }
static unsigned int hyst_levels_mc[] = …;
static unsigned int armada_mc_to_reg_hyst(struct armada_thermal_data *data,
unsigned int hyst_mc)
{ … }
static void armada_set_overheat_thresholds(struct armada_thermal_priv *priv,
int thresh_mc, int hyst_mc)
{ … }
static irqreturn_t armada_overheat_isr(int irq, void *blob)
{ … }
static irqreturn_t armada_overheat_isr_thread(int irq, void *blob)
{ … }
static const struct armada_thermal_data armadaxp_data = …;
static const struct armada_thermal_data armada370_data = …;
static const struct armada_thermal_data armada375_data = …;
static const struct armada_thermal_data armada380_data = …;
static const struct armada_thermal_data armada_ap806_data = …;
static const struct armada_thermal_data armada_ap807_data = …;
static const struct armada_thermal_data armada_cp110_data = …;
static const struct of_device_id armada_thermal_id_table[] = …;
MODULE_DEVICE_TABLE(of, armada_thermal_id_table);
static const struct regmap_config armada_thermal_regmap_config = …;
static int armada_thermal_probe_legacy(struct platform_device *pdev,
struct armada_thermal_priv *priv)
{ … }
static int armada_thermal_probe_syscon(struct platform_device *pdev,
struct armada_thermal_priv *priv)
{ … }
static void armada_set_sane_name(struct platform_device *pdev,
struct armada_thermal_priv *priv)
{ … }
static int armada_configure_overheat_int(struct armada_thermal_priv *priv,
struct thermal_zone_device *tz,
int sensor_id)
{ … }
static int armada_thermal_probe(struct platform_device *pdev)
{ … }
static void armada_thermal_exit(struct platform_device *pdev)
{ … }
static struct platform_driver armada_thermal_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;