#include <eth_phy.h>
#include <linux/delay.h>
#include <miiphy.h>
-#include <i2c.h>
+#if CONFIG_IS_ENABLED(DM_I2C)
+# include <i2c.h>
+#endif
#include <net/dsa.h>
#include <asm-generic/gpio.h>
u32 features; /* chip specific features */
};
+#if CONFIG_IS_ENABLED(DM_I2C)
static inline int ksz_i2c_read(struct udevice *dev, u32 reg, u8 *val, int len)
{
return dm_i2c_read(dev, reg, val, len);
.read = ksz_i2c_read,
.write = ksz_i2c_write,
};
+#endif
static inline int ksz_read8(struct udevice *dev, u32 reg, u8 *val)
{
parent_id = device_get_uclass_id(dev_get_parent(dev));
switch (parent_id) {
+#if CONFIG_IS_ENABLED(DM_I2C)
case UCLASS_I2C: {
ksz_ops_register(dev, &phy_i2c_ops);
}
break;
}
+#endif
default:
dev_err(dev, "invalid parent bus (%s)\n",
uclass_get_name(parent_id));