From: Guenter Roeck <linux@roeck-us.net>
To: Robert Lippert <roblip@gmail.com>
Cc: linux-hwmon@vger.kernel.org, jdelvare@suse.com,
linux-kernel@vger.kernel.org, xow@google.com,
Robert Lippert <rlippert@google.com>
Subject: Re: [PATCH] hwmon: (pmbus/lm25066) Swap low/high current coefficients for LM5066(i)
Date: Wed, 22 Nov 2017 15:28:16 -0800 [thread overview]
Message-ID: <20171122232816.GA4615@roeck-us.net> (raw)
In-Reply-To: <20171122220728.17861-1-rlippert@google.com>
On Wed, Nov 22, 2017 at 02:07:28PM -0800, Robert Lippert wrote:
> 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.
>
This would affect all chips supported by this driver. Hmm, and I was sure
I tested this. I'll have to dig out my hardware and confirm.
The code currently only uses bit 4 of the DEVICE_SETUP (D9h) command
to determine which current limit setting to use. Looking into the
datasheet, it looks like it also has to evaluate bit 2, and I wonder
if there is a means to determine CL if bit 2 = 0. Any idea ?
Does bit 4 report the CL pin value if bit 2 = 0 ?
Thanks,
Guenter
> 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
>
next prev parent reply other threads:[~2017-11-22 23:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171122232816.GA4615@roeck-us.net \
--to=linux@roeck-us.net \
--cc=jdelvare@suse.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rlippert@google.com \
--cc=roblip@gmail.com \
--cc=xow@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox