#include <asm/imx-common/mxc_i2c.h>
#include <watchdog.h>
-static int force_idle_bus(void *priv)
+int force_idle_bus(void *priv)
{
int i;
int sda, scl;
#ifdef I2C3_BASE_ADDR
(void *)I2C3_BASE_ADDR,
#endif
+#ifdef I2C4_BASE_ADDR
+ (void *)I2C4_BASE_ADDR,
+#endif
};
-/* i2c_index can be from 0 - 2 */
+/* i2c_index can be from 0 - 3 */
int setup_i2c(unsigned i2c_index, int speed, int slave_addr,
struct i2c_pads_info *p)
{
if (ret)
goto err_idle;
- bus_i2c_init(i2c_bases[i2c_index], speed, slave_addr,
- force_idle_bus, p);
+#ifndef CONFIG_DM_I2C
+ bus_i2c_init(i2c_index, speed, slave_addr, force_idle_bus, p);
+#endif
return 0;