Using the debugfs to read/write registers

As you say the camera_common.c create the debugfs and the fops as below. The .read, .llseek, .release are link to system API that should not match your request. However the .write is link to camera_common_debugfs_write, you can trigger it by echo “0x4d00 0x9” > ov5693_a/d it will show as below message if you enable the dev_dbg() in the camera_common.c, BTW you can modify it .read to your i2c_read function that you just need cat ov5693_a/d to get the reg value.

[ 426.993670] ov5693 30-0036: camera_common_debugfs_open: ++
[ 426.994092] ov5693 30-0036: camera_common_debugfs_write: ++
[ 426.994163] ov5693 30-0036: new address = 4d00, data = 9
[ 426.997421] ov5693 30-0036: wrote to address 0x4d00 with value 0x9

static const struct file_operations camera_common_debugfs_fops = {
.open = camera_common_debugfs_open,
.read = seq_read,
.write = camera_common_debugfs_write,
.llseek = seq_lseek,
.release = single_release,
};