Received: by 10.223.164.202 with SMTP id h10csp54225wrb; Wed, 22 Nov 2017 15:40:10 -0800 (PST) X-Google-Smtp-Source: AGs4zMaICxWsnpCwlUoltj9SIU+5rdaIe+JowzYySD1xtdATIQqJgg9XozOZMjPAXmEX7/v/sp9R X-Received: by 10.98.166.84 with SMTP id t81mr20870672pfe.196.1511394010021; Wed, 22 Nov 2017 15:40:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511394009; cv=none; d=google.com; s=arc-20160816; b=Lmc6d8AN9BAlOjQ7B/Xdt/Xz1w+MUxP25KFnkhVdhPBxSa2wb08mvaQV1VhCfuRxwO rjp+Xo6+U9Bv8aWS0+Kkc/5ZCUWs2WQBCNavBw1QrPZvaib9L0omc8Vp3T/gHcUiGTQU 8QCw3bv4Usrwxl7Sjde6G+rhoxOShryZJcJsDuqnklKM0V3KoN/dvGnipbARd3SM4Cpl O59PTsdMR+2RUcHiQoi15ITsH+arKEo6orvbO+CgAl2Jy1/iuSQPrZcWkhLo07s9n0fr OLmYJIs+TLqsUkFQbvewqIepL0J+kAVJVCIDSnAUWSxp0suhWLuwuby8JCIy68Pzqi9a 7XBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=XgSK2poCRq3SINIry+b8xw33fHD1nV9CCsMAtYcxOmw=; b=QmYCqwg9MU3jFF8yUs5KoK03FmzWRiWnjgsEYYL4NhGarRV/B/1ltctMhrYq4Y0rSZ Qzd91eSmrorjHqMaZ8I9vPdvhkbrmLCKutGUdUd+R9eBVJH1cRNrn0LC2bvZN1v4+wU4 wjgpaiae1rQRjTMpESP1EMfuNUjqOETHZeCXDbK22V8JJTBAUWRVbSffSh02Vj7JyhE6 hXxT0AjpF3dBnhzxK4uoeDZDDPuyHwpsGh6mvmVHT7texRi1tNZxrsp3ojoudj/8JqB+ eulqUbllnF5+WUzXPQ1qUEkCTrNXjpDyoENgb+c3pMDovlzVxuW48QBD4R3z15jnf2g+ AwKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Bpg01S72; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p14si14010664pgu.569.2017.11.22.15.39.58; Wed, 22 Nov 2017 15:40:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Bpg01S72; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751825AbdKVXjZ (ORCPT + 78 others); Wed, 22 Nov 2017 18:39:25 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:38222 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751673AbdKVXjX (ORCPT ); Wed, 22 Nov 2017 18:39:23 -0500 Received: by mail-wm0-f68.google.com with SMTP id 128so13276058wmo.3 for ; Wed, 22 Nov 2017 15:39:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=XgSK2poCRq3SINIry+b8xw33fHD1nV9CCsMAtYcxOmw=; b=Bpg01S72oXf64poW9onyF82AqtU06vOL8RG6JyZRS0PO0rIZ5Gtd1NbihTrF8rcfTr FJf3GtoLf9GXGKhjlYKt/6lDuKSNCn+KvimMxFJi9780S5J0DseRJ1SJjmNntiP15MFD 8OdyuD9R3A2mVa1qL5WsNm4kldSXLNC31ct+o340VzsgCFspW09saJd9khl63L3KGduW Q+lV8jaxxmw3LeAFGAhRldS6ZYtyGGj7SPJioYGTeBgsWvVL3TcindebNTqqKGREuinr /QvnidIOHk0ve8ieAQT3Ljcu6sAh/g5STHbx4aMK1TyhGQCfW8a1R2XtClRY1HvzKX0+ tqYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=XgSK2poCRq3SINIry+b8xw33fHD1nV9CCsMAtYcxOmw=; b=ZUWCqKI3vW03i7YmiMlynLskRqwdchy5dqxVFyBEeTHYx3Rmv0r9FzU6/0i2EIeMT7 nTCO6LbXMgcz4j6qJCtY4RQ/71STRvDd08WVcKwdNJthRZ8GY9+HG7J/NanuDR4uVT8d GP3xX0SZy43jP17ybYw1OMzPezim0PU09bKrRP9xgMmEf4XkJRSZUjQI/RSTZGLXy53i 62gnTy6LaGujcH8FNX69XhTjf1/mU2FGwU24aLCNqOZl+Ln+MNE3gTvqHqUBVGowvaAp B8iMWghPFpkp6uE84oe9+XVn/S+KK8DpSKcPiDlaBzVny0ynMes1JXJ3nNuozekMhabf Qhdw== X-Gm-Message-State: AJaThX7YoOFEtLpoU7K4M7iL7NvuNDGEAVYS0OtzUwj2Nq+wijqfjakD p+A2uSStxhjgE0KLhKoESnmPU+LbnktnmpK/QheXRQ== X-Received: by 10.28.23.67 with SMTP id 64mr5139524wmx.101.1511393961422; Wed, 22 Nov 2017 15:39:21 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.143.42 with HTTP; Wed, 22 Nov 2017 15:39:00 -0800 (PST) In-Reply-To: <20171122232816.GA4615@roeck-us.net> References: <20171122220728.17861-1-rlippert@google.com> <20171122232816.GA4615@roeck-us.net> From: Rob Lippert Date: Wed, 22 Nov 2017 15:39:00 -0800 Message-ID: Subject: Re: [PATCH] hwmon: (pmbus/lm25066) Swap low/high current coefficients for LM5066(i) To: Guenter Roeck Cc: Robert Lippert , linux-hwmon@vger.kernel.org, jdelvare@suse.com, linux-kernel@vger.kernel.org, Xo Wang Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 22, 2017 at 3:28 PM, Guenter Roeck wrote: > > On Wed, Nov 22, 2017 at 02:07:28PM -0800, Robert Lippert wrote: > > The _L low-current mode coefficient values should reference the > > datasheet rows with CL=VDD but it seems were mistakenly pulled from > > the rows with CL=GND. > > > > This causes the current/power to be reported as approximately double > > the actual value when CL=GND and half the actual value when CL=VDD. > > > > This would affect all chips supported by this driver. Hmm, and I was sure > I tested this. I'll have to dig out my hardware and confirm. I'm still not 100% convinced this commit is correct as I haven't been able to validate the measurements against an external probe yet (and my test board uses a non-standard sense resistor which means it needs additional massaging of the data anyhow). > > > The code currently only uses bit 4 of the DEVICE_SETUP (D9h) command > to determine which current limit setting to use. Looking into the > datasheet, it looks like it also has to evaluate bit 2, and I wonder > if there is a means to determine CL if bit 2 = 0. Any idea ? On my test board CL=floating (equivalent to GND) and the value of register 0xD9 is all zeroes. > > Does bit 4 report the CL pin value if bit 2 = 0 ? I can't tell by reading the datasheet that 0xD9 bit4 will ever report the pin value as the language is difficult to parse :) But I don't have any hardware setup with CL=VDD to test... -Rob > > Thanks, > Guenter > > > Signed-off-by: Robert Lippert > > --- > > drivers/hwmon/pmbus/lm25066.c | 24 ++++++++++++------------ > > 1 file changed, 12 insertions(+), 12 deletions(-) > > > > diff --git a/drivers/hwmon/pmbus/lm25066.c b/drivers/hwmon/pmbus/lm25066.c > > index 10d17fb8f283..aa052f4449a9 100644 > > --- a/drivers/hwmon/pmbus/lm25066.c > > +++ b/drivers/hwmon/pmbus/lm25066.c > > @@ -191,19 +191,19 @@ static struct __coeff lm25066_coeff[6][PSC_NUM_CLASSES + 2] = { > > .R = -2, > > }, > > [PSC_CURRENT_IN] = { > > - .m = 10753, > > + .m = 5405, > > .R = -2, > > }, > > [PSC_CURRENT_IN_L] = { > > - .m = 5405, > > + .m = 10753, > > .R = -2, > > }, > > [PSC_POWER] = { > > - .m = 1204, > > + .m = 605, > > .R = -3, > > }, > > [PSC_POWER_L] = { > > - .m = 605, > > + .m = 1204, > > .R = -3, > > }, > > [PSC_TEMPERATURE] = { > > @@ -222,23 +222,23 @@ static struct __coeff lm25066_coeff[6][PSC_NUM_CLASSES + 2] = { > > .R = -2, > > }, > > [PSC_CURRENT_IN] = { > > - .m = 15076, > > - .b = -504, > > + .m = 7645, > > + .b = 100, > > .R = -2, > > }, > > [PSC_CURRENT_IN_L] = { > > - .m = 7645, > > - .b = 100, > > + .m = 15076, > > + .b = -504, > > .R = -2, > > }, > > [PSC_POWER] = { > > - .m = 1701, > > - .b = -4000, > > + .m = 861, > > + .b = -965, > > .R = -3, > > }, > > [PSC_POWER_L] = { > > - .m = 861, > > - .b = -965, > > + .m = 1701, > > + .b = -4000, > > .R = -3, > > }, > > [PSC_TEMPERATURE] = { > > -- > > 2.15.0.448.gf294e3d99a-goog > > From 1584810789435335646@xxx Wed Nov 22 23:29:06 +0000 2017 X-GM-THRID: 1584805791154205642 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread