
7 Apr
2005
7 Apr
'05
10:06 a.m.
Hi there,
in order to use an I2C RTC with the at91rm9200 we need i2c_reg_write() and i2c_reg_write() functions. Please consider the patch attached.
* Patch by Steven Scholz, 07 Apr 2005: - add i2c_reg_write() and i2c_reg_write() for at91rm9200 I2C
--
Steven
Index: u-boot/cpu/arm920t/at91rm9200/i2c.c
===================================================================
RCS file: /cvsroot/u-boot/u-boot/cpu/arm920t/at91rm9200/i2c.c,v
retrieving revision 1.1
diff -u -r1.1 i2c.c
--- u-boot/cpu/arm920t/at91rm9200/i2c.c 6 Apr 2005 13:52:34 -0000 1.1
+++ u-boot/cpu/arm920t/at91rm9200/i2c.c 7 Apr 2005 08:03:34 -0000
@@ -189,4 +189,19 @@
debug ("Found AT91 i2c\n");
return;
}
+
+uchar i2c_reg_read(uchar i2c_addr, uchar reg)
+{
+ char buf;
+
+ i2c_read(i2c_addr, reg, 1, &buf, 1);
+
+ return(buf);
+}
+
+void i2c_reg_write(uchar i2c_addr, uchar reg, uchar val)
+{
+ i2c_write(i2c_addr, reg, 1, &val, 1);
+}
+
#endif /* CONFIG_HARD_I2C */