From c503193934fe39f0006180cd061d7a9b11b0b3d2 Mon Sep 17 00:00:00 2001 From: Ricardo Pardini Date: Thu, 28 Jan 2021 15:14:31 +0100 Subject: [PATCH] meson-64: Expose Amlogic thermal as HWMON devices (#2586) - this lets lm-sensors see the ddr/cpu temps, on HC4 at least Signed-off-by: Ricardo Pardini --- ...al_amlogic_thermal_add_hwmon_support.patch | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 patch/kernel/meson64-current/thermal_amlogic_thermal_add_hwmon_support.patch diff --git a/patch/kernel/meson64-current/thermal_amlogic_thermal_add_hwmon_support.patch b/patch/kernel/meson64-current/thermal_amlogic_thermal_add_hwmon_support.patch new file mode 100644 index 0000000000..ec7a18bbd7 --- /dev/null +++ b/patch/kernel/meson64-current/thermal_amlogic_thermal_add_hwmon_support.patch @@ -0,0 +1,44 @@ +From 719854edeb7c2c85901031f3062e89fafa66ea1b Mon Sep 17 00:00:00 2001 +From: Dongjin Kim +Date: Wed, 25 Nov 2020 03:43:28 +0900 +Subject: [PATCH] thermal: amlogic_thermal: Add hwmon support + +Expose Amlogic thermal as HWMON devices. + + $ sensors + cpu_thermal-virtual-0 + Adapter: Virtual device + temp1: +32.2 C (crit = +110.0 C) + + ddr_thermal-virtual-0 + Adapter: Virtual device + temp1: +33.4 C (crit = +110.0 C) + +Signed-off-by: Dongjin Kim +Change-Id: Icb1bf7cd7e4462f9923af5bcd72fa7c0c8e14cc9 +--- + drivers/thermal/amlogic_thermal.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/drivers/thermal/amlogic_thermal.c b/drivers/thermal/amlogic_thermal.c +index ccb1fe18e9931..2fce96c32586f 100644 +--- a/drivers/thermal/amlogic_thermal.c ++++ b/drivers/thermal/amlogic_thermal.c +@@ -29,6 +29,7 @@ + #include + + #include "thermal_core.h" ++#include "thermal_hwmon.h" + + #define TSENSOR_CFG_REG1 0x4 + #define TSENSOR_CFG_REG1_RSET_VBG BIT(12) +@@ -291,6 +292,9 @@ static int amlogic_thermal_probe(struct platform_device *pdev) + if (ret) + return ret; + ++ if (devm_thermal_add_hwmon_sysfs(pdata->tzd)) ++ dev_warn(&pdev->dev, "failed to add hwmon sysfs attributes\n"); ++ + ret = amlogic_thermal_enable(pdata); + + return ret;