All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] Fix swapped coeffs for LM5066 and LM5066i iin
@ 2019-01-28 17:00 Matt Wilbur
  2019-01-28 17:00 ` [PATCH 1/1] " Matt Wilbur
  0 siblings, 1 reply; 4+ messages in thread
From: Matt Wilbur @ 2019-01-28 17:00 UTC (permalink / raw)
  To: linux-hwmon; +Cc: Matt Wilbur

For the LM5066,

For CL=GND,  50 mV threshold && DEVICE_SETUP[4] == 0
For CL=VDD, 26 mV threshold && DEVICE_SETUP[4] == 1

(from Section 8.3.1 and Table 31 of current datasheet)

And from Table 43 (I have reversed the rows of the datasheet to stay
consistent with your ordering):

CL = GND: m = 5405, b =-600, R - 2
CL = VDD:  m = 10753, b = -1200, R = -2

Combining the two statements:
DEVICE_SETUP[4] == 0: m = 5405, b =-600, R - 2
DEVICE_SETUP[4] == 1: m = 10753, b = -1200, R = -2

According to current code (again reversing the order to be consistent
with the above):

DEVICE_SETUP[4] == 0: use coeff[PSC_CURRENT_IN]
DEVICE_SETUP[4] == 1: use coeff[PSC_CURRENT_IN_L]

And for the lm5066 coefficient:

        [PSC_CURRENT_IN] = {
            .m = 10753,
            .R = -2,
        },
        [PSC_CURRENT_IN_L] = {
            .m = 5405,
            .R = -2,
        },

Again, combing the two:

DEVICE_SETUP[4] == 0: m = 10753, b = 0, R = -2
DEVICE_SETUP[4] == 1: m = 5405, b = 0, R = -2

which which is the opposite of the device datasheet (which I copy and
paste here):

DEVICE_SETUP[4] == 0: m = 5405, b =-600, R - 2
DEVICE_SETUP[4] == 1: m = 10753, b = -1200, R = -2


Matt Wilbur (1):
  Fix swapped coeffs for LM5066 and LM5066i iin

 drivers/hwmon/pmbus/lm25066.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

-- 
2.17.1


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

* [PATCH 1/1] Fix swapped coeffs for LM5066 and LM5066i iin
  2019-01-28 17:00 [PATCH 0/1] Fix swapped coeffs for LM5066 and LM5066i iin Matt Wilbur
@ 2019-01-28 17:00 ` Matt Wilbur
  2019-01-31 18:11   ` Guenter Roeck
  0 siblings, 1 reply; 4+ messages in thread
From: Matt Wilbur @ 2019-01-28 17:00 UTC (permalink / raw)
  To: linux-hwmon; +Cc: Matt Wilbur

---
 drivers/hwmon/pmbus/lm25066.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/hwmon/pmbus/lm25066.c b/drivers/hwmon/pmbus/lm25066.c
index 53db78753a0d..9d917b5f0a81 100644
--- a/drivers/hwmon/pmbus/lm25066.c
+++ b/drivers/hwmon/pmbus/lm25066.c
@@ -156,11 +156,11 @@ 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] = {
@@ -197,13 +197,13 @@ static struct __coeff lm25066_coeff[6][PSC_NUM_CLASSES + 2] = {
 			.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.17.1


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

* Re: [PATCH 1/1] Fix swapped coeffs for LM5066 and LM5066i iin
  2019-01-28 17:00 ` [PATCH 1/1] " Matt Wilbur
@ 2019-01-31 18:11   ` Guenter Roeck
  2019-02-01 11:41     ` Matt Wilbur
  0 siblings, 1 reply; 4+ messages in thread
From: Guenter Roeck @ 2019-01-31 18:11 UTC (permalink / raw)
  To: Matt Wilbur; +Cc: linux-hwmon

Hi,

On Mon, Jan 28, 2019 at 12:00:34PM -0500, Matt Wilbur wrote:
> ---

Unfortunately, your patch is not signed, and I can not apply it.
Also, the explanation should be part of this patch. Please
also note the expected subject line, which should start with
"hwmon: (pmbus/lm25066)".

On top of that, while the subject claims to also address LM5066i,
it does not really do that.

Guenter

>  drivers/hwmon/pmbus/lm25066.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/hwmon/pmbus/lm25066.c b/drivers/hwmon/pmbus/lm25066.c
> index 53db78753a0d..9d917b5f0a81 100644
> --- a/drivers/hwmon/pmbus/lm25066.c
> +++ b/drivers/hwmon/pmbus/lm25066.c
> @@ -156,11 +156,11 @@ 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] = {
> @@ -197,13 +197,13 @@ static struct __coeff lm25066_coeff[6][PSC_NUM_CLASSES + 2] = {
>  			.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.17.1
> 

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

* Re: [PATCH 1/1] Fix swapped coeffs for LM5066 and LM5066i iin
  2019-01-31 18:11   ` Guenter Roeck
@ 2019-02-01 11:41     ` Matt Wilbur
  0 siblings, 0 replies; 4+ messages in thread
From: Matt Wilbur @ 2019-02-01 11:41 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: linux-hwmon

On Thu, Jan 31, 2019 at 1:11 PM Guenter Roeck <linux@roeck-us.net> wrote:
>
> Hi,
>
> On Mon, Jan 28, 2019 at 12:00:34PM -0500, Matt Wilbur wrote:
> > ---
>
> Unfortunately, your patch is not signed, and I can not apply it.
> Also, the explanation should be part of this patch. Please
> also note the expected subject line, which should start with
> "hwmon: (pmbus/lm25066)".
>
> On top of that, while the subject claims to also address LM5066i,
> it does not really do that.

I will give it another shot - but I did switch the coefficients for
the LM5066i current measurement.

Since this was my first attempt at submitting a patch, I wanted to
work through the process.
I also need to swap power coefficients and add the b coefficient for
the LM5066 and LM5066i.

Matt


>
> Guenter
>
> >  drivers/hwmon/pmbus/lm25066.c | 12 ++++++------
> >  1 file changed, 6 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/hwmon/pmbus/lm25066.c b/drivers/hwmon/pmbus/lm25066.c
> > index 53db78753a0d..9d917b5f0a81 100644
> > --- a/drivers/hwmon/pmbus/lm25066.c
> > +++ b/drivers/hwmon/pmbus/lm25066.c
> > @@ -156,11 +156,11 @@ 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] = {
> > @@ -197,13 +197,13 @@ static struct __coeff lm25066_coeff[6][PSC_NUM_CLASSES + 2] = {
> >                       .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.17.1
> >

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

end of thread, other threads:[~2019-02-01 11:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-28 17:00 [PATCH 0/1] Fix swapped coeffs for LM5066 and LM5066i iin Matt Wilbur
2019-01-28 17:00 ` [PATCH 1/1] " Matt Wilbur
2019-01-31 18:11   ` Guenter Roeck
2019-02-01 11:41     ` Matt Wilbur

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.