add ov5640 (parallel and mipi interface) device tree support to help load module
at booting time when it's compiled as module.
Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
static s32 ov5640_read_reg(u16 reg, u8 *val);
static s32 ov5640_write_reg(u16 reg, u8 val);
+#ifdef CONFIG_OF
+static const struct of_device_id ov5640_of_match[] = {
+ { .compatible = "ovti,ov564x",
+ },
+ { /* sentinel */ }
+};
+
+MODULE_DEVICE_TABLE(of, ov5640_of_match);
+#endif
+
static const struct i2c_device_id ov5640_id[] = {
{"ov564x", 0},
{},
.driver = {
.owner = THIS_MODULE,
.name = "ov564x",
+#ifdef CONFIG_OF
+ .of_match_table = of_match_ptr(ov5640_of_match),
+#endif
},
.probe = ov5640_probe,
.remove = ov5640_remove,
static s32 ov5640_read_reg(u16 reg, u8 *val);
static s32 ov5640_write_reg(u16 reg, u8 val);
+#ifdef CONFIG_OF
+static const struct of_device_id ov5640_of_match[] = {
+ { .compatible = "ovti,ov564x_mipi",
+ },
+ { /* sentinel */ }
+};
+
+MODULE_DEVICE_TABLE(of, ov5640_of_match);
+#endif
+
static const struct i2c_device_id ov5640_id[] = {
{"ov564x_mipi", 0},
{},
.driver = {
.owner = THIS_MODULE,
.name = "ov564x_mipi",
+#ifdef CONFIG_OF
+ .of_match_table = of_match_ptr(ov5640_of_match),
+#endif
},
.probe = ov5640_probe,
.remove = ov5640_remove,