aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Smirnov <[email protected]>2019-12-10 08:41:53 -0800
committerDaniel Lezcano <[email protected]>2020-01-27 10:24:32 +0100
commitfd8433099c5b78c2a1915e1b9911ecfdfc041103 (patch)
treebf19772188916c3f002639e75aa428b88387b541
parentc7fc403e40b0ea18976a59e968c23439a80809e8 (diff)
thermal: qoriq: Add hwmon support
Expose thermal readings as a HWMON device, so that it could be accessed using lm-sensors. Signed-off-by: Andrey Smirnov <[email protected]> Reviewed-by: Daniel Lezcano <[email protected]> Tested-by: Lucas Stach <[email protected]> Cc: Chris Healy <[email protected]> Cc: Lucas Stach <[email protected]> Cc: Eduardo Valentin <[email protected]> Cc: Daniel Lezcano <[email protected]> Cc: Angus Ainslie (Purism) <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
-rw-r--r--drivers/thermal/qoriq_thermal.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/thermal/qoriq_thermal.c b/drivers/thermal/qoriq_thermal.c
index 1730dbe5eeb6..874bc46e6c73 100644
--- a/drivers/thermal/qoriq_thermal.c
+++ b/drivers/thermal/qoriq_thermal.c
@@ -14,6 +14,7 @@
#include <linux/thermal.h>
#include "thermal_core.h"
+#include "thermal_hwmon.h"
#define SITES_MAX 16
#define TMR_DISABLE 0x0
@@ -140,6 +141,11 @@ static int qoriq_tmu_register_tmu_zone(struct device *dev,
regmap_write(qdata->regmap, REGS_TMR, TMR_DISABLE);
return ret;
}
+
+ if (devm_thermal_add_hwmon_sysfs(tzd))
+ dev_warn(dev,
+ "Failed to add hwmon sysfs attributes\n");
+
}
return 0;