diff mbox series

[1/8] hwmon: (pmbus/lm25066) Add offset coefficients

Message ID 20210928092242.30036-2-zev@bewilderbeest.net (mailing list archive)
State Accepted
Headers show
Series hwmon: (pmbus/lm25066) Configurable sense resistor, other cleanups | expand

Commit Message

Zev Weiss Sept. 28, 2021, 9:22 a.m. UTC
With the exception of the lm5066i, all the devices handled by this
driver had been missing their offset ('b') coefficients for direct
format readings.

Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
---
 drivers/hwmon/pmbus/lm25066.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

Comments

Guenter Roeck Oct. 8, 2021, 1:37 p.m. UTC | #1
On Tue, Sep 28, 2021 at 02:22:35AM -0700, Zev Weiss wrote:
> With the exception of the lm5066i, all the devices handled by this
> driver had been missing their offset ('b') coefficients for direct
> format readings.
> 
> Signed-off-by: Zev Weiss <zev@bewilderbeest.net>

Applied.

Thanks,
Guenter

> ---
>  drivers/hwmon/pmbus/lm25066.c | 23 +++++++++++++++++++++++
>  1 file changed, 23 insertions(+)
> 
> diff --git a/drivers/hwmon/pmbus/lm25066.c b/drivers/hwmon/pmbus/lm25066.c
> index d209e0afc2ca..1a660c4cd19f 100644
> --- a/drivers/hwmon/pmbus/lm25066.c
> +++ b/drivers/hwmon/pmbus/lm25066.c
> @@ -55,22 +55,27 @@ static struct __coeff lm25066_coeff[6][PSC_NUM_CLASSES + 2] = {
>  	[lm25056] = {
>  		[PSC_VOLTAGE_IN] = {
>  			.m = 16296,
> +			.b = 1343,
>  			.R = -2,
>  		},
>  		[PSC_CURRENT_IN] = {
>  			.m = 13797,
> +			.b = -1833,
>  			.R = -2,
>  		},
>  		[PSC_CURRENT_IN_L] = {
>  			.m = 6726,
> +			.b = -537,
>  			.R = -2,
>  		},
>  		[PSC_POWER] = {
>  			.m = 5501,
> +			.b = -2908,
>  			.R = -3,
>  		},
>  		[PSC_POWER_L] = {
>  			.m = 26882,
> +			.b = -5646,
>  			.R = -4,
>  		},
>  		[PSC_TEMPERATURE] = {
> @@ -82,26 +87,32 @@ static struct __coeff lm25066_coeff[6][PSC_NUM_CLASSES + 2] = {
>  	[lm25066] = {
>  		[PSC_VOLTAGE_IN] = {
>  			.m = 22070,
> +			.b = -1800,
>  			.R = -2,
>  		},
>  		[PSC_VOLTAGE_OUT] = {
>  			.m = 22070,
> +			.b = -1800,
>  			.R = -2,
>  		},
>  		[PSC_CURRENT_IN] = {
>  			.m = 13661,
> +			.b = -5200,
>  			.R = -2,
>  		},
>  		[PSC_CURRENT_IN_L] = {
>  			.m = 6852,
> +			.b = -3100,
>  			.R = -2,
>  		},
>  		[PSC_POWER] = {
>  			.m = 736,
> +			.b = -3300,
>  			.R = -2,
>  		},
>  		[PSC_POWER_L] = {
>  			.m = 369,
> +			.b = -1900,
>  			.R = -2,
>  		},
>  		[PSC_TEMPERATURE] = {
> @@ -111,26 +122,32 @@ static struct __coeff lm25066_coeff[6][PSC_NUM_CLASSES + 2] = {
>  	[lm5064] = {
>  		[PSC_VOLTAGE_IN] = {
>  			.m = 4611,
> +			.b = -642,
>  			.R = -2,
>  		},
>  		[PSC_VOLTAGE_OUT] = {
>  			.m = 4621,
> +			.b = 423,
>  			.R = -2,
>  		},
>  		[PSC_CURRENT_IN] = {
>  			.m = 10742,
> +			.b = 1552,
>  			.R = -2,
>  		},
>  		[PSC_CURRENT_IN_L] = {
>  			.m = 5456,
> +			.b = 2118,
>  			.R = -2,
>  		},
>  		[PSC_POWER] = {
>  			.m = 1204,
> +			.b = 8524,
>  			.R = -3,
>  		},
>  		[PSC_POWER_L] = {
>  			.m = 612,
> +			.b = 11202,
>  			.R = -3,
>  		},
>  		[PSC_TEMPERATURE] = {
> @@ -140,26 +157,32 @@ static struct __coeff lm25066_coeff[6][PSC_NUM_CLASSES + 2] = {
>  	[lm5066] = {
>  		[PSC_VOLTAGE_IN] = {
>  			.m = 4587,
> +			.b = -1200,
>  			.R = -2,
>  		},
>  		[PSC_VOLTAGE_OUT] = {
>  			.m = 4587,
> +			.b = -2400,
>  			.R = -2,
>  		},
>  		[PSC_CURRENT_IN] = {
>  			.m = 10753,
> +			.b = -1200,
>  			.R = -2,
>  		},
>  		[PSC_CURRENT_IN_L] = {
>  			.m = 5405,
> +			.b = -600,
>  			.R = -2,
>  		},
>  		[PSC_POWER] = {
>  			.m = 1204,
> +			.b = -6000,
>  			.R = -3,
>  		},
>  		[PSC_POWER_L] = {
>  			.m = 605,
> +			.b = -8000,
>  			.R = -3,
>  		},
>  		[PSC_TEMPERATURE] = {
diff mbox series

Patch

diff --git a/drivers/hwmon/pmbus/lm25066.c b/drivers/hwmon/pmbus/lm25066.c
index d209e0afc2ca..1a660c4cd19f 100644
--- a/drivers/hwmon/pmbus/lm25066.c
+++ b/drivers/hwmon/pmbus/lm25066.c
@@ -55,22 +55,27 @@  static struct __coeff lm25066_coeff[6][PSC_NUM_CLASSES + 2] = {
 	[lm25056] = {
 		[PSC_VOLTAGE_IN] = {
 			.m = 16296,
+			.b = 1343,
 			.R = -2,
 		},
 		[PSC_CURRENT_IN] = {
 			.m = 13797,
+			.b = -1833,
 			.R = -2,
 		},
 		[PSC_CURRENT_IN_L] = {
 			.m = 6726,
+			.b = -537,
 			.R = -2,
 		},
 		[PSC_POWER] = {
 			.m = 5501,
+			.b = -2908,
 			.R = -3,
 		},
 		[PSC_POWER_L] = {
 			.m = 26882,
+			.b = -5646,
 			.R = -4,
 		},
 		[PSC_TEMPERATURE] = {
@@ -82,26 +87,32 @@  static struct __coeff lm25066_coeff[6][PSC_NUM_CLASSES + 2] = {
 	[lm25066] = {
 		[PSC_VOLTAGE_IN] = {
 			.m = 22070,
+			.b = -1800,
 			.R = -2,
 		},
 		[PSC_VOLTAGE_OUT] = {
 			.m = 22070,
+			.b = -1800,
 			.R = -2,
 		},
 		[PSC_CURRENT_IN] = {
 			.m = 13661,
+			.b = -5200,
 			.R = -2,
 		},
 		[PSC_CURRENT_IN_L] = {
 			.m = 6852,
+			.b = -3100,
 			.R = -2,
 		},
 		[PSC_POWER] = {
 			.m = 736,
+			.b = -3300,
 			.R = -2,
 		},
 		[PSC_POWER_L] = {
 			.m = 369,
+			.b = -1900,
 			.R = -2,
 		},
 		[PSC_TEMPERATURE] = {
@@ -111,26 +122,32 @@  static struct __coeff lm25066_coeff[6][PSC_NUM_CLASSES + 2] = {
 	[lm5064] = {
 		[PSC_VOLTAGE_IN] = {
 			.m = 4611,
+			.b = -642,
 			.R = -2,
 		},
 		[PSC_VOLTAGE_OUT] = {
 			.m = 4621,
+			.b = 423,
 			.R = -2,
 		},
 		[PSC_CURRENT_IN] = {
 			.m = 10742,
+			.b = 1552,
 			.R = -2,
 		},
 		[PSC_CURRENT_IN_L] = {
 			.m = 5456,
+			.b = 2118,
 			.R = -2,
 		},
 		[PSC_POWER] = {
 			.m = 1204,
+			.b = 8524,
 			.R = -3,
 		},
 		[PSC_POWER_L] = {
 			.m = 612,
+			.b = 11202,
 			.R = -3,
 		},
 		[PSC_TEMPERATURE] = {
@@ -140,26 +157,32 @@  static struct __coeff lm25066_coeff[6][PSC_NUM_CLASSES + 2] = {
 	[lm5066] = {
 		[PSC_VOLTAGE_IN] = {
 			.m = 4587,
+			.b = -1200,
 			.R = -2,
 		},
 		[PSC_VOLTAGE_OUT] = {
 			.m = 4587,
+			.b = -2400,
 			.R = -2,
 		},
 		[PSC_CURRENT_IN] = {
 			.m = 10753,
+			.b = -1200,
 			.R = -2,
 		},
 		[PSC_CURRENT_IN_L] = {
 			.m = 5405,
+			.b = -600,
 			.R = -2,
 		},
 		[PSC_POWER] = {
 			.m = 1204,
+			.b = -6000,
 			.R = -3,
 		},
 		[PSC_POWER_L] = {
 			.m = 605,
+			.b = -8000,
 			.R = -3,
 		},
 		[PSC_TEMPERATURE] = {