Received: by 10.223.164.202 with SMTP id h10csp2227798wrb; Mon, 27 Nov 2017 13:52:58 -0800 (PST) X-Google-Smtp-Source: AGs4zMbQox6mxKKKFfllXQ52V+AGrdAvKLsBTMcuDy7KPih7KLDVrCVsRHPjZKEtwWBE7+XvRjas X-Received: by 10.99.124.20 with SMTP id x20mr38720944pgc.419.1511819578135; Mon, 27 Nov 2017 13:52:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511819578; cv=none; d=google.com; s=arc-20160816; b=wsIuS+YLIDvmFt4EwsV+ywYo2w+V3GunhnX4XshevJ401YXcgzO2cItn3PDqfc2Y2z jm9xNIuPrPw4l/ZahI+PgEsWkiPdv1JpuFVP+TzkB/pgncwbK3SkzmL57E/K5y2ubQjd RX65PF7bDIAmPuXIdUMlizEnlFcq5OzdSrOh4UAXAcQEPPNNBp9c0GLtnI03F2Kub500 +9PZSwdwKL0obkE/1jw9C6yRw0cViseJVFvWwhugxtzHLtygfr37MwZsLwtrydjgH09W IF6W1irI8if/+u5aVUuwJ/mSTWQ8gvkM3yH/FQ60TIfdCMccID7TO270eVSIKPMGoe0x nHBQ== 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=UTEnN0okSEQOO4C3i0W/rC0mO+EdJxLYTA47keM7wx0=; b=rBRwXAe9W6iA9x16TSTWcAw42AUKCJZk9gbRRlFjzEI7yzIqIrxUJ1CQpxrJBNyVyF QPwJQf5uZ3eh5dA5KdfJEO6u4Aa4N5ehcGB73umIx6NAa4RGPIftshvKKKfR8q0pwphr 9+MWRTeqCFMw6J6Yfge4RxBg9BcFWpSc7qc8pAcwzWA3AD344PGNhDl1YWkGDqcazlgD XU8hLt6aZosXDYjK5FpmSoITztvSbMvKNI2vUHCzHzZyrKKorWnkhjzUGxzsdhvH9XA3 TTdnDozRbKY2OtM03udex8YJvwvEdBawOLlzeqYt8dTUbt4d0lvBgXA+8uzF0f7bgnky 6v0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Ka0OmGkP; 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 z13si20560411pfi.27.2017.11.27.13.52.46; Mon, 27 Nov 2017 13:52:58 -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=Ka0OmGkP; 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 S1752827AbdK0Vv7 (ORCPT + 78 others); Mon, 27 Nov 2017 16:51:59 -0500 Received: from mail-qt0-f182.google.com ([209.85.216.182]:44923 "EHLO mail-qt0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751702AbdK0Vv5 (ORCPT ); Mon, 27 Nov 2017 16:51:57 -0500 Received: by mail-qt0-f182.google.com with SMTP id h42so41100961qtk.11 for ; Mon, 27 Nov 2017 13:51:56 -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=UTEnN0okSEQOO4C3i0W/rC0mO+EdJxLYTA47keM7wx0=; b=Ka0OmGkP1QH6yL/wWBh7aSNJy7kUZPv1BT8s912Gs3yr+cbGMsagr6xhaXt8oQSsDo KEohYhtOkCZIAGzKz2Ch6LLRkY9rneXQRT1B9Ed/MQFGfx5vdxVACwE9OvvdtO3OZ4uB J9cfyRWz4pCy5KnVc3AyMlxAAHjprZc7yuLTbGE+tEgVKZIGKy5lmY5qDe0pYz0HurQh CCdZAAO/FvDSbWDgj54sEM5g3YziJO09U1mj5Twu0tfaA6S7lU28HIMmYmKpKLFyDXjA nc0UV59WrPIrWmFirPGMAP6ghaVuf6u7eIpUU7JiRlggSHeMCO/P1U+CkX0zdjWmC8cC l01A== 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=UTEnN0okSEQOO4C3i0W/rC0mO+EdJxLYTA47keM7wx0=; b=t0dwK2+mkHiy6sqkbVy1AhXu8RdzsXHwWEHlIAJ1DV6Nt9cdqFRVqZ25IWI92rpa5X wSehr/8xx9Mrh3fRrWWG8SCUbNuqgrPZilkd1E9jP+IVPrSKasuAjNc3SLfBtaoCX/mq WhcQk2JTAFQokZhuMpIS0EiGeKghfTaP3ZoDAfCLuJjIGksQHqmeCDqr7iSS4TXdtGx5 GiRvt772Ke7xxIkDIgpVQWyF81iviUGG7ZIT2ERg9c8oI66YIT3GPGPrG2VImlFCeXNg zN7bPeg5NxjL+wgim76DhNUFTvj403Bjjcr4SFQsMOjC1+6qwW0sqhdOlDNo0V/1zDJe KX8Q== X-Gm-Message-State: AJaThX5j/IJhDEGiFKe6tv6tJ0kkyjuUMWtphi8laQTGDQhzJlmSUkdj TTpVChJt5doFS7lLgwsrHRzYrnBfo5E4ZNbFRrIoUg== X-Received: by 10.200.51.20 with SMTP id t20mr63840559qta.150.1511819516149; Mon, 27 Nov 2017 13:51:56 -0800 (PST) MIME-Version: 1.0 Received: by 10.237.35.17 with HTTP; Mon, 27 Nov 2017 13:51:35 -0800 (PST) In-Reply-To: <91322e5e-23e3-ea6a-04bd-1c23fedadbf7@roeck-us.net> References: <20171122220728.17861-1-rlippert@google.com> <20171122232816.GA4615@roeck-us.net> <91322e5e-23e3-ea6a-04bd-1c23fedadbf7@roeck-us.net> From: Rob Lippert Date: Mon, 27 Nov 2017 13:51:35 -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 5:17 PM, Guenter Roeck wrote: > Hi Rob, > > On 11/22/2017 03:39 PM, Rob Lippert wrote: >> >> 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. >> > Are you sure that floating is equivalent to GND ? I didn't check the > datasheet, but it is more common for chips to have an internal pull-up. > >>> >>> 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 :) > > > Same here. > >> But I don't have any hardware setup with CL=VDD to test... >> > > I do have various evaluation boards, so I should be able to do some testing. > I hope I'll get to it over the weekend. Actually turns out my board does tie CL=VDD as recommended by the LM5066i datasheet to improve the current/power reporting accuracy. But the value in 0xD9 is always zero so it seems there is no way to read this CL pin setting from the device. I think my commit is technically correct but it seems will likely break the readings for most boards that follow the datasheet typical circuit which recommends CL=VDD. Would it make sense to remove the code trying to read the CL setting and default the coefficient values to the "low current limit" CL=VDD setting? (and maybe something in devtree or module param to pick the other coefficients?) -Rob From 1584817689866193896@xxx Thu Nov 23 01:18:47 +0000 2017 X-GM-THRID: 1584805791154205642 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread