Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751425AbdFFNEF (ORCPT ); Tue, 6 Jun 2017 09:04:05 -0400 Received: from 8.mo173.mail-out.ovh.net ([46.105.46.122]:48090 "EHLO 8.mo173.mail-out.ovh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751305AbdFFNED (ORCPT ); Tue, 6 Jun 2017 09:04:03 -0400 X-Greylist: delayed 2153 seconds by postgrey-1.27 at vger.kernel.org; Tue, 06 Jun 2017 09:04:03 EDT MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 06 Jun 2017 14:27:48 +0200 From: =?UTF-8?Q?Rafa=C5=82_Mi=C5=82ecki?= To: Markus Mayer Cc: Zhang Rui , Eduardo Valentin , Rob Herring , Mark Rutland , Doug Berger , Brian Norris , Gregory Fong , Florian Fainelli , Broadcom Kernel List , Power Management List , Device Tree List , ARM Kernel List , Linux Kernel Mailing List , Markus Mayer Subject: Re: [PATCH 2/2] thermal: add brcmstb AVS TMON driver In-Reply-To: <20170605210930.65432-3-code@mmayer.net> References: <20170605210930.65432-1-code@mmayer.net> <20170605210930.65432-3-code@mmayer.net> Message-ID: User-Agent: Roundcube Webmail/1.2.5 X-Originating-IP: 194.187.74.233 X-Webmail-UserID: rafal@milecki.pl X-Ovh-Tracer-Id: 11516548672974982683 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeeljedrheelgdehfecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1199 Lines: 36 On 2017-06-05 23:09, Markus Mayer wrote: > --- /dev/null > +++ b/drivers/thermal/broadcom/brcmstb_thermal.c > @@ -0,0 +1,361 @@ > +/* > + * Broadcom STB AVS TMON thermal sensor driver > + * > + * Copyright (c) 2015-2017 Broadcom > + * > + * This software is licensed under the terms of the GNU General Public > + * License version 2, as published by the Free Software Foundation, > and > + * may be copied, distributed, and modified under those terms. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + */ The headers says GPL v2 but it doesn't match MODULE_LICENSE. Please be consistent. > +/* Convert a HW code to a temperature reading (millidegree celsius) */ > +static inline int avs_tmon_code_to_temp(u32 code) > +{ > + return (410040 - (int)((code & 0x3FF) * 487)); > +} I got similar hardcoded values and Eduardo told me to move them to the DT. See discussion in: https://patchwork.kernel.org/patch/9642119/ Hint: thermal_zone_get_offset + thermal_zone_get_slope