mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-10-29 12:50:43 +00:00
Fix init: no chip reset, discard usless code.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2693 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
26f600b2aa
commit
ac81893796
1 file changed
+5
-18
+5
-18
@@ -475,28 +475,15 @@ static int lm78_write_value(struct i2c_client *client, u8 reg, u8 value)
|
||||
return i2c_smbus_write_byte_data(client, reg, value);
|
||||
}
|
||||
|
||||
/* Called when we have found a new LM78. It should set limits, etc. */
|
||||
/* Called when we have found a new LM78. */
|
||||
static void lm78_init_client(struct i2c_client *client)
|
||||
{
|
||||
int vid;
|
||||
|
||||
/* Reset all except Watchdog values and last conversion values
|
||||
This sets fan-divs to 2, among others */
|
||||
lm78_write_value(client, LM78_REG_CONFIG, 0x80);
|
||||
|
||||
vid = lm78_read_value(client, LM78_REG_VID_FANDIV) & 0x0f;
|
||||
if (((struct lm78_data *) (client->data))->type == lm79)
|
||||
vid |=
|
||||
(lm78_read_value(client, LM78_REG_CHIPID) & 0x01) << 4;
|
||||
else
|
||||
vid |= 0x10;
|
||||
vid = VID_FROM_REG(vid);
|
||||
u8 config = lm78_read_value(client, LM78_REG_CONFIG);
|
||||
|
||||
/* Start monitoring */
|
||||
lm78_write_value(client, LM78_REG_CONFIG,
|
||||
(lm78_read_value(client, LM78_REG_CONFIG) & 0xf7)
|
||||
| 0x01);
|
||||
|
||||
if (!(config & 0x01))
|
||||
lm78_write_value(client, LM78_REG_CONFIG,
|
||||
(config & 0xf7) | 0x01);
|
||||
}
|
||||
|
||||
static void lm78_update_client(struct i2c_client *client)
|
||||
|
||||
Reference in new issue
Block a user