Skip to content

Commit 9e5f5f1

Browse files
mmin86dlezcano
authored andcommitted
thermal/drivers/k3: Add hwmon support
Expose the thermal sensors on K3 AM654 as hwmon devices, so that temperatures could be read using lm-sensors. Signed-off-by: Massimiliano Minella <massimiliano.minella@gmail.com> Link: https://lore.kernel.org/r/20220401151656.913166-1-massimiliano.minella@se.com Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
1 parent 96f6f33 commit 9e5f5f1

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

drivers/thermal/k3_bandgap.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#include <linux/thermal.h>
1717
#include <linux/types.h>
1818

19+
#include "thermal_hwmon.h"
20+
1921
#define K3_VTM_DEVINFO_PWR0_OFFSET 0x4
2022
#define K3_VTM_DEVINFO_PWR0_TEMPSENS_CT_MASK 0xf0
2123
#define K3_VTM_TMPSENS0_CTRL_OFFSET 0x80
@@ -219,6 +221,9 @@ static int k3_bandgap_probe(struct platform_device *pdev)
219221
ret = PTR_ERR(data[id].tzd);
220222
goto err_alloc;
221223
}
224+
225+
if (devm_thermal_add_hwmon_sysfs(data[id].tzd))
226+
dev_warn(dev, "Failed to add hwmon sysfs attributes\n");
222227
}
223228

224229
platform_set_drvdata(pdev, bgp);

0 commit comments

Comments
 (0)