Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

thermal/drivers/qcom/temp-alarm: 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 <dmitry.baryshkov@linaro.org>
Reviewed-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Link: https://lore.kernel.org/r/20220719054940.755907-1-dmitry.baryshkov@linaro.org
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>

authored by

Dmitry Baryshkov and committed by
Daniel Lezcano
fb55b012 8cf18eea

+5
+5
drivers/thermal/qcom/qcom-spmi-temp-alarm.c
··· 16 16 #include <linux/thermal.h> 17 17 18 18 #include "../thermal_core.h" 19 + #include "../thermal_hwmon.h" 19 20 20 21 #define QPNP_TM_REG_DIG_MAJOR 0x01 21 22 #define QPNP_TM_REG_TYPE 0x04 ··· 458 457 dev_err(&pdev->dev, "init failed\n"); 459 458 return ret; 460 459 } 460 + 461 + if (devm_thermal_add_hwmon_sysfs(chip->tz_dev)) 462 + dev_warn(&pdev->dev, 463 + "Failed to add hwmon sysfs attributes\n"); 461 464 462 465 ret = devm_request_threaded_irq(&pdev->dev, irq, NULL, qpnp_tm_isr, 463 466 IRQF_ONESHOT, node->name, chip);