diff options
author | Xo Wang <xow@google.com> | 2017-08-29 14:21:16 -0700 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2017-08-30 06:31:12 -0700 |
commit | ee983171d49b4b5c957d3f94c68ee1fd7a007281 (patch) | |
tree | 1143269c00180df158be2f1b454a3743d374cb0e /drivers/hwmon/pmbus | |
parent | d4977c083aeb28cf72c1b019e3f9df13608126dd (diff) | |
download | linux-stable-ee983171d49b4b5c957d3f94c68ee1fd7a007281.tar.gz linux-stable-ee983171d49b4b5c957d3f94c68ee1fd7a007281.tar.bz2 linux-stable-ee983171d49b4b5c957d3f94c68ee1fd7a007281.zip |
hwmon: (pmbus/lm25066) Offset coefficient depends on CL
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>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/pmbus')
-rw-r--r-- | drivers/hwmon/pmbus/lm25066.c | 6 |
1 files 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); |