mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-10-28 12:40:42 +00:00
fix unreliable initialization of limit registers by
adding a rather large delay after resetting the device
via register 0x40. There is obviously a state machine
in the chip that takes a while to run after you reset it.
Figured out the delay time by trial and error.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1168 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
585c1e1f3d
commit
d2e5835634
2 files changed
+11
No files matched your search
@@ -17,6 +17,9 @@ ask CVS about it:
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
2.6.2 (2001????)
|
||||
Module via686a: Make limit initializations reliable
|
||||
|
||||
2.6.1 (20010830)
|
||||
File BUGS: Updated
|
||||
File doc/FAQ: More updates and additions
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include <asm/errno.h>
|
||||
#include <asm/io.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/i2c.h>
|
||||
#include "version.h"
|
||||
#include "sensors.h"
|
||||
@@ -680,6 +681,13 @@ void via686a_init_client(struct i2c_client *client)
|
||||
/* Reset the device */
|
||||
via686a_write_value(client, VIA686A_REG_CONFIG, 0x80);
|
||||
|
||||
/* Have to wait for reset to complete or else the following
|
||||
initializations won't work reliably. The delay was arrived at
|
||||
empirically, the datasheet doesn't tell you.
|
||||
Waiting for the reset bit to clear doesn't work, it
|
||||
clears in about 2-4 udelays and that isn't nearly enough. */
|
||||
udelay(50);
|
||||
|
||||
via686a_write_value(client, VIA686A_REG_IN_MIN(0),
|
||||
IN_TO_REG(VIA686A_INIT_IN_MIN_0, 0));
|
||||
via686a_write_value(client, VIA686A_REG_IN_MAX(0),
|
||||
|
||||
Reference in new issue
Block a user