Skip to content

Commit ee35f72

Browse files
lumagdlezcano
authored andcommitted
thermal/drivers/qcom/spmi-adc-tm5: Register thermal zones as hwmon sensors
Register thermal zones as hwmon sensors to let userspace read temperatures using standard hwmon interface. Signed-off-by: Dmitry Baryshkov <[email protected]> Reviewed-by: Bhupesh Sharma <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Daniel Lezcano <[email protected]>
1 parent fb55b01 commit ee35f72

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/thermal/qcom/qcom-spmi-adc-tm5.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#include <linux/thermal.h>
2121
#include <asm-generic/unaligned.h>
2222

23+
#include "../thermal_hwmon.h"
24+
2325
/*
2426
* Thermal monitoring block consists of 8 (ADC_TM5_NUM_CHANNELS) channels. Each
2527
* channel is programmed to use one of ADC channels for voltage comparison.
@@ -687,6 +689,9 @@ static int adc_tm5_register_tzd(struct adc_tm5_chip *adc_tm)
687689
return PTR_ERR(tzd);
688690
}
689691
adc_tm->channels[i].tzd = tzd;
692+
if (devm_thermal_add_hwmon_sysfs(tzd))
693+
dev_warn(adc_tm->dev,
694+
"Failed to add hwmon sysfs attributes\n");
690695
}
691696

692697
return 0;

0 commit comments

Comments
 (0)