linux/drivers/thermal/intel/int340x_thermal/processor_thermal_device.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * processor_thermal_device.h
 * Copyright (c) 2020, Intel Corporation.
 */

#ifndef __PROCESSOR_THERMAL_DEVICE_H__
#define __PROCESSOR_THERMAL_DEVICE_H__

#include <linux/intel_rapl.h>

#define PCI_DEVICE_ID_INTEL_ADL_THERMAL
#define PCI_DEVICE_ID_INTEL_ARL_S_THERMAL
#define PCI_DEVICE_ID_INTEL_BDW_THERMAL
#define PCI_DEVICE_ID_INTEL_BSW_THERMAL

#define PCI_DEVICE_ID_INTEL_BXT0_THERMAL
#define PCI_DEVICE_ID_INTEL_BXT1_THERMAL
#define PCI_DEVICE_ID_INTEL_BXTX_THERMAL
#define PCI_DEVICE_ID_INTEL_BXTP_THERMAL

#define PCI_DEVICE_ID_INTEL_CNL_THERMAL
#define PCI_DEVICE_ID_INTEL_CFL_THERMAL
#define PCI_DEVICE_ID_INTEL_GLK_THERMAL
#define PCI_DEVICE_ID_INTEL_HSB_THERMAL
#define PCI_DEVICE_ID_INTEL_ICL_THERMAL
#define PCI_DEVICE_ID_INTEL_JSL_THERMAL
#define PCI_DEVICE_ID_INTEL_LNLM_THERMAL
#define PCI_DEVICE_ID_INTEL_MTLP_THERMAL
#define PCI_DEVICE_ID_INTEL_RPL_THERMAL
#define PCI_DEVICE_ID_INTEL_SKL_THERMAL
#define PCI_DEVICE_ID_INTEL_TGL_THERMAL

struct power_config {};

struct proc_thermal_device {};

struct rapl_mmio_regs {};

#define PROC_THERMAL_FEATURE_NONE
#define PROC_THERMAL_FEATURE_RAPL
#define PROC_THERMAL_FEATURE_FIVR
#define PROC_THERMAL_FEATURE_DVFS
#define PROC_THERMAL_FEATURE_WT_REQ
#define PROC_THERMAL_FEATURE_DLVR
#define PROC_THERMAL_FEATURE_WT_HINT
#define PROC_THERMAL_FEATURE_POWER_FLOOR
#define PROC_THERMAL_FEATURE_MSI_SUPPORT

#if IS_ENABLED(CONFIG_PROC_THERMAL_MMIO_RAPL)
int proc_thermal_rapl_add(struct pci_dev *pdev, struct proc_thermal_device *proc_priv);
void proc_thermal_rapl_remove(void);
#else
static int __maybe_unused proc_thermal_rapl_add(struct pci_dev *pdev,
						struct proc_thermal_device *proc_priv)
{
	return 0;
}

static void __maybe_unused proc_thermal_rapl_remove(void)
{
}
#endif

int proc_thermal_rfim_add(struct pci_dev *pdev, struct proc_thermal_device *proc_priv);
void proc_thermal_rfim_remove(struct pci_dev *pdev);

int proc_thermal_wt_req_add(struct pci_dev *pdev, struct proc_thermal_device *proc_priv);
void proc_thermal_wt_req_remove(struct pci_dev *pdev);

#define MBOX_CMD_WORKLOAD_TYPE_READ
#define MBOX_CMD_WORKLOAD_TYPE_WRITE

#define MBOX_DATA_BIT_AC_DC
#define MBOX_DATA_BIT_VALID

#define SOC_WT_RES_INT_STATUS_OFFSET
#define SOC_WT_RES_INT_STATUS_MASK

int proc_thermal_read_power_floor_status(struct proc_thermal_device *proc_priv);
int proc_thermal_power_floor_set_state(struct proc_thermal_device *proc_priv, bool enable);
bool proc_thermal_power_floor_get_state(struct proc_thermal_device *proc_priv);
void proc_thermal_power_floor_intr_callback(struct pci_dev *pdev,
					    struct proc_thermal_device *proc_priv);
bool proc_thermal_check_power_floor_intr(struct proc_thermal_device *proc_priv);

int processor_thermal_send_mbox_read_cmd(struct pci_dev *pdev, u16 id, u64 *resp);
int processor_thermal_send_mbox_write_cmd(struct pci_dev *pdev, u16 id, u32 data);
int processor_thermal_mbox_interrupt_config(struct pci_dev *pdev, bool enable, int enable_bit,
					    int time_window);
int proc_thermal_add(struct device *dev, struct proc_thermal_device *priv);
void proc_thermal_remove(struct proc_thermal_device *proc_priv);

int proc_thermal_wt_hint_add(struct pci_dev *pdev, struct proc_thermal_device *proc_priv);
void proc_thermal_wt_hint_remove(struct pci_dev *pdev);
void proc_thermal_wt_intr_callback(struct pci_dev *pdev, struct proc_thermal_device *proc_priv);
bool proc_thermal_check_wt_intr(struct proc_thermal_device *proc_priv);

int proc_thermal_suspend(struct device *dev);
int proc_thermal_resume(struct device *dev);
int proc_thermal_mmio_add(struct pci_dev *pdev,
			  struct proc_thermal_device *proc_priv,
			  kernel_ulong_t feature_mask);
void proc_thermal_mmio_remove(struct pci_dev *pdev, struct proc_thermal_device *proc_priv);
#endif