<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">From khali@linux-fr.org Wed Jul 27 12:28:53 2005
Date: Wed, 27 Jul 2005 21:28:28 +0200
From: Jean Delvare &lt;khali@linux-fr.org&gt;
To: Greg KH &lt;greg@kroah.com&gt;
Subject: hwmon: soften lm75 initialization
Message-Id: &lt;20050727212828.0df56e31.khali@linux-fr.org&gt;


The LM75 initialization is a bit agressive, it arbitrarily reconfigures
the chip. Make it only change the bit it needs. This is a port from
the 2.4 kernel version of the driver (lm_sensors).

Signed-off-by: Jean Delvare &lt;khali@linux-fr.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;


---
 drivers/hwmon/lm75.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

--- gregkh-2.6.orig/drivers/hwmon/lm75.c	2005-07-27 23:26:34.000000000 -0700
+++ gregkh-2.6/drivers/hwmon/lm75.c	2005-07-27 23:30:30.000000000 -0700
@@ -251,8 +251,12 @@
 
 static void lm75_init_client(struct i2c_client *client)
 {
-	/* Initialize the LM75 chip */
-	lm75_write_value(client, LM75_REG_CONF, 0);
+	int reg;
+
+	/* Enable if in shutdown mode */
+	reg = lm75_read_value(client, LM75_REG_CONF);
+	if (reg &gt;= 0 &amp;&amp; (reg &amp; 0x01))
+		lm75_write_value(client, LM75_REG_CONF, reg &amp; 0xfe);
 }
 
 static struct lm75_data *lm75_update_device(struct device *dev)
</pre></body></html>