#define pr_fmt(fmt) …
#include <linux/module.h>
#include <linux/init.h>
#include <linux/intel_tcc.h>
#include <linux/err.h>
#include <linux/param.h>
#include <linux/device.h>
#include <linux/platform_device.h>
#include <linux/cpu.h>
#include <linux/smp.h>
#include <linux/slab.h>
#include <linux/pm.h>
#include <linux/thermal.h>
#include <linux/debugfs.h>
#include <asm/cpu_device_id.h>
#include "thermal_interrupt.h"
#define PKG_TEMP_THERMAL_NOTIFY_DELAY …
static int notify_delay_ms = …;
module_param(notify_delay_ms, int, 0644);
MODULE_PARM_DESC(…) …;
#define MAX_NUMBER_OF_TRIPS …
struct zone_device { … };
static struct thermal_zone_params pkg_temp_tz_params = …;
static int max_id __read_mostly;
static struct zone_device **zones;
static DEFINE_RAW_SPINLOCK(pkg_temp_lock);
static DEFINE_MUTEX(thermal_zone_mutex);
static enum cpuhp_state pkg_thermal_hp_state __read_mostly;
static struct dentry *debugfs;
static unsigned int pkg_interrupt_cnt;
static unsigned int pkg_work_cnt;
static void pkg_temp_debugfs_init(void)
{ … }
static struct zone_device *pkg_temp_thermal_get_dev(unsigned int cpu)
{ … }
static int sys_get_curr_temp(struct thermal_zone_device *tzd, int *temp)
{ … }
static int
sys_set_trip_temp(struct thermal_zone_device *tzd,
const struct thermal_trip *trip, int temp)
{ … }
static const struct thermal_zone_device_ops tzone_ops = …;
static bool pkg_thermal_rate_control(void)
{ … }
static inline void enable_pkg_thres_interrupt(void)
{ … }
static inline void disable_pkg_thres_interrupt(void)
{ … }
static void pkg_temp_thermal_threshold_work_fn(struct work_struct *work)
{ … }
static void pkg_thermal_schedule_work(int cpu, struct delayed_work *work)
{ … }
static int pkg_thermal_notify(u64 msr_val)
{ … }
static int pkg_temp_thermal_trips_init(int cpu, int tj_max,
struct thermal_trip *trips, int num_trips)
{ … }
static int pkg_temp_thermal_device_add(unsigned int cpu)
{ … }
static int pkg_thermal_cpu_offline(unsigned int cpu)
{ … }
static int pkg_thermal_cpu_online(unsigned int cpu)
{ … }
static const struct x86_cpu_id __initconst pkg_temp_thermal_ids[] = …;
MODULE_DEVICE_TABLE(x86cpu, pkg_temp_thermal_ids);
static int __init pkg_temp_thermal_init(void)
{ … }
module_init(…) …
static void __exit pkg_temp_thermal_exit(void)
{ … }
module_exit(…)
MODULE_IMPORT_NS(…);
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;