]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - include/i2c.h
TQM85xx: Support for Spansion 'N' type flashes added
[karo-tx-uboot.git] / include / i2c.h
index a8f729afe0148f27764783b7579ffb54c6577139..a51c16464ffbb3069dca9dcdebfec81d37cbfb11 100644 (file)
  */
 #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
+
+/* define the I2C bus number for RTC and DTT if not already done */
+#if !defined(CFG_RTC_BUS_NUM)
+#define CFG_RTC_BUS_NUM                0
+#endif
+#if !defined(CFG_DTT_BUS_NUM)
+#define CFG_DTT_BUS_NUM                0
+#endif
+#if !defined(CFG_SPD_BUS_NUM)
+#define CFG_SPD_BUS_NUM                0
+#endif
+
 /*
  * Initialization, must be called once on start up, may be called
  * repeatedly to change the speed and slave addresses.
@@ -92,9 +113,9 @@ void  i2c_reg_write(uchar chip, uchar reg, uchar val);
  *  Change the active I2C bus.  Subsequent read/write calls will
  *  go to this one.
  *
- *     bus - bus index, zero based
+ *     bus - bus index, zero based
  *
- *     Returns: 0 on success, not 0 on failure
+ *     Returns: 0 on success, not 0 on failure
  *
  */
 int i2c_set_bus_num(unsigned int bus);
@@ -112,9 +133,9 @@ unsigned int i2c_get_bus_num(void);
  *
  *  Change the speed of the active I2C bus
  *
- *     speed - bus speed in Hz
+ *     speed - bus speed in Hz
  *
- *     Returns: 0 on success, not 0 on failure
+ *     Returns: 0 on success, not 0 on failure
  *
  */
 int i2c_set_bus_speed(unsigned int);