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


Groups > linux.kernel > #1722869 > unrolled thread

[PATCH 1/2] hwmon: (pmbus/lm25066) Offset coefficient depends on CL

Started byXo Wang <xow@google.com>
First post2017-08-29 23:30 +0200
Last post2017-08-30 04:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 1/2] hwmon: (pmbus/lm25066) Offset coefficient depends on CL Xo Wang <xow@google.com> - 2017-08-29 23:30 +0200
    Re: [1/2] hwmon: (pmbus/lm25066) Offset coefficient depends on CL Guenter Roeck <linux@roeck-us.net> - 2017-08-30 04:10 +0200

#1722869 — [PATCH 1/2] hwmon: (pmbus/lm25066) Offset coefficient depends on CL

FromXo Wang <xow@google.com>
Date2017-08-29 23:30 +0200
Subject[PATCH 1/2] hwmon: (pmbus/lm25066) Offset coefficient depends on CL
Message-ID<ujWf8-7TR-29@gated-at.bofh.it>
When converting the DIRECT format CURRENT_IN and POWER commands, make
the offset coefficient ("b") predicate on the value of the current limit
setting.

Signed-off-by: Xo Wang <xow@google.com>
---
 drivers/hwmon/pmbus/lm25066.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/hwmon/pmbus/lm25066.c b/drivers/hwmon/pmbus/lm25066.c
index a3d912cd3b8d..232b4af13e12 100644
--- a/drivers/hwmon/pmbus/lm25066.c
+++ b/drivers/hwmon/pmbus/lm25066.c
@@ -488,16 +488,18 @@ static int lm25066_probe(struct i2c_client *client,
 	info->m[PSC_VOLTAGE_OUT] = coeff[PSC_VOLTAGE_OUT].m;
 	info->b[PSC_VOLTAGE_OUT] = coeff[PSC_VOLTAGE_OUT].b;
 	info->R[PSC_VOLTAGE_OUT] = coeff[PSC_VOLTAGE_OUT].R;
-	info->b[PSC_CURRENT_IN] = coeff[PSC_CURRENT_IN].b;
 	info->R[PSC_CURRENT_IN] = coeff[PSC_CURRENT_IN].R;
-	info->b[PSC_POWER] = coeff[PSC_POWER].b;
 	info->R[PSC_POWER] = coeff[PSC_POWER].R;
 	if (config & LM25066_DEV_SETUP_CL) {
 		info->m[PSC_CURRENT_IN] = coeff[PSC_CURRENT_IN_L].m;
+		info->b[PSC_CURRENT_IN] = coeff[PSC_CURRENT_IN_L].b;
 		info->m[PSC_POWER] = coeff[PSC_POWER_L].m;
+		info->b[PSC_POWER] = coeff[PSC_POWER_L].b;
 	} else {
 		info->m[PSC_CURRENT_IN] = coeff[PSC_CURRENT_IN].m;
+		info->b[PSC_CURRENT_IN] = coeff[PSC_CURRENT_IN].b;
 		info->m[PSC_POWER] = coeff[PSC_POWER].m;
+		info->b[PSC_POWER] = coeff[PSC_POWER].b;
 	}
 
 	return pmbus_do_probe(client, id, info);
-- 
2.14.1.342.g6490525c54-goog

[toc] | [next] | [standalone]


#1722969 — Re: [1/2] hwmon: (pmbus/lm25066) Offset coefficient depends on CL

FromGuenter Roeck <linux@roeck-us.net>
Date2017-08-30 04:10 +0200
SubjectRe: [1/2] hwmon: (pmbus/lm25066) Offset coefficient depends on CL
Message-ID<uk0C6-2db-7@gated-at.bofh.it>
In reply to#1722869
On Tue, Aug 29, 2017 at 02:21:16PM -0700, Xo Wang wrote:
> When converting the DIRECT format CURRENT_IN and POWER commands, make
> the offset coefficient ("b") predicate on the value of the current limit
> setting.
> 
> Signed-off-by: Xo Wang <xow@google.com>

Applied to hwmon-next.

Thanks,
Guenter

> ---
>  drivers/hwmon/pmbus/lm25066.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/hwmon/pmbus/lm25066.c b/drivers/hwmon/pmbus/lm25066.c
> index a3d912cd3b8d..232b4af13e12 100644
> --- a/drivers/hwmon/pmbus/lm25066.c
> +++ b/drivers/hwmon/pmbus/lm25066.c
> @@ -488,16 +488,18 @@ static int lm25066_probe(struct i2c_client *client,
>  	info->m[PSC_VOLTAGE_OUT] = coeff[PSC_VOLTAGE_OUT].m;
>  	info->b[PSC_VOLTAGE_OUT] = coeff[PSC_VOLTAGE_OUT].b;
>  	info->R[PSC_VOLTAGE_OUT] = coeff[PSC_VOLTAGE_OUT].R;
> -	info->b[PSC_CURRENT_IN] = coeff[PSC_CURRENT_IN].b;
>  	info->R[PSC_CURRENT_IN] = coeff[PSC_CURRENT_IN].R;
> -	info->b[PSC_POWER] = coeff[PSC_POWER].b;
>  	info->R[PSC_POWER] = coeff[PSC_POWER].R;
>  	if (config & LM25066_DEV_SETUP_CL) {
>  		info->m[PSC_CURRENT_IN] = coeff[PSC_CURRENT_IN_L].m;
> +		info->b[PSC_CURRENT_IN] = coeff[PSC_CURRENT_IN_L].b;
>  		info->m[PSC_POWER] = coeff[PSC_POWER_L].m;
> +		info->b[PSC_POWER] = coeff[PSC_POWER_L].b;
>  	} else {
>  		info->m[PSC_CURRENT_IN] = coeff[PSC_CURRENT_IN].m;
> +		info->b[PSC_CURRENT_IN] = coeff[PSC_CURRENT_IN].b;
>  		info->m[PSC_POWER] = coeff[PSC_POWER].m;
> +		info->b[PSC_POWER] = coeff[PSC_POWER].b;
>  	}
>  
>  	return pmbus_do_probe(client, id, info);

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web