From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754873AbcETF6s (ORCPT ); Fri, 20 May 2016 01:58:48 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:42745 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754422AbcETF6q (ORCPT ); Fri, 20 May 2016 01:58:46 -0400 Subject: Re: [PATCH] thermal: ti-soc-thermal: Add set_emul_temp hook To: Keerthy , , References: <1462880530-13935-1-git-send-email-j-keerthy@ti.com> CC: , , , From: Keerthy Message-ID: <573EA790.8020006@ti.com> Date: Fri, 20 May 2016 11:28:40 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <1462880530-13935-1-git-send-email-j-keerthy@ti.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday 10 May 2016 05:12 PM, 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. A gentle ping on this. > > Signed-off-by: Keerthy > --- > > Tested the emulation temperature feature on DRA72-EVM. > > drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > > diff --git a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c > index b213a12..e6f7025 100644 > --- a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c > +++ b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c > @@ -278,6 +278,20 @@ 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; > + > + mutex_lock(&tz->lock); > + tz->emul_temperature = temp; > + mutex_unlock(&tz->lock); > + > + 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 +303,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 = { >