All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hwmon: (pmbus/lm25066) Swap low/high current coefficients for LM5066(i)
@ 2017-11-22 22:07 Robert Lippert
  2017-11-22 23:28 ` Guenter Roeck
  0 siblings, 1 reply; 7+ messages in thread
From: Robert Lippert @ 2017-11-22 22:07 UTC (permalink / raw)
  To: linux; +Cc: linux-hwmon, jdelvare, linux-kernel, xow, Robert Lippert

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.

Signed-off-by: Robert Lippert <rlippert@google.com>
---
 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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-11-28  0:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-22 22:07 [PATCH] hwmon: (pmbus/lm25066) Swap low/high current coefficients for LM5066(i) Robert Lippert
2017-11-22 23:28 ` Guenter Roeck
2017-11-22 23:39   ` Rob Lippert
2017-11-23  1:17     ` Guenter Roeck
2017-11-27 21:51       ` Rob Lippert
2017-11-27 22:08         ` Guenter Roeck
2017-11-28  0:31           ` Rob Lippert

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.