#include <linux/acpi.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/thermal.h>
#include "int340x_thermal_zone.h"
#include "processor_thermal_device.h"
#define DRV_NAME …
static bool use_msi;
module_param(use_msi, bool, 0644);
MODULE_PARM_DESC(…) …;
struct proc_thermal_pci { … };
enum proc_thermal_mmio_type { … };
struct proc_thermal_mmio_info { … };
static struct proc_thermal_mmio_info proc_thermal_mmio_info[] = …;
enum proc_thermal_msi_ids { … };
static int proc_thermal_msi_map[MSI_THERMAL_MAX];
#define B0D4_THERMAL_NOTIFY_DELAY …
static int notify_delay_ms = …;
static void proc_thermal_mmio_read(struct proc_thermal_pci *pci_info,
enum proc_thermal_mmio_type type,
u32 *value)
{ … }
static void proc_thermal_mmio_write(struct proc_thermal_pci *pci_info,
enum proc_thermal_mmio_type type,
u32 value)
{ … }
static void proc_thermal_threshold_work_fn(struct work_struct *work)
{ … }
static void pkg_thermal_schedule_work(struct delayed_work *work)
{ … }
static void proc_thermal_clear_soc_int_status(struct proc_thermal_device *proc_priv)
{ … }
static irqreturn_t proc_thermal_irq_thread_handler(int irq, void *devid)
{ … }
static int proc_thermal_match_msi_irq(int irq)
{ … }
static irqreturn_t proc_thermal_irq_handler(int irq, void *devid)
{ … }
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 int get_trip_temp(struct proc_thermal_pci *pci_info)
{ … }
static const struct thermal_zone_device_ops tzone_ops = …;
static struct thermal_zone_params tzone_params = …;
static bool msi_irq;
static void proc_thermal_free_msi(struct pci_dev *pdev, struct proc_thermal_pci *pci_info)
{ … }
static int proc_thermal_setup_msi(struct pci_dev *pdev, struct proc_thermal_pci *pci_info)
{ … }
static int proc_thermal_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
{ … }
static void proc_thermal_pci_remove(struct pci_dev *pdev)
{ … }
#ifdef CONFIG_PM_SLEEP
static int proc_thermal_pci_suspend(struct device *dev)
{ … }
static int proc_thermal_pci_resume(struct device *dev)
{ … }
#else
#define proc_thermal_pci_suspend …
#define proc_thermal_pci_resume …
#endif
static SIMPLE_DEV_PM_OPS(proc_thermal_pci_pm, proc_thermal_pci_suspend,
proc_thermal_pci_resume);
static const struct pci_device_id proc_thermal_pci_ids[] = …;
MODULE_DEVICE_TABLE(pci, proc_thermal_pci_ids);
static struct pci_driver proc_thermal_pci_driver = …;
module_pci_driver(…) …;
MODULE_IMPORT_NS(…);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;