From: Hoan Nguyen An <na-h...@jinso.co.jp>

Gen3 thermal registered by devm_thermal_zone_of_sensor_register()
and this function does not enable hwmon sysfs extensions.
This patch enables it to keep compatibility to common systems

Signed-off-by: Hoan Nguyen An <na-h...@jinso.co.jp>
---
 drivers/thermal/rcar_gen3_thermal.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/thermal/rcar_gen3_thermal.c 
b/drivers/thermal/rcar_gen3_thermal.c
index 75786cc..ae172db 100644
--- a/drivers/thermal/rcar_gen3_thermal.c
+++ b/drivers/thermal/rcar_gen3_thermal.c
@@ -19,6 +19,7 @@
 #include <linux/thermal.h>
 
 #include "thermal_core.h"
+#include "thermal_hwmon.h"
 
 /* Register offsets */
 #define REG_GEN3_IRQSTR                0x04
@@ -429,6 +430,12 @@ static int rcar_gen3_thermal_probe(struct platform_device 
*pdev)
                if (ret < 0)
                        goto error_unregister;
 
+               /* Enable hwmon thermal sysfs */
+               tsc->zone->tzp->no_hwmon = false;
+               ret = thermal_add_hwmon_sysfs(tsc->zone);
+               if (ret)
+                       dev_err(dev, "Can't register hwmon sysfs\n");
+
                dev_info(dev, "TSC%d: Loaded %d trip points\n", i, ret);
        }
 
-- 
2.7.4

Reply via email to