[{"id":1759814,"web_url":"http://patchwork.ozlabs.org/comment/1759814/","msgid":"<20170830020329.GA22035@roeck-us.net>","list_archive_url":null,"date":"2017-08-30T02:03:29","subject":"Re: [2/2] hwmon: (pmbus/lm25066) Add support for TI LM5066I","submitter":{"id":21889,"url":"http://patchwork.ozlabs.org/api/people/21889/","name":"Guenter Roeck","email":"linux@roeck-us.net"},"content":"On Tue, Aug 29, 2017 at 02:21:17PM -0700, Xo Wang wrote:\n> The TI LM5066I hotswap controller is a more accurate version of the\n> LM5066 device already supported. It has different measurement conversion\n> coefficients than the LM5066, so it needs to be recognized as a\n> different device.\n> \n> Signed-off-by: Xo Wang <xow@google.com>\n\nApplied to hwmon-next.\n\nThanks,\nGuenter\n\n> ---\n>  Documentation/hwmon/lm25066   |  9 +++++++--\n>  drivers/hwmon/pmbus/lm25066.c | 41 +++++++++++++++++++++++++++++++++++++++--\n>  2 files changed, 46 insertions(+), 4 deletions(-)\n> \n> diff --git a/Documentation/hwmon/lm25066 b/Documentation/hwmon/lm25066\n> index 2cb20ebb234d..3fa6bf820c88 100644\n> --- a/Documentation/hwmon/lm25066\n> +++ b/Documentation/hwmon/lm25066\n> @@ -29,6 +29,11 @@ Supported chips:\n>      Addresses scanned: -\n>      Datasheet:\n>  \thttp://www.national.com/pf/LM/LM5066.html\n> +  * Texas Instruments LM5066I\n> +    Prefix: 'lm5066i'\n> +    Addresses scanned: -\n> +\tDatasheet:\n> +    http://www.ti.com/product/LM5066I\n>  \n>  Author: Guenter Roeck <linux@roeck-us.net>\n>  \n> @@ -37,8 +42,8 @@ Description\n>  -----------\n>  \n>  This driver supports hardware monitoring for National Semiconductor / TI LM25056,\n> -LM25063, LM25066, LM5064, and LM5066 Power Management, Monitoring, Control, and\n> -Protection ICs.\n> +LM25063, LM25066, LM5064, and LM5066/LM5066I Power Management, Monitoring,\n> +Control, and Protection ICs.\n>  \n>  The driver is a client driver to the core PMBus driver. Please see\n>  Documentation/hwmon/pmbus for details on PMBus client drivers.\n> diff --git a/drivers/hwmon/pmbus/lm25066.c b/drivers/hwmon/pmbus/lm25066.c\n> index 232b4af13e12..10d17fb8f283 100644\n> --- a/drivers/hwmon/pmbus/lm25066.c\n> +++ b/drivers/hwmon/pmbus/lm25066.c\n> @@ -28,7 +28,7 @@\n>  #include <linux/i2c.h>\n>  #include \"pmbus.h\"\n>  \n> -enum chips { lm25056, lm25063, lm25066, lm5064, lm5066 };\n> +enum chips { lm25056, lm25063, lm25066, lm5064, lm5066, lm5066i };\n>  \n>  #define LM25066_READ_VAUX\t\t0xd0\n>  #define LM25066_MFR_READ_IIN\t\t0xd1\n> @@ -65,7 +65,7 @@ struct __coeff {\n>  #define PSC_CURRENT_IN_L\t(PSC_NUM_CLASSES)\n>  #define PSC_POWER_L\t\t(PSC_NUM_CLASSES + 1)\n>  \n> -static struct __coeff lm25066_coeff[5][PSC_NUM_CLASSES + 2] = {\n> +static struct __coeff lm25066_coeff[6][PSC_NUM_CLASSES + 2] = {\n>  \t[lm25056] = {\n>  \t\t[PSC_VOLTAGE_IN] = {\n>  \t\t\t.m = 16296,\n> @@ -210,6 +210,41 @@ static struct __coeff lm25066_coeff[5][PSC_NUM_CLASSES + 2] = {\n>  \t\t\t.m = 16,\n>  \t\t},\n>  \t},\n> +\t[lm5066i] = {\n> +\t\t[PSC_VOLTAGE_IN] = {\n> +\t\t\t.m = 4617,\n> +\t\t\t.b = -140,\n> +\t\t\t.R = -2,\n> +\t\t},\n> +\t\t[PSC_VOLTAGE_OUT] = {\n> +\t\t\t.m = 4602,\n> +\t\t\t.b = 500,\n> +\t\t\t.R = -2,\n> +\t\t},\n> +\t\t[PSC_CURRENT_IN] = {\n> +\t\t\t.m = 15076,\n> +\t\t\t.b = -504,\n> +\t\t\t.R = -2,\n> +\t\t},\n> +\t\t[PSC_CURRENT_IN_L] = {\n> +\t\t\t.m = 7645,\n> +\t\t\t.b = 100,\n> +\t\t\t.R = -2,\n> +\t\t},\n> +\t\t[PSC_POWER] = {\n> +\t\t\t.m = 1701,\n> +\t\t\t.b = -4000,\n> +\t\t\t.R = -3,\n> +\t\t},\n> +\t\t[PSC_POWER_L] = {\n> +\t\t\t.m = 861,\n> +\t\t\t.b = -965,\n> +\t\t\t.R = -3,\n> +\t\t},\n> +\t\t[PSC_TEMPERATURE] = {\n> +\t\t\t.m = 16,\n> +\t\t},\n> +\t},\n>  };\n>  \n>  struct lm25066_data {\n> @@ -250,6 +285,7 @@ static int lm25066_read_word_data(struct i2c_client *client, int page, int reg)\n>  \t\t\tret = DIV_ROUND_CLOSEST(ret * 70, 453);\n>  \t\t\tbreak;\n>  \t\tcase lm5066:\n> +\t\tcase lm5066i:\n>  \t\t\t/* VIN: 2.18 mV VAUX: 725 uV LSB */\n>  \t\t\tret = DIV_ROUND_CLOSEST(ret * 725, 2180);\n>  \t\t\tbreak;\n> @@ -511,6 +547,7 @@ static const struct i2c_device_id lm25066_id[] = {\n>  \t{\"lm25066\", lm25066},\n>  \t{\"lm5064\", lm5064},\n>  \t{\"lm5066\", lm5066},\n> +\t{\"lm5066i\", lm5066i},\n>  \t{ }\n>  };\n>","headers":{"Return-Path":"<openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>","X-Original-To":["incoming@patchwork.ozlabs.org","openbmc@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","openbmc@lists.ozlabs.org"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xhphJ3X3zz9sP5\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 30 Aug 2017 12:03:44 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xhphJ246nzDqGh\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 30 Aug 2017 12:03:44 +1000 (AEST)","from bh-25.webhostbox.net (bh-25.webhostbox.net [208.91.199.152])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xhph55sD2zDq5b\n\tfor <openbmc@lists.ozlabs.org>; Wed, 30 Aug 2017 12:03:33 +1000 (AEST)","from 108-223-40-66.lightspeed.sntcca.sbcglobal.net\n\t([108.223.40.66]:49818 helo=localhost)\n\tby bh-25.webhostbox.net with esmtpsa\n\t(TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128)\n\t(Exim 4.89) (envelope-from <linux@roeck-us.net>)\n\tid 1dmsLq-003SMk-9K; Wed, 30 Aug 2017 02:03:31 +0000"],"Authentication-Results":["ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=roeck-us.net header.i=@roeck-us.net\n\theader.b=\"3L3S+2vx\"; dkim-atps=neutral","lists.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=roeck-us.net header.i=@roeck-us.net\n\theader.b=\"3L3S+2vx\"; dkim-atps=neutral","lists.ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=roeck-us.net header.i=@roeck-us.net\n\theader.b=\"3L3S+2vx\"; dkim-atps=neutral"],"DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=roeck-us.net; s=default;\n\th=In-Reply-To:Content-Type:MIME-Version:References\n\t:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding\n\t:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:\n\tResent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:\n\tList-Subscribe:List-Post:List-Owner:List-Archive;\n\tbh=farqvDBNb9gwSbDhcOjeiIr6oh2A/WzBZ2COMFIEPHs=;\n\tb=3L3S+2vxIujH+CoZIv4AGk5mAl\n\tD7PW63nlZhA1Xg6Q4Y/7QjiKhImtbOWaTKmoH5XUf3P+9xWgp/AnstfEBhcj4WoB372iXpIQ920gN\n\tyNITuStx+cj+wrMY+o+J3NHxk6NZID4MiOA5SUPd+tqxjQF6Cauqh6uppqu/sv5Y8uB/iITh24Ozp\n\t2WCipXZKndPKLyUehKk60UFCHcDEFNk9dHqDwcV35FA1rtyubXwxLTEXjbuM/E4JGARwB7LsVsePn\n\t9r3TpwLu65XeexoQfD/qLYaQMBwkSj/FKwMMU7RiGk+jRwXfeGqGFBrTd5Da+kLrErHJhJX6hDunI\n\thg6g9yIg==;","Date":"Tue, 29 Aug 2017 19:03:29 -0700","From":"Guenter Roeck <linux@roeck-us.net>","To":"Xo Wang <xow@google.com>","Subject":"Re: [2/2] hwmon: (pmbus/lm25066) Add support for TI LM5066I","Message-ID":"<20170830020329.GA22035@roeck-us.net>","References":"<20170829212117.143441-3-xow@google.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170829212117.143441-3-xow@google.com>","User-Agent":"Mutt/1.5.24 (2015-08-30)","X-Authenticated_sender":"guenter@roeck-us.net","X-OutGoing-Spam-Status":"No, score=-1.0","X-AntiAbuse":["This header was added to track abuse,\n\tplease include it with any abuse report","Primary Hostname - bh-25.webhostbox.net","Original Domain - lists.ozlabs.org","Originator/Caller UID/GID - [47 12] / [47 12]","Sender Address Domain - roeck-us.net"],"X-Get-Message-Sender-Via":"bh-25.webhostbox.net: authenticated_id:\n\tguenter@roeck-us.net","X-Authenticated-Sender":"bh-25.webhostbox.net: guenter@roeck-us.net","X-Source":"","X-Source-Args":"","X-Source-Dir":"","X-BeenThere":"openbmc@lists.ozlabs.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"Development list for OpenBMC <openbmc.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/openbmc>,\n\t<mailto:openbmc-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/openbmc/>","List-Post":"<mailto:openbmc@lists.ozlabs.org>","List-Help":"<mailto:openbmc-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/openbmc>,\n\t<mailto:openbmc-request@lists.ozlabs.org?subject=subscribe>","Cc":"linux-hwmon@vger.kernel.org, jdelvare@suse.com, linux-doc@vger.kernel.org,\n\topenbmc@lists.ozlabs.org, corbet@lwn.net, linux-kernel@vger.kernel.org","Errors-To":"openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org","Sender":"\"openbmc\"\n\t<openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>"}}]