Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src/sys/dev/i2c



Module Name:    src
Committed By:   tsutsui
Date:           Sun Jun  1 01:13:18 UTC 2008

Modified Files:
        src/sys/dev/i2c: i2c_bitbang.c

Log Message:
Reorganize I2C bitbang ops:
- don't set DIR(INPUT) in i2c_wait_for_scl() because it could cause
  unexpected stop condition in SCL=H, SDL=L and DIR(OUTPUT) case,
  and DIR() should be used only to switch SDA direction, not SCL
  that is always output on the master device
  (I'm not sure if reading SCL on the master is defined in the I2C spec)
- set SDA right after SCL H->L edge on Tx, fetch SDA at SCL L->H edge on Rx,
  and make sure not to change SDA during SCL=H except start/stop conditions
  so that we don't have to rely on data setup time which might be critical
- don't set DIR(OUTPUT) during SDA bit read in i2c_bitbang_read_byte()
- explicitly specify both SDA and SCL bits in SETBITS() for readability
- sprinkle comments

Fixes "tl0: error reading Ethernet address" problem on tl(4).


To generate a diff of this commit:
cvs rdiff -r1.10 -r1.11 src/sys/dev/i2c/i2c_bitbang.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Home | Main Index | Thread Index | Old Index