From 3ee4fadb09bc5e1ec6dd58392d9d65dce5ed0792 Mon Sep 17 00:00:00 2001 From: "Mark D. Studebaker" Date: Sat, 19 Feb 2005 18:34:54 +0000 Subject: [PATCH] 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 --- kernel/chips/lm75.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/kernel/chips/lm75.c b/kernel/chips/lm75.c index 1849f9f4..0c5035af 100644 --- a/kernel/chips/lm75.c +++ b/kernel/chips/lm75.c @@ -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)