Skip to content

Commit 8abee95

Browse files
nchatradgroeck
authored andcommitted
hwmon: Add amd_energy driver to report energy counters
This patch adds hwmon based amd_energy driver support for family 17h processors from AMD. The driver provides following interface to the userspace 1. Reports the per core consumption * file: "energy%d_input", label: "Ecore%03d" 2. Reports per socket energy consumption * file: "energy%d_input", label: "Esocket%d" 3. To, increase the wrap around time of the socket energy counters, a 64bit accumultor is implemented. 4. Reports scaled energy value in Joules. Cc: Guenter Roeck <[email protected]> Signed-off-by: Naveen Krishna Chatradhi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
1 parent d06f9e6 commit 8abee95

File tree

3 files changed

+417
-0
lines changed

3 files changed

+417
-0
lines changed

drivers/hwmon/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,16 @@ config SENSORS_FAM15H_POWER
324324
This driver can also be built as a module. If so, the module
325325
will be called fam15h_power.
326326

327+
config SENSORS_AMD_ENERGY
328+
tristate "AMD RAPL MSR based Energy driver"
329+
depends on X86
330+
help
331+
If you say yes here you get support for core and package energy
332+
sensors, based on RAPL MSR for AMD family 17h and above CPUs.
333+
334+
This driver can also be built as a module. If so, the module
335+
will be called as amd_energy.
336+
327337
config SENSORS_APPLESMC
328338
tristate "Apple SMC (Motion sensor, light sensor, keyboard backlight)"
329339
depends on INPUT && X86

drivers/hwmon/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ obj-$(CONFIG_SENSORS_ADT7411) += adt7411.o
4545
obj-$(CONFIG_SENSORS_ADT7462) += adt7462.o
4646
obj-$(CONFIG_SENSORS_ADT7470) += adt7470.o
4747
obj-$(CONFIG_SENSORS_ADT7475) += adt7475.o
48+
obj-$(CONFIG_SENSORS_AMD_ENERGY) += amd_energy.o
4849
obj-$(CONFIG_SENSORS_APPLESMC) += applesmc.o
4950
obj-$(CONFIG_SENSORS_ARM_SCMI) += scmi-hwmon.o
5051
obj-$(CONFIG_SENSORS_ARM_SCPI) += scpi-hwmon.o

0 commit comments

Comments
 (0)