2013-07-30 21:14:40

by Vivien Didelot

[permalink] [raw]
Subject: [PATCH] hwmon: (max6697) fix MAX6581 ideality

Without this patch, the values for ideality (register 0x4b) and ideality
selection mask (register 0x4c) are inverted.

Signed-off-by: Vivien Didelot <[email protected]>
---
drivers/hwmon/max6697.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/hwmon/max6697.c b/drivers/hwmon/max6697.c
index 328fb03..a41b5f3 100644
--- a/drivers/hwmon/max6697.c
+++ b/drivers/hwmon/max6697.c
@@ -605,12 +605,12 @@ static int max6697_init_chip(struct i2c_client *client)
if (ret < 0)
return ret;
ret = i2c_smbus_write_byte_data(client, MAX6581_REG_IDEALITY,
- pdata->ideality_mask >> 1);
+ pdata->ideality_value);
if (ret < 0)
return ret;
ret = i2c_smbus_write_byte_data(client,
MAX6581_REG_IDEALITY_SELECT,
- pdata->ideality_value);
+ pdata->ideality_mask >> 1);
if (ret < 0)
return ret;
}
--
1.8.3.4


2013-07-31 22:13:32

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH] hwmon: (max6697) fix MAX6581 ideality

On Tue, Jul 30, 2013 at 05:14:34PM -0400, Vivien Didelot wrote:
> Without this patch, the values for ideality (register 0x4b) and ideality
> selection mask (register 0x4c) are inverted.
>
> Signed-off-by: Vivien Didelot <[email protected]>

Good catch. Applied.

Thanks,
Guenter