Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1610162 > unrolled thread

[PATCH] driver: adm1275: set the m,b and R coefficients correctly for power

Started byShikhar Dogra <shidogra@cisco.com>
First post2017-03-28 01:40 +0200
Last post2017-03-28 04:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] driver: adm1275: set the m,b and R coefficients correctly  for power Shikhar Dogra <shidogra@cisco.com> - 2017-03-28 01:40 +0200
    Re: [PATCH] driver: adm1275: set the m,b and R coefficients correctly  for power Guenter Roeck <linux@roeck-us.net> - 2017-03-28 04:50 +0200

#1610162 — [PATCH] driver: adm1275: set the m,b and R coefficients correctly for power

FromShikhar Dogra <shidogra@cisco.com>
Date2017-03-28 01:40 +0200
Subject[PATCH] driver: adm1275: set the m,b and R coefficients correctly for power
Message-ID<tpMoW-7gK-11@gated-at.bofh.it>
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 <shidogra@cisco.com>
Cc: xe-linux-external@cisco.com
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Jean Delvare <jdelvare@suse.com>
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[] = {
-- 
2.5.0

[toc] | [next] | [standalone]


#1610270

FromGuenter Roeck <linux@roeck-us.net>
Date2017-03-28 04:50 +0200
Message-ID<tpPmN-YV-3@gated-at.bofh.it>
In reply to#1610162
On 03/27/2017 04:16 PM, Shikhar Dogra wrote:
> 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.
>

Oops :-(

Thanks a lot, applied.

Guenter

> 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 <shidogra@cisco.com>
> Cc: xe-linux-external@cisco.com
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: Jean Delvare <jdelvare@suse.com>
> 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[] = {
>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web