Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752513AbdC0KLP convert rfc822-to-8bit (ORCPT ); Mon, 27 Mar 2017 06:11:15 -0400 Received: from mail1.bemta6.messagelabs.com ([193.109.254.112]:38795 "EHLO mail1.bemta6.messagelabs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751406AbdC0KLD (ORCPT ); Mon, 27 Mar 2017 06:11:03 -0400 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpik+JIrShJLcpLzFFi42KJ27nUWPfhkxs RBs+WmFhMffiEzWL+kXOsFocXvWC0mH/lGqvF/a9HGS2+Xelgsrj56RurxeVdc9gsPvceYbS4 sW4fu8WThWeYLBY2tbBbLL1+kcmide8RoNjDPjaLWzNesDoIeKyZt4bRY+esu+we1zaLeSze8 5LJY9OqTjaPO9f2sHns/N7A7vF5k1wARxRrZl5SfkUCa8bVjQfYCmYpVPy4eYypgfGoVBcjJ4 eQwFJGidZ7MSA2m4ChxLw37xlBbBEBLYkTl7YzdTFycTAL/GeRmLL2IlhCWCBNouNELwtEUbr E0ts/2CFsK4lZJ44wg9gsAqoSDxfeBovzCgRInP15mhlkkJDASUaJe6ves4IkOAWsJd6+WgU2 lFFAVuJL42qwZmYBcYlbT+YzgdgSAgISS/acZ4awRSVePv7HCmHLS6z99QQqbi/x+t47oIM4g Gx9ib7GYoiwocSqaQdYIGxziYn37rBAjNeRWLD7ExuErS2xbOFrZog7BSVOznzCMoFRfBaSK2 YhaZmFpGUWkpYFjCyrGDWKU4vKUot0jQ30kooy0zNKchMzc3QNDcz0clOLixPTU3MSk4r1kvN zNzEC0wYDEOxg/Ls28BCjJAeTkijvh9M3IoT4kvJTKjMSizPii0pzUosPMcpwcChJ8E54DJQT LEpNT61Iy8wBJjCYtAQHj5II71SQNG9xQWJucWY6ROoUo6KUOO82kIQASCKjNA+uDZY0LzHKS gnzMgIdIsRTkFqUm1mCKv+KUZyDUUkYYjxPZl4J3PRXQIuZgBYfng+2uCQRISXVwOi83cNg87 HfZ7fGFj6q9frr+PrdtBmxcxO3H+lyf8mU/F5qRc+5ilZref8vk8U3Jy4+2CapXmthkK6S7hp wquJFnU3LAnGx4pm8Voqb+XnMF4bn/jmwisO+31V1TdJShtkXnVi+77kRe/tomY+r3iLGP6cD 3jyPVEiRSmUQ8Q5hWXhvzjG3QiWW4oxEQy3mouJEAKl4XDyVAwAA X-Env-Sender: stwiss.opensource@diasemi.com X-Msg-Ref: server-3.tower-194.messagelabs.com!1490609377!55677368!1 X-Originating-IP: [94.185.165.51] X-StarScan-Received: X-StarScan-Version: 9.2.3; banners=-,-,- X-VirusChecked: Checked From: Steve Twiss To: Eduardo Valentin CC: LINUX-KERNEL , LINUX-PM , Zhang Rui , DEVICETREE , Dmitry Torokhov , Guenter Roeck , LINUX-INPUT , LINUX-WATCHDOG , Lee Jones , "Liam Girdwood" , Lukasz Luba , Mark Brown , Mark Rutland , Rob Herring , Support Opensource , Wim Van Sebroeck Subject: RE: [RESEND PATCH V5 7/8] thermal: da9062/61: Thermal junction temperature monitoring driver Thread-Topic: [RESEND PATCH V5 7/8] thermal: da9062/61: Thermal junction temperature monitoring driver Thread-Index: AQHSfTUSlk5o+xhMLkaViGWDNqkcHKFvp8wAgCmlLVA= Date: Mon, 27 Mar 2017 10:09:35 +0000 Message-ID: <6ED8E3B22081A4459DAC7699F3695FB7018CD69BD3@SW-EX-MBX02.diasemi.com> References: <6a1a651530fdaedd3e380aa33749ca5fce1a80a8.1486026227.git.stwiss.opensource@diasemi.com> <20170219014007.GA20845@localhost.localdomain> In-Reply-To: <20170219014007.GA20845@localhost.localdomain> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.20.26.77] x-kse-attachmentfiltering-interceptor-info: protection disabled x-kse-serverinfo: sw-ex-cashub01.diasemi.com, 9 x-kse-antivirus-interceptor-info: scan successful x-kse-antivirus-info: Clean, bases: 27/03/2017 08:32:00 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4094 Lines: 141 On 19 February 2017 01:40, Eduardo Valentin wrote: Hi Eduardo, My apologies in taking so long to reply. There were *no* problems with implementing your requests. See below. I will have sent these changes as PATCH V6. https://lkml.org/lkml/2017/3/27/253 Regards, Steve > To: Steve Twiss > Subject: Re: [RESEND PATCH V5 7/8] thermal: da9062/61: Thermal junction > temperature monitoring driver [...] > I see no reason why this driver cannot have the COMPILE_TEST flag. > Tested myself here so: > > + depends on MFD_DA9062 || COMPILE_TEST Added. > please cleanup the minor issues checkpatch complains: > /scripts/checkpatch.pl --strict I have fixed all of those for latest checkpatch.pl script, this time using "--strict". [...] > > +static void da9062_thermal_poll_on(struct work_struct *work) > > +{ > > + struct da9062_thermal *thermal = container_of(work, > > + struct da9062_thermal, > > + work.work); > > + unsigned int val; > > + int ret; > > + > > + /* clear E_TEMP */ > > + ret = regmap_write(thermal->hw->regmap, > > + DA9062AA_EVENT_B, > > + DA9062AA_E_TEMP_MASK); > > + if (ret < 0) { > > + dev_err(thermal->dev, > > + "Cannot clear the TJUNC temperature status\n"); > > + goto err_enable_irq; > > + } > > + > > + /* Now read E_TEMP again: it is acting like a status bit. > > + * If over-temperature, then this status will be true. > > + * If not over-temperature, this status will be false. > > + */ > > + ret = regmap_read(thermal->hw->regmap, > > + DA9062AA_EVENT_B, > > + &val); > > + if (ret < 0) { > > + dev_err(thermal->dev, > > + "Cannot check the TJUNC temperature status\n"); > > + goto err_enable_irq; > > + } else { > > + if (val & DA9062AA_E_TEMP_MASK) { > > + mutex_lock(&thermal->lock); > > + thermal->temperature = DA9062_MILLI_CELSIUS(125); > > + mutex_unlock(&thermal->lock); > > + thermal_zone_device_update(thermal->zone, > > + THERMAL_EVENT_UNSPECIFIED); > > + > > + schedule_delayed_work(&thermal->work, > > + msecs_to_jiffies(thermal->zone->passive_delay)); > > + return; > > + } else { > > + mutex_lock(&thermal->lock); > > + thermal->temperature = DA9062_MILLI_CELSIUS(0); > > + mutex_unlock(&thermal->lock); > > + thermal_zone_device_update(thermal->zone, > > + THERMAL_EVENT_UNSPECIFIED); > > + } > > + } > > The above code is a little confusing, can it be maybe, better read like > this? > > diff --git a/drivers/thermal/da9062-thermal.c b/drivers/thermal/da9062- > thermal.c > index 52a095d..6ac8574 100644 > --- a/drivers/thermal/da9062-thermal.c > +++ b/drivers/thermal/da9062-thermal.c > @@ -95,26 +95,26 @@ static void da9062_thermal_poll_on(struct work_struct > *work) > dev_err(thermal->dev, > "Cannot check the TJUNC temperature status\n"); > goto err_enable_irq; > - } else { > - if (val & DA9062AA_E_TEMP_MASK) { > - mutex_lock(&thermal->lock); > - thermal->temperature = DA9062_MILLI_CELSIUS(125); > - mutex_unlock(&thermal->lock); > - thermal_zone_device_update(thermal->zone, > - THERMAL_EVENT_UNSPECIFIED); > - > - schedule_delayed_work(&thermal->work, > + } > + > + if (val & DA9062AA_E_TEMP_MASK) { > + mutex_lock(&thermal->lock); > + thermal->temperature = DA9062_MILLI_CELSIUS(125); > + mutex_unlock(&thermal->lock); > + thermal_zone_device_update(thermal->zone, > + THERMAL_EVENT_UNSPECIFIED); > + > + schedule_delayed_work(&thermal->work, > msecs_to_jiffies(thermal->zone->passive_delay)); > - return; > - } else { > - mutex_lock(&thermal->lock); > - thermal->temperature = DA9062_MILLI_CELSIUS(0); > - mutex_unlock(&thermal->lock); > - thermal_zone_device_update(thermal->zone, > - THERMAL_EVENT_UNSPECIFIED); > - } > + return; > } > > + mutex_lock(&thermal->lock); > + thermal->temperature = DA9062_MILLI_CELSIUS(0); > + mutex_unlock(&thermal->lock); > + thermal_zone_device_update(thermal->zone, > + THERMAL_EVENT_UNSPECIFIED); > + > err_enable_irq: > enable_irq(thermal->irq); > } That makes more sense getting rid of those else clauses. Applied that, thanks. Regards, Steve