linux/drivers/thermal/intel/intel_pch_thermal.c

// SPDX-License-Identifier: GPL-2.0-only
/* intel_pch_thermal.c - Intel PCH Thermal driver
 *
 * Copyright (c) 2015, Intel Corporation.
 *
 * Authors:
 *     Tushar Dave <[email protected]>
 */

#include <linux/acpi.h>
#include <linux/delay.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/pm.h>
#include <linux/suspend.h>
#include <linux/thermal.h>
#include <linux/types.h>
#include <linux/units.h>

/* Intel PCH thermal Device IDs */
#define PCH_THERMAL_DID_HSW_1
#define PCH_THERMAL_DID_HSW_2
#define PCH_THERMAL_DID_WPT
#define PCH_THERMAL_DID_SKL
#define PCH_THERMAL_DID_SKL_H
#define PCH_THERMAL_DID_CNL
#define PCH_THERMAL_DID_CNL_H
#define PCH_THERMAL_DID_CNL_LP
#define PCH_THERMAL_DID_CML_H
#define PCH_THERMAL_DID_LWB
#define PCH_THERMAL_DID_WBG

/* Wildcat Point-LP  PCH Thermal registers */
#define WPT_TEMP
#define WPT_TSC
#define WPT_TSS
#define WPT_TSEL
#define WPT_TSREL
#define WPT_TSMIC
#define WPT_CTT
#define WPT_TSPM
#define WPT_TAHV
#define WPT_TALV
#define WPT_TL
#define WPT_PHL
#define WPT_PHLC
#define WPT_TAS
#define WPT_TSPIEN
#define WPT_TSGPEN

/*  Wildcat Point-LP  PCH Thermal Register bit definitions */
#define WPT_TEMP_TSR
#define WPT_TSC_CPDE
#define WPT_TSS_TSDSS
#define WPT_TSS_GPES
#define WPT_TSEL_ETS
#define WPT_TSEL_PLDB
#define WPT_TL_TOL
#define WPT_TL_T1L
#define WPT_TL_TTEN

/* Resolution of 1/2 degree C and an offset of -50C */
#define PCH_TEMP_OFFSET
#define GET_WPT_TEMP(x)
#define WPT_TEMP_OFFSET
#define GET_PCH_TEMP(x)

#define PCH_MAX_TRIPS

/* Amount of time for each cooling delay, 100ms by default for now */
static unsigned int delay_timeout =;
module_param(delay_timeout, int, 0644);
MODULE_PARM_DESC();

/* Number of iterations for cooling delay, 600 counts by default for now */
static unsigned int delay_cnt =;
module_param(delay_cnt, int, 0644);
MODULE_PARM_DESC();

static char driver_name[] =;

struct pch_thermal_device {};

#ifdef CONFIG_ACPI
/*
 * On some platforms, there is a companion ACPI device, which adds
 * passive trip temperature using _PSV method. There is no specific
 * passive temperature setting in MMIO interface of this PCI device.
 */
static int pch_wpt_add_acpi_psv_trip(struct pch_thermal_device *ptd,
				     struct thermal_trip *trip)
{}
#else
static int pch_wpt_add_acpi_psv_trip(struct pch_thermal_device *ptd,
				     struct thermal_trip *trip)
{
	return 0;
}
#endif

static int pch_thermal_get_temp(struct thermal_zone_device *tzd, int *temp)
{}

static void pch_critical(struct thermal_zone_device *tzd)
{}

static const struct thermal_zone_device_ops tzd_ops =;

enum pch_board_ids {};

static const char *board_names[] =;

static int intel_pch_thermal_probe(struct pci_dev *pdev,
				   const struct pci_device_id *id)
{}

static void intel_pch_thermal_remove(struct pci_dev *pdev)
{}

static int intel_pch_thermal_suspend_noirq(struct device *device)
{}

static int intel_pch_thermal_resume(struct device *device)
{}

static const struct pci_device_id intel_pch_thermal_id[] =;
MODULE_DEVICE_TABLE(pci, intel_pch_thermal_id);

static const struct dev_pm_ops intel_pch_pm_ops =;

static struct pci_driver intel_pch_thermal_driver =;

module_pci_driver();

MODULE_LICENSE();
MODULE_DESCRIPTION();