Commit 85f0ad22 authored by Yangtao Li's avatar Yangtao Li Committed by Daniel Lezcano
Browse files

thermal: sun8i: Add hwmon support

parent 291292cd
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -20,6 +20,8 @@
#include <linux/slab.h>
#include <linux/thermal.h>

#include "thermal_hwmon.h"

#define MAX_SENSOR_NUM	4

#define FT_TEMP_MASK				GENMASK(11, 0)
@@ -471,6 +473,10 @@ static int sun8i_ths_register(struct ths_device *tmdev)
							     &ths_ops);
		if (IS_ERR(tmdev->sensor[i].tzd))
			return PTR_ERR(tmdev->sensor[i].tzd);

		if (devm_thermal_add_hwmon_sysfs(tmdev->sensor[i].tzd))
			dev_warn(tmdev->dev,
				 "Failed to add hwmon sysfs attributes\n");
	}

	return 0;