only initialize CMP/INT bit, and only if necessary

git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2915 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Mark D. Studebaker committed 2005-02-19 18:34:54 +00:00
1 parent e921c91c1e
commit 3ee4fadb09
1 file changed
+6 -2
+6 -2
View File
@@ -255,8 +255,12 @@ static int lm75_write_value(struct i2c_client *client, u8 reg, u16 value)
static void lm75_init_client(struct i2c_client *client)
{
/* Initialize the LM75 chip */
lm75_write_value(client, LM75_REG_CONF, 0);
int i;
/* Set comparator mode if not in that mode */
i = lm75_read_value(client, LM75_REG_CONF);
if(i >= 0 && ((u8) i) & 0x02)
lm75_write_value(client, LM75_REG_CONF, ((u8) i) & 0xfd);
}
static void lm75_update_client(struct i2c_client *client)