Skip to content

Commit 51c8e11

Browse files
wensdlezcano
authored andcommitted
thermal/drivers/mediatek/lvts_thermal: Register thermal zones as hwmon sensors
Register thermal zones as hwmon sensors to let userspace read temperatures using standard hwmon interface. Signed-off-by: Chen-Yu Tsai <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 8938202 commit 51c8e11

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/thermal/mediatek/lvts_thermal.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
#include <linux/thermal.h>
2020
#include <dt-bindings/thermal/mediatek,lvts-thermal.h>
2121

22+
#include "../thermal_hwmon.h"
23+
2224
#define LVTS_MONCTL0(__base) (__base + 0x0000)
2325
#define LVTS_MONCTL1(__base) (__base + 0x0004)
2426
#define LVTS_MONCTL2(__base) (__base + 0x0008)
@@ -996,6 +998,9 @@ static int lvts_ctrl_start(struct device *dev, struct lvts_ctrl *lvts_ctrl)
996998
return PTR_ERR(tz);
997999
}
9981000

1001+
if (devm_thermal_add_hwmon_sysfs(dev, tz))
1002+
dev_warn(dev, "zone %d: Failed to add hwmon sysfs attributes\n", dt_id);
1003+
9991004
/*
10001005
* The thermal zone pointer will be needed in the
10011006
* interrupt handler, we store it in the sensor

0 commit comments

Comments
 (0)