Update of /cvsroot/blob/blob/src/lib
In directory usw-pr-cvs1:/tmp/cvs-serv8216/src/lib
Modified Files:
Makefile.am i2c.c
Log Message:
add i2c_probe
fix badge4 initialization to fetch the SDRAM info out of the SPD
add i2c.c and i2c-gpio.c to lib build
remove ide.c and pcmcia.c from lib build (currently broken)
switch initial terminal baud to whatever is in arch header
Index: Makefile.am
===================================================================
RCS file: /cvsroot/blob/blob/src/lib/Makefile.am,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- Makefile.am 26 Apr 2002 04:46:59 -0000 1.17
+++ Makefile.am 27 Apr 2002 00:55:04 -0000 1.18
@@ -30,8 +30,9 @@
crc32.c \
disk.c \
error.c \
+ i2c.c \
+ i2c-gpio.c \
icache.c \
- ide.c \
init.c \
led.c \
md5.c \
@@ -39,7 +40,6 @@
memcpy.c \
memset.c \
mini_inflate.c \
- pcmcia.c \
printf.c \
reboot.c \
serial.c \
Index: i2c.c
===================================================================
RCS file: /cvsroot/blob/blob/src/lib/i2c.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- i2c.c 25 Apr 2002 23:29:42 -0000 1.2
+++ i2c.c 27 Apr 2002 00:55:04 -0000 1.3
@@ -324,6 +324,19 @@
return 0;
}
+int i2c_probe(struct i2c_bus *bus, u8 devAddr)
+{
+ int ack;
+
+ i2c_start(bus);
+ i2c_write_byte(bus, READ_ADDR(devAddr));
+ ack = i2c_get_ack_quietly(bus);
+ i2c_stop(bus);
+
+ /* 0 == device present */
+ return ack;
+}
+
int i2c_scan(struct i2c_bus *bus, u8 map[256])
{
int i;
|