linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drivers/thermal/ti-soc-thermal: Add hwmon support
@ 2022-02-18 10:47 Romain Naour
  2022-02-25 11:46 ` Daniel Lezcano
  0 siblings, 1 reply; 6+ messages in thread
From: Romain Naour @ 2022-02-18 10:47 UTC (permalink / raw)
  To: linux-pm, linux-omap; +Cc: j-keerthy, edubezval, Romain Naour

Expose ti-soc-thermal thermal sensors as HWMON devices.

  # sensors
  cpu_thermal-virtual-0
  Adapter: Virtual device
  temp1:        +54.2 C  (crit = +105.0 C)

  dspeve_thermal-virtual-0
  Adapter: Virtual device
  temp1:        +51.4 C  (crit = +105.0 C)

  gpu_thermal-virtual-0
  Adapter: Virtual device
  temp1:        +54.2 C  (crit = +105.0 C)

  iva_thermal-virtual-0
  Adapter: Virtual device
  temp1:        +54.6 C  (crit = +105.0 C)

  core_thermal-virtual-0
  Adapter: Virtual device
  temp1:        +52.6 C  (crit = +105.0 C)

Similar to imx_sc_thermal d2bc4dd91da6095a769fdc9bc519d3be7ad5f97a.

No need to take care of thermal_remove_hwmon_sysfs() since
devm_thermal_add_hwmon_sysfs() (a wrapper around devres) is
used. See c7fc403e40b0ea18976a59e968c23439a80809e8.

Signed-off-by: Romain Naour <romain.naour@smile.fr>
---
 drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
index f84375865c97..0959632b2170 100644
--- a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
+++ b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
@@ -21,6 +21,7 @@
 
 #include "ti-thermal.h"
 #include "ti-bandgap.h"
+#include "../thermal_hwmon.h"
 
 /* common data structures */
 struct ti_thermal_data {
@@ -189,6 +190,9 @@ int ti_thermal_expose_sensor(struct ti_bandgap *bgp, int id,
 	ti_bandgap_set_sensor_data(bgp, id, data);
 	ti_bandgap_write_update_interval(bgp, data->sensor_id, interval);
 
+	if (devm_thermal_add_hwmon_sysfs(data->ti_thermal))
+		dev_warn(bgp->dev, "failed to add hwmon sysfs attributes\n");
+
 	return 0;
 }
 
-- 
2.34.1


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

* Re: [PATCH] drivers/thermal/ti-soc-thermal: Add hwmon support
  2022-02-18 10:47 [PATCH] drivers/thermal/ti-soc-thermal: Add hwmon support Romain Naour
@ 2022-02-25 11:46 ` Daniel Lezcano
  2022-02-28  9:18   ` Romain Naour
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Lezcano @ 2022-02-25 11:46 UTC (permalink / raw)
  To: Romain Naour, linux-pm, linux-omap; +Cc: j-keerthy, edubezval


Hi Romain,

I'll apply the patch.

In the future, use the scripts/get_maintainer.pl -f <file> to get the 
recipients of your patch if you have a doubt about who to send it to.

Thanks

   -- Daniel

On 18/02/2022 11:47, Romain Naour wrote:
> Expose ti-soc-thermal thermal sensors as HWMON devices.
> 
>    # sensors
>    cpu_thermal-virtual-0
>    Adapter: Virtual device
>    temp1:        +54.2 C  (crit = +105.0 C)
> 
>    dspeve_thermal-virtual-0
>    Adapter: Virtual device
>    temp1:        +51.4 C  (crit = +105.0 C)
> 
>    gpu_thermal-virtual-0
>    Adapter: Virtual device
>    temp1:        +54.2 C  (crit = +105.0 C)
> 
>    iva_thermal-virtual-0
>    Adapter: Virtual device
>    temp1:        +54.6 C  (crit = +105.0 C)
> 
>    core_thermal-virtual-0
>    Adapter: Virtual device
>    temp1:        +52.6 C  (crit = +105.0 C)
> 
> Similar to imx_sc_thermal d2bc4dd91da6095a769fdc9bc519d3be7ad5f97a.
> 
> No need to take care of thermal_remove_hwmon_sysfs() since
> devm_thermal_add_hwmon_sysfs() (a wrapper around devres) is
> used. See c7fc403e40b0ea18976a59e968c23439a80809e8.
> 
> Signed-off-by: Romain Naour <romain.naour@smile.fr>
> ---
>   drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
> index f84375865c97..0959632b2170 100644
> --- a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
> +++ b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
> @@ -21,6 +21,7 @@
>   
>   #include "ti-thermal.h"
>   #include "ti-bandgap.h"
> +#include "../thermal_hwmon.h"
>   
>   /* common data structures */
>   struct ti_thermal_data {
> @@ -189,6 +190,9 @@ int ti_thermal_expose_sensor(struct ti_bandgap *bgp, int id,
>   	ti_bandgap_set_sensor_data(bgp, id, data);
>   	ti_bandgap_write_update_interval(bgp, data->sensor_id, interval);
>   
> +	if (devm_thermal_add_hwmon_sysfs(data->ti_thermal))
> +		dev_warn(bgp->dev, "failed to add hwmon sysfs attributes\n");
> +
>   	return 0;
>   }
>   


-- 
<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] 6+ messages in thread

* Re: [PATCH] drivers/thermal/ti-soc-thermal: Add hwmon support
  2022-02-25 11:46 ` Daniel Lezcano
@ 2022-02-28  9:18   ` Romain Naour
  0 siblings, 0 replies; 6+ messages in thread
From: Romain Naour @ 2022-02-28  9:18 UTC (permalink / raw)
  To: Daniel Lezcano, linux-pm, linux-omap; +Cc: j-keerthy, edubezval

Hi Daniel,

Le 25/02/2022 à 12:46, Daniel Lezcano a écrit :
> 
> Hi Romain,
> 
> I'll apply the patch.

You're welcome!

> 
> In the future, use the scripts/get_maintainer.pl -f <file> to get the recipients
> of your patch if you have a doubt about who to send it to.

I wasn't sure if it was needed to send the patch to both mailing list.
I was only subscribed to linux-omap until now.

Best regards,
Romain


> 
> Thanks
> 
>   -- Daniel
> 
> On 18/02/2022 11:47, Romain Naour wrote:
>> Expose ti-soc-thermal thermal sensors as HWMON devices.
>>
>>    # sensors
>>    cpu_thermal-virtual-0
>>    Adapter: Virtual device
>>    temp1:        +54.2 C  (crit = +105.0 C)
>>
>>    dspeve_thermal-virtual-0
>>    Adapter: Virtual device
>>    temp1:        +51.4 C  (crit = +105.0 C)
>>
>>    gpu_thermal-virtual-0
>>    Adapter: Virtual device
>>    temp1:        +54.2 C  (crit = +105.0 C)
>>
>>    iva_thermal-virtual-0
>>    Adapter: Virtual device
>>    temp1:        +54.6 C  (crit = +105.0 C)
>>
>>    core_thermal-virtual-0
>>    Adapter: Virtual device
>>    temp1:        +52.6 C  (crit = +105.0 C)
>>
>> Similar to imx_sc_thermal d2bc4dd91da6095a769fdc9bc519d3be7ad5f97a.
>>
>> No need to take care of thermal_remove_hwmon_sysfs() since
>> devm_thermal_add_hwmon_sysfs() (a wrapper around devres) is
>> used. See c7fc403e40b0ea18976a59e968c23439a80809e8.
>>
>> Signed-off-by: Romain Naour <romain.naour@smile.fr>
>> ---
>>   drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
>> b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
>> index f84375865c97..0959632b2170 100644
>> --- a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
>> +++ b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
>> @@ -21,6 +21,7 @@
>>     #include "ti-thermal.h"
>>   #include "ti-bandgap.h"
>> +#include "../thermal_hwmon.h"
>>     /* common data structures */
>>   struct ti_thermal_data {
>> @@ -189,6 +190,9 @@ int ti_thermal_expose_sensor(struct ti_bandgap *bgp, int id,
>>       ti_bandgap_set_sensor_data(bgp, id, data);
>>       ti_bandgap_write_update_interval(bgp, data->sensor_id, interval);
>>   +    if (devm_thermal_add_hwmon_sysfs(data->ti_thermal))
>> +        dev_warn(bgp->dev, "failed to add hwmon sysfs attributes\n");
>> +
>>       return 0;
>>   }
>>   
> 
> 


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

* Re: [PATCH] drivers/thermal/ti-soc-thermal: Add hwmon support
  2022-02-18  8:28 ` Tony Lindgren
@ 2022-02-18 10:50   ` Romain Naour
  0 siblings, 0 replies; 6+ messages in thread
From: Romain Naour @ 2022-02-18 10:50 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-omap

Le 18/02/2022 à 09:28, Tony Lindgren a écrit :
> * Romain Naour <romain.naour@smile.fr> [220216 17:21]:
>> Expose ti-soc-thermal thermal sensors as HWMON devices.
> 
> Can you please send this to the ti-soc-thermal maintainer(s)
> and related subsystem mailing list with linux-omap in Cc?
> See the MAINTAINERS file for info and scripts/get-maintainer.pl
> script.

Ok, I was not sure if adding two mailing list was mandatory.

> 
> Then the subsystem maintainer(s) will pick it up, or will
> ack it and I can pick it up.

Thanks, sorry for the noise.

Best regards,
Romain


> 
> Regards,
> 
> Tony


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

* Re: [PATCH] drivers/thermal/ti-soc-thermal: Add hwmon support
  2022-02-16 17:22 Romain Naour
@ 2022-02-18  8:28 ` Tony Lindgren
  2022-02-18 10:50   ` Romain Naour
  0 siblings, 1 reply; 6+ messages in thread
From: Tony Lindgren @ 2022-02-18  8:28 UTC (permalink / raw)
  To: Romain Naour; +Cc: linux-omap

* Romain Naour <romain.naour@smile.fr> [220216 17:21]:
> Expose ti-soc-thermal thermal sensors as HWMON devices.

Can you please send this to the ti-soc-thermal maintainer(s)
and related subsystem mailing list with linux-omap in Cc?
See the MAINTAINERS file for info and scripts/get-maintainer.pl
script.

Then the subsystem maintainer(s) will pick it up, or will
ack it and I can pick it up.

Regards,

Tony

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

* [PATCH] drivers/thermal/ti-soc-thermal: Add hwmon support
@ 2022-02-16 17:22 Romain Naour
  2022-02-18  8:28 ` Tony Lindgren
  0 siblings, 1 reply; 6+ messages in thread
From: Romain Naour @ 2022-02-16 17:22 UTC (permalink / raw)
  To: linux-omap; +Cc: Romain Naour

Expose ti-soc-thermal thermal sensors as HWMON devices.

  # sensors
  cpu_thermal-virtual-0
  Adapter: Virtual device
  temp1:        +54.2 C  (crit = +105.0 C)

  dspeve_thermal-virtual-0
  Adapter: Virtual device
  temp1:        +51.4 C  (crit = +105.0 C)

  gpu_thermal-virtual-0
  Adapter: Virtual device
  temp1:        +54.2 C  (crit = +105.0 C)

  iva_thermal-virtual-0
  Adapter: Virtual device
  temp1:        +54.6 C  (crit = +105.0 C)

  core_thermal-virtual-0
  Adapter: Virtual device
  temp1:        +52.6 C  (crit = +105.0 C)

Similar to imx_sc_thermal d2bc4dd91da6095a769fdc9bc519d3be7ad5f97a.

No need to take care of thermal_remove_hwmon_sysfs() since
devm_thermal_add_hwmon_sysfs() (a wrapper around devres) is
used. See c7fc403e40b0ea18976a59e968c23439a80809e8.

Signed-off-by: Romain Naour <romain.naour@smile.fr>
---
 drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
index f84375865c97..0959632b2170 100644
--- a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
+++ b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
@@ -21,6 +21,7 @@
 
 #include "ti-thermal.h"
 #include "ti-bandgap.h"
+#include "../thermal_hwmon.h"
 
 /* common data structures */
 struct ti_thermal_data {
@@ -189,6 +190,9 @@ int ti_thermal_expose_sensor(struct ti_bandgap *bgp, int id,
 	ti_bandgap_set_sensor_data(bgp, id, data);
 	ti_bandgap_write_update_interval(bgp, data->sensor_id, interval);
 
+	if (devm_thermal_add_hwmon_sysfs(data->ti_thermal))
+		dev_warn(bgp->dev, "failed to add hwmon sysfs attributes\n");
+
 	return 0;
 }
 
-- 
2.34.1


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

end of thread, other threads:[~2022-02-28  9:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-18 10:47 [PATCH] drivers/thermal/ti-soc-thermal: Add hwmon support Romain Naour
2022-02-25 11:46 ` Daniel Lezcano
2022-02-28  9:18   ` Romain Naour
  -- strict thread matches above, loose matches on Subject: below --
2022-02-16 17:22 Romain Naour
2022-02-18  8:28 ` Tony Lindgren
2022-02-18 10:50   ` Romain Naour

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).