ChangeSet 1.1722.111.27, 2004/06/14 10:50:59-07:00, mhoffman@lightlink.com

[PATCH] I2C: add alternate VCORE calculations for w83627thf and w83637hf

Pick a VRM (for VID interpretation) based on the VRM & OVT config,
if available.  Props to Jean Delvare <khali@linux-fr.org> for the
idea & code fragment.

Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>


 drivers/i2c/chips/w83627hf.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)


diff -Nru a/drivers/i2c/chips/w83627hf.c b/drivers/i2c/chips/w83627hf.c
--- a/drivers/i2c/chips/w83627hf.c	Tue Jun 22 09:46:43 2004
+++ b/drivers/i2c/chips/w83627hf.c	Tue Jun 22 09:46:43 2004
@@ -1275,12 +1275,15 @@
 	}
 
 	/* Read VRM & OVT Config only once */
-	if (w83627thf == data->type || w83637hf == data->type)
+	if (w83627thf == data->type || w83637hf == data->type) {
 		data->vrm_ovt = 
 			w83627hf_read_value(client, W83627THF_REG_VRM_OVT_CFG);
+		data->vrm = (data->vrm_ovt & 0x01) ? 90 : 82;
+	} else {
+		/* Convert VID to voltage based on default VRM */
+		data->vrm = DEFAULT_VRM;
+	}
 
-	/* Convert VID to voltage based on default VRM */
-	data->vrm = DEFAULT_VRM;
 	if (type != w83697hf)
 		vid = vid_from_reg(vid, data->vrm);
 
