linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] thermal: amlogic_thermal: Add hwmon support
@ 2020-11-25 16:24 Dongjin Kim
  2020-11-25 22:12 ` Daniel Lezcano
  0 siblings, 1 reply; 2+ messages in thread
From: Dongjin Kim @ 2020-11-25 16:24 UTC (permalink / raw)
  To: Guillaume La Roque, Zhang Rui, Daniel Lezcano, Amit Kucheria,
	linux-pm, linux-amlogic, linux-kernel

Expose Amlogic thermal as HWMON devices.

	$ sensors
	cpu_thermal-virtual-0
	Adapter: Virtual device
	temp1:        +32.2 C  (crit = +110.0 C)

	ddr_thermal-virtual-0
	Adapter: Virtual device
	temp1:        +33.4 C  (crit = +110.0 C)

Signed-off-by: Dongjin Kim <tobetter@gmail.com>
---
 drivers/thermal/amlogic_thermal.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/thermal/amlogic_thermal.c b/drivers/thermal/amlogic_thermal.c
index ccb1fe18e993..2fce96c32586 100644
--- a/drivers/thermal/amlogic_thermal.c
+++ b/drivers/thermal/amlogic_thermal.c
@@ -29,6 +29,7 @@
 #include <linux/thermal.h>
 
 #include "thermal_core.h"
+#include "thermal_hwmon.h"
 
 #define TSENSOR_CFG_REG1			0x4
 	#define TSENSOR_CFG_REG1_RSET_VBG	BIT(12)
@@ -291,6 +292,9 @@ static int amlogic_thermal_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
+	if (devm_thermal_add_hwmon_sysfs(pdata->tzd))
+		dev_warn(&pdev->dev, "failed to add hwmon sysfs attributes\n");
+
 	ret = amlogic_thermal_enable(pdata);
 
 	return ret;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] thermal: amlogic_thermal: Add hwmon support
  2020-11-25 16:24 [PATCH] thermal: amlogic_thermal: Add hwmon support Dongjin Kim
@ 2020-11-25 22:12 ` Daniel Lezcano
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Lezcano @ 2020-11-25 22:12 UTC (permalink / raw)
  To: Dongjin Kim, Guillaume La Roque, Zhang Rui, Amit Kucheria,
	linux-pm, linux-amlogic, linux-kernel

Hi

Thanks for your patch but exactly the same patch was submitted and
merged [1]

  -- Daniel

[1]
https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git/commit/?h=thermal/next&id=cb68a8580e2086fad38597af4c60d39de8df0cde

On 25/11/2020 17:24, Dongjin Kim wrote:
> Expose Amlogic thermal as HWMON devices.
> 
> 	$ sensors
> 	cpu_thermal-virtual-0
> 	Adapter: Virtual device
> 	temp1:        +32.2 C  (crit = +110.0 C)
> 
> 	ddr_thermal-virtual-0
> 	Adapter: Virtual device
> 	temp1:        +33.4 C  (crit = +110.0 C)
> 
> Signed-off-by: Dongjin Kim <tobetter@gmail.com>
> ---
>  drivers/thermal/amlogic_thermal.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/thermal/amlogic_thermal.c b/drivers/thermal/amlogic_thermal.c
> index ccb1fe18e993..2fce96c32586 100644
> --- a/drivers/thermal/amlogic_thermal.c
> +++ b/drivers/thermal/amlogic_thermal.c
> @@ -29,6 +29,7 @@
>  #include <linux/thermal.h>
>  
>  #include "thermal_core.h"
> +#include "thermal_hwmon.h"
>  
>  #define TSENSOR_CFG_REG1			0x4
>  	#define TSENSOR_CFG_REG1_RSET_VBG	BIT(12)
> @@ -291,6 +292,9 @@ static int amlogic_thermal_probe(struct platform_device *pdev)
>  	if (ret)
>  		return ret;
>  
> +	if (devm_thermal_add_hwmon_sysfs(pdata->tzd))
> +		dev_warn(&pdev->dev, "failed to add hwmon sysfs attributes\n");
> +
>  	ret = amlogic_thermal_enable(pdata);
>  
>  	return ret;
> 


-- 
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-25 22:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-25 16:24 [PATCH] thermal: amlogic_thermal: Add hwmon support Dongjin Kim
2020-11-25 22:12 ` Daniel Lezcano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).