summaryrefslogtreecommitdiff
path: root/include/linux/intel_rapl.h
diff options
context:
space:
mode:
authorZhang Rui <rui.zhang@intel.com>2019-07-10 21:44:26 +0800
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2019-07-11 15:08:57 +0200
commit7fde2712a7adab721eaabafbd8ff93dff3262d35 (patch)
tree602f362ed14e8d75e953c572493511bd77b56ffa /include/linux/intel_rapl.h
parent7ebf8eff63b4f349e7b2ded6aa5036d94bdf94b9 (diff)
downloadlwn-7fde2712a7adab721eaabafbd8ff93dff3262d35.tar.gz
lwn-7fde2712a7adab721eaabafbd8ff93dff3262d35.zip
intel_rapl: abstract register address
MSR and MMIO RAPL interface have different sets of registers, thus the RAPL register address should be obtained from interface specific structure, i.e. struct rapl_if_private, instead. Reviewed-by: Pandruvada, Srinivas <srinivas.pandruvada@intel.com> Tested-by: Pandruvada, Srinivas <srinivas.pandruvada@intel.com> 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_rapl.h')
-rw-r--r--include/linux/intel_rapl.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/intel_rapl.h b/include/linux/intel_rapl.h
index 7bf1683e4a63..ec2c9e83274f 100644
--- a/include/linux/intel_rapl.h
+++ b/include/linux/intel_rapl.h
@@ -95,11 +95,15 @@ struct rapl_domain {
* @platform_rapl_domain: Optional. Some RAPL interface may have platform
* level RAPL control.
* @pcap_rapl_online: CPU hotplug state for each RAPL interface.
+ * @reg_unit: Register for getting energy/power/time unit.
+ * @regs: Register sets for different RAPL Domains.
*/
struct rapl_if_priv {
struct powercap_control_type *control_type;
struct rapl_domain *platform_rapl_domain;
enum cpuhp_state pcap_rapl_online;
+ u32 reg_unit;
+ u32 regs[RAPL_DOMAIN_MAX][RAPL_DOMAIN_REG_MAX];
};
/* maximum rapl package domain name: package-%d-die-%d */