Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755220AbbLJSFS (ORCPT ); Thu, 10 Dec 2015 13:05:18 -0500 Received: from mail1.bemta5.messagelabs.com ([195.245.231.148]:56804 "EHLO mail1.bemta5.messagelabs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754932AbbLJSFQ (ORCPT ); Thu, 10 Dec 2015 13:05:16 -0500 X-Env-Sender: Andreas.Werner@men.de X-Msg-Ref: server-12.tower-179.messagelabs.com!1449770714!9337639!1 X-Originating-IP: [80.255.6.145] X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked X-PGP-Universal: processed; by keys.men.de on Thu, 10 Dec 2015 19:05:14 +0100 Date: Thu, 10 Dec 2015 19:03:14 +0100 From: Andreas Werner To: Guenter Roeck CC: Andreas Werner , , , , Subject: Re: LM90 driver and ti tmp461 detection Message-ID: <20151210180314.GB28022@awelinux> References: <20151210120856.GA27765@awelinux> <5669AB55.5030309@roeck-us.net> <20151210171231.GA28022@awelinux> <5669B9D9.9050908@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <5669B9D9.9050908@roeck-us.net> User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [192.1.1.170] X-ClientProxiedBy: MEN-EX01.intra.men.de (192.168.1.1) To MEN-EX01.intra.men.de (192.168.1.1) X-EXCLAIMER-MD-CONFIG: e4841e51-7998-49c0-ba41-8b8a0e2d8962 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2159 Lines: 64 ... > On Thu, Dec 10, 2015 at 09:43:53AM -0800, Guenter Roeck wrote: > > > >There is one difference. The temperature ranges differ: > > > >TMP451: > >Standard Mode: 0 to +127 > >Extended Mode: -64 to +191 > > > >TMP461: > >Standard Mode: -40 to +127 > >Extended Mode: -64 to +191 > > > >Therefore the calcualtion is different then the tmp451 one. > > > Not really. The tmp451 will return 0 for negative temperatures in standard mode, > the tmp461 will return negative (signed) values. Temperatures are stored > as signed values, so the code should be ok as is. Am I missing something ? > It will work to read the local and external temperature yes, but not for setting the temperatur. If setting in standard mode, the tmp451 part fix the value to 0-127 but for the tmp461 we have -40 to 127. I'v currently no chip here in the office to test it, hopefully I will get one next week. > >I also aggree with you with the magical ID register. I hate such > >kind of register with are not documented and may have a value. > > > >I have a DT based board yes, but i have also planed to submit my changes > >and also wanted to implement the autodetection of the chip. > > I don't think auto-detection (other than handling the chip as tmp451) > will be possible, but I am looking forward to seeing your patch(es). > Yes, i think autodetection makes it very crapy. May be i will find another solution. > > > >I have also planned (or need) to implement the "n-Factor Correction" for the > >CPU diodes. There is a register to set this value in the tmp451 and tmp461. > >Would that make sense to add a DT property for the driver to be able > >to set this value? What do you think? > > > Yes, since this is a board (hardware) property. Other chips have similar > registers. We'll just have to find a good set of property names and descriptions. > Ok, I will find a way to do it :-) > Thanks, > Guenter > Regards Andy -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/