one more suggestion for you:
You can check the ov5640.c driver source code. It is located in linux/drivers/media/video/mxc/capture/.
There are two functions ov5640_write_reg() and ov5640_read_reg() using i2c for read and write the ov5640's registers.
And when run the ov5640_probe(), It will using ov5640_read_reg() to read the chip_id higher and lower bytes first. After checked the camera is ov5640, then it will initialize the camera by sending a set of data in ov5640_global_init_setting[],