mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-10-24 12:04:33 +00:00
(mds) Add "dummy writes" before bit reads as recommended in 815
programmers' reference guide. This ensures that the input value
is latched in the 815 register. We assume this also applies
to the 810 or at least does no harm. Ticket 419.
Alan Chen <alp_chen@hotmail.com> reports that this fixes the
bug where i2c-algo-bit bit_test=1 fails the test.
We don't have any data that shows there was any problem in
normal operation (non bit_test) or that this fixes anything else.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@941 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
b57428a14b
commit
ec53bfa1fe
2 files changed
+10
-1
No files matched your search
@@ -27,6 +27,7 @@ ask CVS about it:
|
||||
Module ddcmon: allow force and force_ddcmon parameters
|
||||
Module ds1621: new
|
||||
Module i2c-ali1535: Enhance error checking and recovery; add mutex
|
||||
Module i2c-i810: Add "dummy write" before reads per Intel prog. ref.
|
||||
Module lm87: update voltage calculations
|
||||
Module mtp008: new
|
||||
Module pcf8574: change update time to 5 seconds
|
||||
|
||||
@@ -133,15 +133,21 @@ static void bit_i810i2c_setsda(void *data, int val)
|
||||
|
||||
/* The GPIO pins are open drain, so the pins always remain outputs.
|
||||
We rely on the i2c-algo-bit routines to set the pins high before
|
||||
reading the input from other chips. */
|
||||
reading the input from other chips. Following guidance in the 815
|
||||
prog. ref. guide, we do a "dummy write" of 0 to the register before
|
||||
reading which forces the input value to be latched. We presume this
|
||||
applies to the 810 as well. This is necessary to get
|
||||
i2c_algo_bit bit_test=1 to pass. */
|
||||
|
||||
static int bit_i810i2c_getscl(void *data)
|
||||
{
|
||||
outlong(0, I810_GPIOB);
|
||||
return (0 != (readlong(I810_GPIOB) & SCL_VAL_IN));
|
||||
}
|
||||
|
||||
static int bit_i810i2c_getsda(void *data)
|
||||
{
|
||||
outlong(0, I810_GPIOB);
|
||||
return (0 != (readlong(I810_GPIOB) & SDA_VAL_IN));
|
||||
}
|
||||
|
||||
@@ -159,11 +165,13 @@ static void bit_i810ddc_setsda(void *data, int val)
|
||||
|
||||
static int bit_i810ddc_getscl(void *data)
|
||||
{
|
||||
outlong(0, I810_GPIOA);
|
||||
return (0 != (readlong(I810_GPIOA) & SCL_VAL_IN));
|
||||
}
|
||||
|
||||
static int bit_i810ddc_getsda(void *data)
|
||||
{
|
||||
outlong(0, I810_GPIOA);
|
||||
return (0 != (readlong(I810_GPIOA) & SDA_VAL_IN));
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user