From patchwork Mon Mar 27 23:16:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shikhar Dogra X-Patchwork-Id: 9647707 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 41F0360328 for ; Mon, 27 Mar 2017 23:32:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 33C1327A98 for ; Mon, 27 Mar 2017 23:32:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 22CFD27F85; Mon, 27 Mar 2017 23:32:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, USER_IN_DEF_DKIM_WL autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7713627F85 for ; Mon, 27 Mar 2017 23:32:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752959AbdC0Xcb (ORCPT ); Mon, 27 Mar 2017 19:32:31 -0400 Received: from alln-iport-5.cisco.com ([173.37.142.92]:17713 "EHLO alln-iport-5.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752663AbdC0Xca (ORCPT ); Mon, 27 Mar 2017 19:32:30 -0400 X-Greylist: delayed 912 seconds by postgrey-1.27 at vger.kernel.org; Mon, 27 Mar 2017 19:32:30 EDT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1412; q=dns/txt; s=iport; t=1490657549; x=1491867149; h=date:from:to:cc:subject:message-id:mime-version; bh=sdEOWfvxjuEPo0g5o5stYW3p/zkWUjR8Afbc1Lot1L8=; b=BqUlNHgRc8fX1WdxmkSRJBj4usX/M+WisJrtscu1jrvF31cPm7oOepDB JUrpr7+Gt3C1RntsBx0lEJvAOBKzyoF/dwDBIYRlaW/V/iIof3C5qnwXh ldb/7kinqw5j43uEqrxmxLZsIF1xhwkFn5fPsDgVtoZ+fbAnv+zqAaBOj E=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0AhBwAIndlY/5pdJa1dGQEBAQEBAQEBA?= =?us-ascii?q?QEBBwEBAQEBg1RhgQuye4IPgg4shGaBEIMgQBcBAgEBAQEBAQFrKIUaPD88NAU?= =?us-ascii?q?YMhKKBgEOrj6KTwEBAQEBAQEDAQEBAQEBIhOGO4kpD4M/gjEFkGCLe4oliBqCC?= =?us-ascii?q?YUqigkCk2UhATWBBCQWCBcVhzlVAYlsAQEB?= X-IronPort-AV: E=Sophos;i="5.36,234,1486425600"; d="scan'208";a="402061039" Received: from rcdn-core-3.cisco.com ([173.37.93.154]) by alln-iport-5.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Mar 2017 23:16:44 +0000 Received: from sjc-ads-4188.cisco.com (sjc-ads-4188.cisco.com [171.70.54.209]) by rcdn-core-3.cisco.com (8.14.5/8.14.5) with ESMTP id v2RNGiih019873; Mon, 27 Mar 2017 23:16:44 GMT Received: by sjc-ads-4188.cisco.com (Postfix, from userid 341545) id 0E9D9771; Mon, 27 Mar 2017 16:16:44 -0700 (PDT) Date: Mon, 27 Mar 2017 16:16:44 -0700 From: Shikhar Dogra To: linux@roeck-us.net, jdelvare@suse.com, linux-hwmon@vger.kernel.org Cc: xe-linux-external@cisco.com, linux-kernel@vger.kernel.org Subject: [PATCH] driver: adm1275: set the m,b and R coefficients correctly for power Message-ID: <20170327231644.GA6121@sjc-ads-4188.cisco.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-12-10) X-Auto-Response-Suppress: DR, OOF, AutoReply Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Seems like coefficient values for m, b and R under power have been put in the wrong order. Rearranging them properly to get correct values of coefficients for power. For specs, please refer to table 7 (page 35) on http://www.analog.com/media/en/technical-documentation/data-sheets/ADM1075.pdf Fixes: 904b296f308d ("hwmon: (adm1275) Introduce configuration data structure for coeffcients") Signed-off-by: Shikhar Dogra Cc: xe-linux-external@cisco.com Cc: Guenter Roeck Cc: Jean Delvare Cc: linux-hwmon@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/hwmon/pmbus/adm1275.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hwmon/pmbus/adm1275.c b/drivers/hwmon/pmbus/adm1275.c index 188af4c..18477dd 100644 --- a/drivers/hwmon/pmbus/adm1275.c +++ b/drivers/hwmon/pmbus/adm1275.c @@ -95,8 +95,8 @@ static const struct coefficients adm1075_coefficients[] = { [0] = { 27169, 0, -1 }, /* voltage */ [1] = { 806, 20475, -1 }, /* current, irange25 */ [2] = { 404, 20475, -1 }, /* current, irange50 */ - [3] = { 0, -1, 8549 }, /* power, irange25 */ - [4] = { 0, -1, 4279 }, /* power, irange50 */ + [3] = { 8549, 0, -1 }, /* power, irange25 */ + [4] = { 4279, 0, -1 }, /* power, irange50 */ }; static const struct coefficients adm1275_coefficients[] = {