linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] thermal: ti-soc-thermal: Add set_emul_temp hook
@ 2016-06-01  3:59 Keerthy
  2016-07-02  2:57 ` Eduardo Valentin
  0 siblings, 1 reply; 3+ messages in thread
From: Keerthy @ 2016-06-01  3:59 UTC (permalink / raw)
  To: rui.zhang, edubezval; +Cc: t-kristo, j-keerthy, nm, linux-pm, linux-omap

Setting the emulation temperature helps reproduce critical
temperature scenarios without risking the actual hardware at
extreme temperatures. Adding __ti_thermal_set_emul_temp as
the set_emul_temp hook.

Signed-off-by: Keerthy <j-keerthy@ti.com>
---

Changes in v2:

  * Rebased on top of:
git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal sysfs_locking

Tested on DRA7/DRA72 baords.

 drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
index 15c0a9a..8d069ee 100644
--- a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
+++ b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
@@ -278,6 +278,17 @@ static int ti_thermal_get_trend(struct thermal_zone_device *thermal,
 	return 0;
 }
 
+static int __ti_thermal_set_emul_temp(void *p, int temp)
+{
+	struct ti_thermal_data *data = p;
+	struct thermal_zone_device *tz;
+
+	tz = data->ti_thermal;
+	tz->emul_temperature = temp;
+
+	return 0;
+}
+
 /* Get critical temperature callback functions for thermal zone */
 static int ti_thermal_get_crit_temp(struct thermal_zone_device *thermal,
 				    int *temp)
@@ -289,6 +300,7 @@ static int ti_thermal_get_crit_temp(struct thermal_zone_device *thermal,
 static const struct thermal_zone_of_device_ops ti_of_thermal_ops = {
 	.get_temp = __ti_thermal_get_temp,
 	.get_trend = __ti_thermal_get_trend,
+	.set_emul_temp = __ti_thermal_set_emul_temp,
 };
 
 static struct thermal_zone_device_ops ti_thermal_ops = {
-- 
1.9.1


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

* Re: [PATCH v2] thermal: ti-soc-thermal: Add set_emul_temp hook
  2016-06-01  3:59 [PATCH v2] thermal: ti-soc-thermal: Add set_emul_temp hook Keerthy
@ 2016-07-02  2:57 ` Eduardo Valentin
  2016-07-02  9:41   ` Keerthy
  0 siblings, 1 reply; 3+ messages in thread
From: Eduardo Valentin @ 2016-07-02  2:57 UTC (permalink / raw)
  To: Keerthy; +Cc: rui.zhang, t-kristo, nm, linux-pm, linux-omap

On Wed, Jun 01, 2016 at 09:29:10AM +0530, Keerthy wrote:
> Setting the emulation temperature helps reproduce critical
> temperature scenarios without risking the actual hardware at
> extreme temperatures. Adding __ti_thermal_set_emul_temp as
> the set_emul_temp hook.
> 
> Signed-off-by: Keerthy <j-keerthy@ti.com>
> ---
> 
> Changes in v2:
> 
>   * Rebased on top of:
> git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal sysfs_locking
> 
> Tested on DRA7/DRA72 baords.
> 
>  drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
> index 15c0a9a..8d069ee 100644
> --- a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
> +++ b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
> @@ -278,6 +278,17 @@ static int ti_thermal_get_trend(struct thermal_zone_device *thermal,
>  	return 0;
>  }
>  
> +static int __ti_thermal_set_emul_temp(void *p, int temp)
> +{
> +	struct ti_thermal_data *data = p;
> +	struct thermal_zone_device *tz;
> +
> +	tz = data->ti_thermal;
> +	tz->emul_temperature = temp;
> +
> +	return 0;
> +}
> +
>  /* Get critical temperature callback functions for thermal zone */
>  static int ti_thermal_get_crit_temp(struct thermal_zone_device *thermal,
>  				    int *temp)
> @@ -289,6 +300,7 @@ static int ti_thermal_get_crit_temp(struct thermal_zone_device *thermal,
>  static const struct thermal_zone_of_device_ops ti_of_thermal_ops = {
>  	.get_temp = __ti_thermal_get_temp,
>  	.get_trend = __ti_thermal_get_trend,
> +	.set_emul_temp = __ti_thermal_set_emul_temp,

I am assuming this can be ignored after the fix on of thermal.

>  };
>  
>  static struct thermal_zone_device_ops ti_thermal_ops = {
> -- 
> 1.9.1
> 

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

* Re: [PATCH v2] thermal: ti-soc-thermal: Add set_emul_temp hook
  2016-07-02  2:57 ` Eduardo Valentin
@ 2016-07-02  9:41   ` Keerthy
  0 siblings, 0 replies; 3+ messages in thread
From: Keerthy @ 2016-07-02  9:41 UTC (permalink / raw)
  To: Eduardo Valentin, Keerthy; +Cc: rui.zhang, t-kristo, nm, linux-pm, linux-omap



On Saturday 02 July 2016 08:27 AM, Eduardo Valentin wrote:
> On Wed, Jun 01, 2016 at 09:29:10AM +0530, Keerthy wrote:
>> Setting the emulation temperature helps reproduce critical
>> temperature scenarios without risking the actual hardware at
>> extreme temperatures. Adding __ti_thermal_set_emul_temp as
>> the set_emul_temp hook.
>>
>> Signed-off-by: Keerthy <j-keerthy@ti.com>
>> ---
>>
>> Changes in v2:
>>
>>    * Rebased on top of:
>> git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal sysfs_locking
>>
>> Tested on DRA7/DRA72 baords.
>>
>>   drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 12 ++++++++++++
>>   1 file changed, 12 insertions(+)
>>
>> diff --git a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
>> index 15c0a9a..8d069ee 100644
>> --- a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
>> +++ b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
>> @@ -278,6 +278,17 @@ static int ti_thermal_get_trend(struct thermal_zone_device *thermal,
>>   	return 0;
>>   }
>>
>> +static int __ti_thermal_set_emul_temp(void *p, int temp)
>> +{
>> +	struct ti_thermal_data *data = p;
>> +	struct thermal_zone_device *tz;
>> +
>> +	tz = data->ti_thermal;
>> +	tz->emul_temperature = temp;
>> +
>> +	return 0;
>> +}
>> +
>>   /* Get critical temperature callback functions for thermal zone */
>>   static int ti_thermal_get_crit_temp(struct thermal_zone_device *thermal,
>>   				    int *temp)
>> @@ -289,6 +300,7 @@ static int ti_thermal_get_crit_temp(struct thermal_zone_device *thermal,
>>   static const struct thermal_zone_of_device_ops ti_of_thermal_ops = {
>>   	.get_temp = __ti_thermal_get_temp,
>>   	.get_trend = __ti_thermal_get_trend,
>> +	.set_emul_temp = __ti_thermal_set_emul_temp,
>
> I am assuming this can be ignored after the fix on of thermal.

I have sent this https://patchwork.kernel.org/patch/9149577/

as Suggested by you.

>
>>   };
>>
>>   static struct thermal_zone_device_ops ti_thermal_ops = {
>> --
>> 1.9.1
>>

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

end of thread, other threads:[~2016-07-02  9:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-01  3:59 [PATCH v2] thermal: ti-soc-thermal: Add set_emul_temp hook Keerthy
2016-07-02  2:57 ` Eduardo Valentin
2016-07-02  9:41   ` Keerthy

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