Skip to content

Commit f0a6c43

Browse files
spandruvadagregkh
authored andcommitted
platform/x86/intel/tpmi: Add defines to get version information
[ Upstream commit 8874e41 ] Add defines to get major and minor version from a TPMI version field value. This will avoid code duplication to convert in every feature driver. Also add define for invalid version field. Signed-off-by: Srinivas Pandruvada <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]> Stable-dep-of: 1d39092 ("powercap: intel_rapl_tpmi: Ignore minor version change") Signed-off-by: Sasha Levin <[email protected]>
1 parent 1e4a5ee commit f0a6c43

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

include/linux/intel_tpmi.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
#ifndef _INTEL_TPMI_H_
77
#define _INTEL_TPMI_H_
88

9+
#include <linux/bitfield.h>
10+
11+
#define TPMI_VERSION_INVALID 0xff
12+
#define TPMI_MINOR_VERSION(val) FIELD_GET(GENMASK(4, 0), val)
13+
#define TPMI_MAJOR_VERSION(val) FIELD_GET(GENMASK(7, 5), val)
14+
915
/**
1016
* struct intel_tpmi_plat_info - Platform information for a TPMI device instance
1117
* @package_id: CPU Package id

0 commit comments

Comments
 (0)