summaryrefslogtreecommitdiff
path: root/drivers/platform/x86/amd/hsmp/plat.c
diff options
context:
space:
mode:
authorSuma Hegde <suma.hegde@amd.com>2025-05-06 10:15:41 +0000
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>2025-05-12 13:20:17 +0300
commit92c025db52bb94a032eb3d473bb81e62c19ddbd3 (patch)
tree1f640553a5d195ece3585fa34aac092fc68b556a /drivers/platform/x86/amd/hsmp/plat.c
parentcf8dea42e42b243e41878b57c0ecd898688234e6 (diff)
platform/x86/amd/hsmp: Report power via hwmon sensors
Expose power reading and power limits via hwmon power sensors. Signed-off-by: Suma Hegde <suma.hegde@amd.com> Reviewed-by: Naveen Krishna Chatradhi <naveenkrishna.chatradhi@amd.com> Link: https://lore.kernel.org/r/20250506101542.200811-2-suma.hegde@amd.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 'drivers/platform/x86/amd/hsmp/plat.c')
-rw-r--r--drivers/platform/x86/amd/hsmp/plat.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/platform/x86/amd/hsmp/plat.c b/drivers/platform/x86/amd/hsmp/plat.c
index 4f03fdf988c1..0881d7e01936 100644
--- a/drivers/platform/x86/amd/hsmp/plat.c
+++ b/drivers/platform/x86/amd/hsmp/plat.c
@@ -189,6 +189,11 @@ static int init_platform_device(struct device *dev)
if (ret)
dev_err(dev, "Failed to init metric table\n");
}
+
+ /* Register with hwmon interface for reporting power */
+ ret = hsmp_create_sensor(dev, i);
+ if (ret)
+ dev_err(dev, "Failed to register HSMP sensors with hwmon\n");
}
return 0;