Changeset 941

Show
Ignore:
Timestamp:
12/02/00 23:39:21 (12 years ago)
Author:
mds
Message:

(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@…> 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.

Location:
lm-sensors/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/CHANGES

    r940 r941  
    2828  Module ds1621: new 
    2929  Module i2c-ali1535: Enhance error checking and recovery; add mutex 
     30  Module i2c-i810: Add "dummy write" before reads per Intel prog. ref. 
    3031  Module lm87: update voltage calculations 
    3132  Module mtp008: new 
  • lm-sensors/trunk/kernel/busses/i2c-i810.c

    r862 r941  
    134134/* The GPIO pins are open drain, so the pins always remain outputs. 
    135135   We rely on the i2c-algo-bit routines to set the pins high before 
    136    reading the input from other chips. */ 
     136   reading the input from other chips. Following guidance in the 815 
     137   prog. ref. guide, we do a "dummy write" of 0 to the register before 
     138   reading which forces the input value to be latched. We presume this 
     139   applies to the 810 as well. This is necessary to get 
     140   i2c_algo_bit bit_test=1 to pass. */ 
    137141 
    138142static int bit_i810i2c_getscl(void *data) 
    139143{ 
     144        outlong(0, I810_GPIOB); 
    140145        return (0 != (readlong(I810_GPIOB) & SCL_VAL_IN)); 
    141146} 
     
    143148static int bit_i810i2c_getsda(void *data) 
    144149{ 
     150        outlong(0, I810_GPIOB); 
    145151        return (0 != (readlong(I810_GPIOB) & SDA_VAL_IN)); 
    146152} 
     
    160166static int bit_i810ddc_getscl(void *data) 
    161167{ 
     168        outlong(0, I810_GPIOA); 
    162169        return (0 != (readlong(I810_GPIOA) & SCL_VAL_IN)); 
    163170} 
     
    165172static int bit_i810ddc_getsda(void *data) 
    166173{ 
     174        outlong(0, I810_GPIOA); 
    167175        return (0 != (readlong(I810_GPIOA) & SDA_VAL_IN)); 
    168176}