+ #if defined(CONFIG_DM_I2C)
+ struct udevice *dev;
+ int ret;
+
+ ret = i2c_get_chip_for_busnum(bus_num, CONFIG_SYS_I2C_PCA9557_ADDR,
+ 1, &dev);
+ if (ret) {
+ printf("%s: Cannot find udev for a bus %d\n", __func__,
+ bus_num);
+ return -ENXIO;
+ }
+
+ if (dm_i2c_read(dev, 0, &in, 1) < 0 ||
+ dm_i2c_read(dev, 1, &out, 1) < 0 ||
+ dm_i2c_read(dev, 3, &io_config, 1) < 0) {
+ printf("Error reading i2c boot information!\n");
+ return 0; /* Don't want to hang() on this error */
+ }
+ #else /* Non DM I2C support - will be removed */
+ i2c_set_bus_num(bus_num);