diff mbox series

[v2,1/1] thermal: imx8mm: Add hwmon support

Message ID 20220726122331.323093-1-alexander.stein@ew.tq-group.com (mailing list archive)
State New, archived
Delegated to: Daniel Lezcano
Headers show
Series [v2,1/1] thermal: imx8mm: Add hwmon support | expand

Commit Message

Alexander Stein July 26, 2022, 12:23 p.m. UTC
Expose thermal sensors as HWMON devices.

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
---
Changes in v2:
* Split from thermal_helpers patch
* No change otherwise

The helper patch need some additional work, but this can go as it is.

 drivers/thermal/imx8mm_thermal.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Alexander Stein Sept. 21, 2022, 11:44 a.m. UTC | #1
Gentle ping

Am Dienstag, 26. Juli 2022, 14:23:31 CEST schrieb Alexander Stein:
> Expose thermal sensors as HWMON devices.
> 
> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> ---
> Changes in v2:
> * Split from thermal_helpers patch
> * No change otherwise
> 
> The helper patch need some additional work, but this can go as it is.
> 
>  drivers/thermal/imx8mm_thermal.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/thermal/imx8mm_thermal.c
> b/drivers/thermal/imx8mm_thermal.c index af666bd9e8d4..ca8e2c393030 100644
> --- a/drivers/thermal/imx8mm_thermal.c
> +++ b/drivers/thermal/imx8mm_thermal.c
> @@ -16,6 +16,7 @@
>  #include <linux/thermal.h>
> 
>  #include "thermal_core.h"
> +#include "thermal_hwmon.h"
> 
>  #define TER			0x0	/* TMU enable */
>  #define TPS			0x4
> @@ -176,6 +177,9 @@ static int imx8mm_tmu_probe(struct platform_device
> *pdev) goto disable_clk;
>  		}
>  		tmu->sensors[i].hw_id = i;
> +
> +		if (devm_thermal_add_hwmon_sysfs(tmu->sensors[i].tzd))
> +			dev_warn(&pdev->dev, "failed to add hwmon 
sysfs attributes\n");
>  	}
> 
>  	platform_set_drvdata(pdev, tmu);
Alexander Stein Nov. 28, 2022, 8:43 a.m. UTC | #2
Hello,

gentle ping. Any feedback on this?

Thanks
Alexander

Am Dienstag, 26. Juli 2022, 14:23:31 CET schrieb Alexander Stein:
> Expose thermal sensors as HWMON devices.
> 
> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> ---
> Changes in v2:
> * Split from thermal_helpers patch
> * No change otherwise
> 
> The helper patch need some additional work, but this can go as it is.
> 
>  drivers/thermal/imx8mm_thermal.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/thermal/imx8mm_thermal.c
> b/drivers/thermal/imx8mm_thermal.c index af666bd9e8d4..ca8e2c393030 100644
> --- a/drivers/thermal/imx8mm_thermal.c
> +++ b/drivers/thermal/imx8mm_thermal.c
> @@ -16,6 +16,7 @@
>  #include <linux/thermal.h>
> 
>  #include "thermal_core.h"
> +#include "thermal_hwmon.h"
> 
>  #define TER			0x0	/* TMU enable */
>  #define TPS			0x4
> @@ -176,6 +177,9 @@ static int imx8mm_tmu_probe(struct platform_device
> *pdev) goto disable_clk;
>  		}
>  		tmu->sensors[i].hw_id = i;
> +
> +		if (devm_thermal_add_hwmon_sysfs(tmu->sensors[i].tzd))
> +			dev_warn(&pdev->dev, "failed to add hwmon sysfs 
attributes\n");
>  	}
> 
>  	platform_set_drvdata(pdev, tmu);
Daniel Lezcano Dec. 4, 2022, 4:39 p.m. UTC | #3
On 26/07/2022 14:23, Alexander Stein wrote:
> Expose thermal sensors as HWMON devices.
> 
> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> ---

Applied, thanks
diff mbox series

Patch

diff --git a/drivers/thermal/imx8mm_thermal.c b/drivers/thermal/imx8mm_thermal.c
index af666bd9e8d4..ca8e2c393030 100644
--- a/drivers/thermal/imx8mm_thermal.c
+++ b/drivers/thermal/imx8mm_thermal.c
@@ -16,6 +16,7 @@ 
 #include <linux/thermal.h>
 
 #include "thermal_core.h"
+#include "thermal_hwmon.h"
 
 #define TER			0x0	/* TMU enable */
 #define TPS			0x4
@@ -176,6 +177,9 @@  static int imx8mm_tmu_probe(struct platform_device *pdev)
 			goto disable_clk;
 		}
 		tmu->sensors[i].hw_id = i;
+
+		if (devm_thermal_add_hwmon_sysfs(tmu->sensors[i].tzd))
+			dev_warn(&pdev->dev, "failed to add hwmon sysfs attributes\n");
 	}
 
 	platform_set_drvdata(pdev, tmu);