summaryrefslogtreecommitdiff
path: root/include/linux/intel_tcc.h
diff options
context:
space:
mode:
authorZhang Rui <rui.zhang@intel.com>2022-12-19 18:46:15 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2022-12-30 21:57:38 +0300
commita3c1f066e1c514ac819f5dae288cc8a59c384158 (patch)
tree6489ae4f2daea5b11977dc04d82b092de4874c50 /include/linux/intel_tcc.h
parentb878d3ba9bb41cddb73ba4b56e5552f0a638daca (diff)
downloadlinux-a3c1f066e1c514ac819f5dae288cc8a59c384158.tar.xz
thermal/intel: Introduce Intel TCC library
There are several different drivers that accesses the Intel TCC (thermal control circuitry) MSRs, and each of them has its own implementation for the same functionalities, e.g. getting the current temperature, getting the tj_max, and getting/setting the tj_max offset. Introduce a library to unify the code for Intel CPU TCC MSR access. At the same time, ensure the temperature is got based on the updated tjmax value because tjmax can be changed at runtime for cases like the Intel SST-PP (Intel Speed Select Technology - Performance Profile) level change. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/linux/intel_tcc.h')
-rw-r--r--include/linux/intel_tcc.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/intel_tcc.h b/include/linux/intel_tcc.h
new file mode 100644
index 000000000000..f422612c28d6
--- /dev/null
+++ b/include/linux/intel_tcc.h
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * header for Intel TCC (thermal control circuitry) library
+ *
+ * Copyright (C) 2022 Intel Corporation.
+ */
+
+#ifndef __INTEL_TCC_H__
+#define __INTEL_TCC_H__
+
+#include <linux/types.h>
+
+int intel_tcc_get_tjmax(int cpu);
+int intel_tcc_get_offset(int cpu);
+int intel_tcc_set_offset(int cpu, int offset);
+int intel_tcc_get_temp(int cpu, bool pkg);
+
+#endif /* __INTEL_TCC_H__ */