All of lore.kernel.org
 help / color / mirror / Atom feed
From: Neil Armstrong <narmstrong@baylibre.com>
To: Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	glaroque@baylibre.com, linux-pm@vger.kernel.org,
	linux-amlogic@lists.infradead.org
Cc: amitk@kernel.org, rui.zhang@intel.com, daniel.lezcano@linaro.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] thermal: amlogic: Add hwmon support
Date: Mon, 16 Nov 2020 09:35:07 +0100	[thread overview]
Message-ID: <13c3b1c5-9c06-d663-47ae-5ccd8f87fe57@baylibre.com> (raw)
In-Reply-To: <20201115190658.631578-1-martin.blumenstingl@googlemail.com>

On 15/11/2020 20:06, Martin Blumenstingl wrote:
> Many monitoring tools read the CPU temperature using the hwmon
> interface. Expose the thermal sensors on Amlogic boards as hwmon
> devices.
> 
> Without this lm_sensors' "sensors" tool does not find any temperature
> sensors. Now it prints:
>   cpu_thermal-virtual-0
>   Adapter: Virtual device
>   temp1:        +44.7 C  (crit = +110.0 C)
> 
>   ddr_thermal-virtual-0
>   Adapter: Virtual device
>   temp1:        +45.9 C  (crit = +110.0 C)
> 
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.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..dffe3ba8c7c4 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)
> @@ -287,6 +288,9 @@ static int amlogic_thermal_probe(struct platform_device *pdev)
>  		return ret;
>  	}l
>  
> +	if (devm_thermal_add_hwmon_sysfs(pdata->tzd))
> +		dev_warn(&pdev->dev, "Failed to add hwmon sysfs attributes\n");
> +
>  	ret = amlogic_thermal_initialize(pdata);
>  	if (ret)
>  		return ret;
> 

Thanks !!

Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>

WARNING: multiple messages have this Message-ID (diff)
From: Neil Armstrong <narmstrong@baylibre.com>
To: Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	glaroque@baylibre.com, linux-pm@vger.kernel.org,
	linux-amlogic@lists.infradead.org
Cc: rui.zhang@intel.com, amitk@kernel.org, daniel.lezcano@linaro.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] thermal: amlogic: Add hwmon support
Date: Mon, 16 Nov 2020 09:35:07 +0100	[thread overview]
Message-ID: <13c3b1c5-9c06-d663-47ae-5ccd8f87fe57@baylibre.com> (raw)
In-Reply-To: <20201115190658.631578-1-martin.blumenstingl@googlemail.com>

On 15/11/2020 20:06, Martin Blumenstingl wrote:
> Many monitoring tools read the CPU temperature using the hwmon
> interface. Expose the thermal sensors on Amlogic boards as hwmon
> devices.
> 
> Without this lm_sensors' "sensors" tool does not find any temperature
> sensors. Now it prints:
>   cpu_thermal-virtual-0
>   Adapter: Virtual device
>   temp1:        +44.7 C  (crit = +110.0 C)
> 
>   ddr_thermal-virtual-0
>   Adapter: Virtual device
>   temp1:        +45.9 C  (crit = +110.0 C)
> 
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.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..dffe3ba8c7c4 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)
> @@ -287,6 +288,9 @@ static int amlogic_thermal_probe(struct platform_device *pdev)
>  		return ret;
>  	}l
>  
> +	if (devm_thermal_add_hwmon_sysfs(pdata->tzd))
> +		dev_warn(&pdev->dev, "Failed to add hwmon sysfs attributes\n");
> +
>  	ret = amlogic_thermal_initialize(pdata);
>  	if (ret)
>  		return ret;
> 

Thanks !!

Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

  reply	other threads:[~2020-11-16  8:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-15 19:06 [PATCH] thermal: amlogic: Add hwmon support Martin Blumenstingl
2020-11-15 19:06 ` Martin Blumenstingl
2020-11-16  8:35 ` Neil Armstrong [this message]
2020-11-16  8:35   ` Neil Armstrong
2020-11-16  9:31 ` Daniel Lezcano
2020-11-16  9:31   ` Daniel Lezcano
2020-11-24  9:36 ` [thermal: thermal/next] " thermal-bot for Martin Blumenstingl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=13c3b1c5-9c06-d663-47ae-5ccd8f87fe57@baylibre.com \
    --to=narmstrong@baylibre.com \
    --cc=amitk@kernel.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=glaroque@baylibre.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=rui.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.