diff options
author | Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> | 2023-10-03 11:49:14 -0700 |
---|---|---|
committer | Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> | 2023-10-04 11:12:11 +0300 |
commit | 8874e414fe78718d0f2861fe511cecbd1cd73f4d (patch) | |
tree | 6d48b329f62b6118bf0e2d402825652e5c96ca72 /include/linux/intel_tpmi.h | |
parent | 23f392ea6d1916f68be8067e2a038ef9a746a94b (diff) | |
download | lwn-8874e414fe78718d0f2861fe511cecbd1cd73f4d.tar.gz lwn-8874e414fe78718d0f2861fe511cecbd1cd73f4d.zip |
platform/x86/intel/tpmi: Add defines to get version information
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 <srinivas.pandruvada@linux.intel.com>
Link: https://lore.kernel.org/r/20231003184916.1860084-2-srinivas.pandruvada@linux.intel.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Diffstat (limited to 'include/linux/intel_tpmi.h')
-rw-r--r-- | include/linux/intel_tpmi.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/intel_tpmi.h b/include/linux/intel_tpmi.h index 04d937ad4dc4..ee07393445f9 100644 --- a/include/linux/intel_tpmi.h +++ b/include/linux/intel_tpmi.h @@ -6,6 +6,12 @@ #ifndef _INTEL_TPMI_H_ #define _INTEL_TPMI_H_ +#include <linux/bitfield.h> + +#define TPMI_VERSION_INVALID 0xff +#define TPMI_MINOR_VERSION(val) FIELD_GET(GENMASK(4, 0), val) +#define TPMI_MAJOR_VERSION(val) FIELD_GET(GENMASK(7, 5), val) + /** * struct intel_tpmi_plat_info - Platform information for a TPMI device instance * @package_id: CPU Package id |