struct platform_device *pdev = to_platform_device(device);
struct dw_i2c_dev *dev = dev_get_drvdata(device);
- switch (dev->flags & MODEL_MASK) {
- case MODEL_MSCC_OCELOT:
+ if (device_is_compatible(dev->dev, "mscc,ocelot-i2c")) {
dev->ext = devm_platform_ioremap_resource(pdev, 1);
if (!IS_ERR(dev->ext))
dev->set_sda_hold_time = mscc_twi_set_sda_hold_time;
- break;
- default:
- break;
}
}
#define ARBITRATION_SEMAPHORE BIT(2)
#define ACCESS_POLLING BIT(3)
-#define MODEL_MSCC_OCELOT BIT(8)
#define MODEL_AMD_NAVI_GPU BIT(10)
#define MODEL_WANGXUN_SP BIT(11)
#define MODEL_MASK GENMASK(11, 8)
}
static const struct of_device_id dw_i2c_of_match[] = {
- { .compatible = "mscc,ocelot-i2c", .data = (void *)MODEL_MSCC_OCELOT },
+ { .compatible = "mscc,ocelot-i2c" },
{ .compatible = "snps,designware-i2c" },
{}
};