summaryrefslogtreecommitdiff
path: root/include/i2c.h
diff options
context:
space:
mode:
authorStefan Roese <sr@denx.de>2007-02-20 10:27:08 +0100
committerStefan Roese <sr@denx.de>2007-02-20 10:27:08 +0100
commit79b2d0bb2eae09602448f7a7cb56530d2f31e6c6 (patch)
treeec226ccf8314e37981f946df4391446a6ff9dc11 /include/i2c.h
parent7372ca68227930d03cffa548310524cad5b96733 (diff)
downloadu-boot-imx-79b2d0bb2eae09602448f7a7cb56530d2f31e6c6.zip
u-boot-imx-79b2d0bb2eae09602448f7a7cb56530d2f31e6c6.tar.gz
u-boot-imx-79b2d0bb2eae09602448f7a7cb56530d2f31e6c6.tar.bz2
[PATCH] PPC4xx: Add support for multiple I2C busses
This patch adds support for multiple I2C busses on the PPC4xx platforms. Define CONFIG_I2C_MULTI_BUS in the board config file to make use of this feature. It also merges the 405 and 440 i2c header files into one common file 4xx_i2c.h. Also the 4xx i2c reset procedure is reworked since I experienced some problems with the first access on the 440SPe Katmai board. Signed-off-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'include/i2c.h')
-rw-r--r--include/i2c.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/i2c.h b/include/i2c.h
index a8f729a..54c6f9f 100644
--- a/include/i2c.h
+++ b/include/i2c.h
@@ -46,6 +46,16 @@
*/
#define I2C_RXTX_LEN 128 /* maximum tx/rx buffer length */
+#if defined(CONFIG_I2C_MULTI_BUS)
+#define CFG_MAX_I2C_BUS 2
+#define I2C_GET_BUS() i2c_get_bus_num()
+#define I2C_SET_BUS(a) i2c_set_bus_num(a)
+#else
+#define CFG_MAX_I2C_BUS 1
+#define I2C_GET_BUS() 0
+#define I2C_SET_BUS(a)
+#endif
+
/*
* Initialization, must be called once on start up, may be called
* repeatedly to change the speed and slave addresses.