Skip to content

Commit

Permalink
hwmon: Add amd_energy driver to report energy counters
Browse files Browse the repository at this point in the history
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 <linux@roeck-us.net>
Signed-off-by: Naveen Krishna Chatradhi <nchatrad@amd.com>
Link: https://lore.kernel.org/r/20200519155011.56184-1-nchatrad@amd.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
  • Loading branch information
Naveen Krishna Chatradhi authored and Guenter Roeck committed May 22, 2020
1 parent d06f9e6 commit 8abee95
Show file tree
Hide file tree
Showing 3 changed files with 417 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/hwmon/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,16 @@ config SENSORS_FAM15H_POWER
This driver can also be built as a module. If so, the module
will be called fam15h_power.

config SENSORS_AMD_ENERGY
tristate "AMD RAPL MSR based Energy driver"
depends on X86
help
If you say yes here you get support for core and package energy
sensors, based on RAPL MSR for AMD family 17h and above CPUs.

This driver can also be built as a module. If so, the module
will be called as amd_energy.

config SENSORS_APPLESMC
tristate "Apple SMC (Motion sensor, light sensor, keyboard backlight)"
depends on INPUT && X86
Expand Down
1 change: 1 addition & 0 deletions drivers/hwmon/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ obj-$(CONFIG_SENSORS_ADT7411) += adt7411.o
obj-$(CONFIG_SENSORS_ADT7462) += adt7462.o
obj-$(CONFIG_SENSORS_ADT7470) += adt7470.o
obj-$(CONFIG_SENSORS_ADT7475) += adt7475.o
obj-$(CONFIG_SENSORS_AMD_ENERGY) += amd_energy.o
obj-$(CONFIG_SENSORS_APPLESMC) += applesmc.o
obj-$(CONFIG_SENSORS_ARM_SCMI) += scmi-hwmon.o
obj-$(CONFIG_SENSORS_ARM_SCPI) += scpi-hwmon.o
Expand Down
Loading

0 comments on commit 8abee95

Please sign in to comment.