summaryrefslogtreecommitdiff
path: root/cpu/ppc4xx
diff options
context:
space:
mode:
authorwdenk <wdenk>2003-03-06 21:55:29 +0000
committerwdenk <wdenk>2003-03-06 21:55:29 +0000
commit1cb8e980c41e86760fa93de63f4e4cf643bef9d9 (patch)
treee1993fba07dea51d92f1cec4c814a67173c1f8fb /cpu/ppc4xx
parent500545cc6b83958209128bffa825b3c842a21a4e (diff)
* Patches by David Müller, 31 Jan 2003:LABEL_2003_03_06_2255
- minimal setup for CardBus bridges - add EEPROM read/write support in the CS8900 driver - add support for the builtin I2C controller in the Samsung s3c24x0 chips - add support for MPL's VCMA9 (Samsung s3c2410 based) board * Patch by Steven Scholz, 04 Feb 2003: add support for RTC DS1307 * Patch by Reinhard Meyer, 5 Feb 2003: fix PLPRCR/SCCR init sequence on 8xx to allow for changes of EBDF by software * Patch by Vladimir Gurevich, 07 Feb 2003: "API-compatibility patch" for 4xx I2C driver
Diffstat (limited to 'cpu/ppc4xx')
-rw-r--r--cpu/ppc4xx/i2c.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/cpu/ppc4xx/i2c.c b/cpu/ppc4xx/i2c.c
index 7d8db9bf437..4bf0bbd99cd 100644
--- a/cpu/ppc4xx/i2c.c
+++ b/cpu/ppc4xx/i2c.c
@@ -422,4 +422,23 @@ int i2c_write (uchar chip, uint addr, int alen, uchar * buffer, int len)
return (i2c_transfer( 0, chip<<1, &xaddr[4-alen], alen, buffer, len ) != 0);
}
+/*-----------------------------------------------------------------------
+ * Read a register
+ */
+uchar i2c_reg_read(uchar i2c_addr, uchar reg)
+{
+ char buf;
+
+ i2c_read(i2c_addr, reg, 1, &buf, 1);
+
+ return(buf);
+}
+
+/*-----------------------------------------------------------------------
+ * Write a register
+ */
+void i2c_reg_write(uchar i2c_addr, uchar reg, uchar val)
+{
+ i2c_write(i2c_addr, reg, 1, &val, 1);
+}
#endif /* CONFIG_HARD_I2C */