From: Andrey Smirnov Subject: [PATCH v5 12/12] thermal: qoriq: Add hwmon support Date: Tue, 23 Apr 2019 23:48:30 -0700 Message-ID: <20190424064830.18179-13-andrew.smirnov@gmail.com> References: <20190424064830.18179-1-andrew.smirnov@gmail.com> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: <20190424064830.18179-1-andrew.smirnov@gmail.com> Sender: linux-kernel-owner@vger.kernel.org To: linux-pm@vger.kernel.org Cc: Andrey Smirnov , Daniel Lezcano , Lucas Stach , Chris Healy , Eduardo Valentin , Angus Ainslie , linux-imx@nxp.com, linux-kernel@vger.kernel.org List-Id: linux-pm@vger.kernel.org Expose thermal readings as a HWMON device, so that it could be accessed using lm-sensors. Signed-off-by: Andrey Smirnov Reviewed-by: Daniel Lezcano Tested-by: Lucas Stach Cc: Chris Healy Cc: Lucas Stach Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: Angus Ainslie (Purism) Cc: linux-imx@nxp.com Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/thermal/qoriq_thermal.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/thermal/qoriq_thermal.c b/drivers/thermal/qoriq_thermal.c index f97d0cc82b2b..c93732639f78 100644 --- a/drivers/thermal/qoriq_thermal.c +++ b/drivers/thermal/qoriq_thermal.c @@ -12,6 +12,7 @@ #include #include "thermal_core.h" +#include "thermal_hwmon.h" #define SITES_MAX 16 @@ -96,6 +97,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; -- 2.20.1