All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] thermal: imx8mm: register with hwmon subsystem
@ 2022-07-22 16:58 ` Lucas Stach
  0 siblings, 0 replies; 4+ messages in thread
From: Lucas Stach @ 2022-07-22 16:58 UTC (permalink / raw)
  To: Rafael J . Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui
  Cc: Pengutronix Kernel Team, NXP Linux Team, linux-pm,
	linux-arm-kernel, patchwork-lst

Provide standard sensor monitoring via the HWMON subsystem by
registering the sensors with hwmon when CONFIG_THERMAL_HWMON is
enabled.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 drivers/thermal/imx8mm_thermal.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/thermal/imx8mm_thermal.c b/drivers/thermal/imx8mm_thermal.c
index af666bd9e8d4..74120edbbdfd 100644
--- a/drivers/thermal/imx8mm_thermal.c
+++ b/drivers/thermal/imx8mm_thermal.c
@@ -16,6 +16,7 @@
 #include <linux/thermal.h>
 
 #include "thermal_core.h"
+#include "thermal_hwmon.h"
 
 #define TER			0x0	/* TMU enable */
 #define TPS			0x4
@@ -176,6 +177,10 @@ static int imx8mm_tmu_probe(struct platform_device *pdev)
 			goto disable_clk;
 		}
 		tmu->sensors[i].hw_id = i;
+
+		if (devm_thermal_add_hwmon_sysfs(tmu->sensors[i].tzd))
+			dev_warn(&pdev->dev,
+				 "Failed to add hwmon sysfs attributes\n");
 	}
 
 	platform_set_drvdata(pdev, tmu);
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-07-25 12:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-22 16:58 [PATCH] thermal: imx8mm: register with hwmon subsystem Lucas Stach
2022-07-22 16:58 ` Lucas Stach
2022-07-25 12:35 ` Daniel Lezcano
2022-07-25 12:35   ` Daniel Lezcano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.