ctx->dev = dev;
        ctx->client = client;
-       ctx->info = (const struct it66121_chip_info *) id->driver_data;
+       if (dev_fwnode(&client->dev))
+               ctx->info = of_device_get_match_data(&client->dev);
+       else
+               ctx->info = (const struct it66121_chip_info *) id->driver_data;
 
        of_property_read_u32(ep, "bus-width", &ctx->bus_width);
        of_node_put(ep);
        mutex_destroy(&ctx->lock);
 }
 
-static const struct of_device_id it66121_dt_match[] = {
-       { .compatible = "ite,it66121" },
-       { .compatible = "ite,it6610" },
-       { }
-};
-MODULE_DEVICE_TABLE(of, it66121_dt_match);
-
 static const struct it66121_chip_info it66121_chip_info = {
        .id = ID_IT66121,
        .vid = 0x4954,
        .pid = 0x0611,
 };
 
+static const struct of_device_id it66121_dt_match[] = {
+       { .compatible = "ite,it66121", &it66121_chip_info },
+       { .compatible = "ite,it6610", &it6610_chip_info },
+       { }
+};
+MODULE_DEVICE_TABLE(of, it66121_dt_match);
+
 static const struct i2c_device_id it66121_id[] = {
        { "it66121", (kernel_ulong_t) &it66121_chip_info },
        { "it6610", (kernel_ulong_t) &it6610_chip_info },