Failed to access OV5645's register

Hi!
On Dragonboard 410c I failed to use C/C++ to access the I2C register of the OV5645 modules of this adapter:

Below are some information about the I2C master and OV5645 in my system:

linaro@linaro-developer:~$ sudo i2cdetect -l
i2c-3   i2c             QUP I2C adapter                         I2C adapter
i2c-1   i2c             QUP I2C adapter                         I2C adapter
i2c-4   i2c             Qualcomm Camera Control Interface       I2C adapter
i2c-0   i2c             QUP I2C adapter                         I2C adapter

linaro@linaro-developer:~$ dmesg | grep ov5645
[   11.825197] ov5645 4-003b: OV5645 detected at address 0x3b
[   12.290626] ov5645 4-003a: OV5645 detected at address 0x3a

And here is this short program: https://gist.github.com/oliverjungen/6f25e9e77167a17d677e7a3c0678c41e
When it runs, I always get:

Write i2c internal address error: Input/output error

This message was printed by perror() in this program’s Line 54, after writing the register address (0x300a, SENSOR CHIP ID HIGH BYTE) to OV5645.

I found that the kernel (Linaro Linux R. 19.01) module i2c-qcom-cci reports errors like:

linaro@linaro-developer:~$ dmesg | grep cci
[ 1280.099448] i2c-qcom-cci 1b0c000.cci: Master 0 error 0x08000000
[ 1280.099502] i2c-qcom-cci 1b0c000.cci: master 0 queue 0 error -5
[ 1280.104247] i2c-qcom-cci 1b0c000.cci: cci i2c xfer error -5

They seem to come from Line 328~332 of kernel/drivers/i2c/busses/i2c-qcom-cci.c:

	if (unlikely(val & CCI_IRQ_STATUS_0_I2C_M0_ERROR)) {
	dev_err_ratelimited(cci->dev, "Master 0 error 0x%08x\n", val);
	cci->master[0].status = -EIO;
	writel(CCI_HALT_REQ_I2C_M0_Q0Q1, cci->base + CCI_HALT_REQ);
}

I’m wondering how I should debug this issue?

For anyone who may concern:
The root cause of this symptom is:
OV5645’s kernel module will turn OV5645’s power off (or power-saving?) after initializing it. After turning its power on manually, now it’s OK to access OV5645’s registers.
FYR.