Integrating CSI Camera on Android Marshmellow with AiStarVison MIPI Adapter V2.0

Hi All,

I am Trying to integrate CSI Camera with AiStarVision MIPI Adapter V2.0 on Android M for DragonBoard410c.

I have enable the mm-qcamera-daemon.
Added the ov5645.c driver and required camera files in vendor/qcom/proprietary/mm-camera

But when the i2c probe is failing resulting in failure of camera. Please observe the below logs.

[ 0.211271] cpr_pvs_init: apc_corner: floor voltage: [1050000 1050000 1162500] uV
[ 0.211737] platform b018000.regulator: Driver qcom,cpr-regulator requests probe deferral
[ 0.212379] i2c-msm-v2 78b6000.i2c: probing driver i2c-msm-v2
[ 0.212503] i2c-msm-v2 78b6000.i2c: error on clk_get(core_clk):-517
[ 0.212520] i2c-msm-v2 78b6000.i2c: error probe() failed with err:-517
[ 0.212562] platform 78b6000.i2c: Driver i2c-msm-v2 requests probe deferral
[ 0.212834] i2c-msm-v2 78b9000.i2c: probing driver i2c-msm-v2
[ 0.212941] i2c-msm-v2 78b9000.i2c: error on clk_get(core_clk):-517
[ 0.212956] i2c-msm-v2 78b9000.i2c: error probe() failed with err:-517
[ 0.212992] platform 78b9000.i2c: Driver i2c-msm-v2 requests probe deferral
[ 0.213270] i2c-msm-v2 78ba000.i2c: probing driver i2c-msm-v2
[ 0.213376] i2c-msm-v2 78ba000.i2c: error on clk_get(core_clk):-517
[ 0.213391] i2c-msm-v2 78ba000.i2c: error probe() failed with err:-517
[ 0.213430] platform 78ba000.i2c: Driver i2c-msm-v2 requests probe deferral
[ 0.213737] i2c-msm-v2 78b8000.i2c: probing driver i2c-msm-v2
[ 0.213838] i2c-msm-v2 78b8000.i2c: error on clk_get(core_clk):-517
[ 0.213853] i2c-msm-v2 78b8000.i2c: error probe() failed with err:-517
[ 0.213888] platform 78b8000.i2c: Driver i2c-msm-v2 requests probe deferral
[ 0.216158] msm-thermal qcom,msm-thermal.58: msm_thermal:Failed reading node=/soc/qcom,msm-thermal, key=qcom,rpm-phase-resource-type err=-22. KTM continues
[ 0.216177] msm-thermal qcom,msm-thermal.58: msm_thermal:Failed reading node=/soc/qcom,msm-thermal, key=qcom,gfx-sensor-id. err=-22. KTM continues

Any help is appreciated. Thanks in Advance.

Regards,
Anvesh.

Hi Anvesh,

[ 0.212379] i2c-msm-v2 78b6000.i2c: probing driver i2c-msm-v2
[ 0.212503] i2c-msm-v2 78b6000.i2c: error on clk_get(core_clk):-517
[ 0.212520] i2c-msm-v2 78b6000.i2c: error probe() failed with err:-517
[ 0.212562] platform 78b6000.i2c: Driver i2c-msm-v2 requests probe deferral
[ 0.212834] i2c-msm-v2 78b9000.i2c: probing driver i2c-msm-v2
[ 0.212941] i2c-msm-v2 78b9000.i2c: error on clk_get(core_clk):-517
[ 0.212956] i2c-msm-v2 78b9000.i2c: error probe() failed with err:-517
these are not camera related i2c nodes , these are regular bsp i2c nodes .

can you please share full log from boot up , that would easier to debug the issue .

Thanks,
Sivaram

ok. Please find the whole logs regarding camera below.

[ 6.078853] usbcore: registered new interface driver ums-usbat
[ 6.084779] usbcore: registered new interface driver usbserial
[ 6.090491] usbcore: registered new interface driver qc_csvt
[ 6.096090] usbserial: USB Serial support registered for qc_csvt
[ 6.102110] usbcore: registered new interface driver usb_ehset_test
[ 6.110629] msm_otg 78d9000.usb: phy_reset: success
[ 6.167727] mousedev: PS/2 mouse device common for all mice
[ 6.277062] i2c-msm-v2 78b9000.i2c: msm_bus_scale_register_client(mstr-id:86):0xc (ok)
[ 6.786739] i2c-msm-v2 78b9000.i2c: TIMEOUT_ERROR(val:510msec) misconfigured GPIO or slave pulling bus line(s) low
[ 6.786739] : msgs(n:1 cur:0 tx) bc(rx:0 tx:2) mode:FIFO slv_addr:0x20 MSTR_STS:0x00132100 OPER:0x00000090
[ 6.906718] i2c-msm-v2 78b9000.i2c: bus lines held low by a slave detected
[ 6.912547] i2c-msm-v2 78b9000.i2c: Executing bus recovery procedure (9 clk pulse)
[ 7.006722] i2c-msm-v2 78b9000.i2c: Bus recovery fail after 10 retries
[ 7.012221] synaptics_rmi4_i2c 5-0020: synaptics_rmi4_set_page: I2C retry 1
[ 7.556737] i2c-msm-v2 78b9000.i2c: TIMEOUT_ERROR(val:510msec) misconfigured GPIO or slave pulling bus line(s) low
[ 7.556737] : msgs(n:1 cur:0 tx) bc(rx:0 tx:2) mode:FIFO slv_addr:0x20 MSTR_STS:0x00132100 OPER:0x00000090
[ 7.676717] i2c-msm-v2 78b9000.i2c: bus lines held low by a slave detected
[ 7.682545] i2c-msm-v2 78b9000.i2c: Executing bus recovery procedure (9 clk pulse)
[ 7.780364] i2c-msm-v2 78b9000.i2c: Bus recovery fail after 10 retries
[ 7.785858] synaptics_rmi4_i2c 5-0020: synaptics_rmi4_set_page: I2C retry 2
[ 8.326738] i2c-msm-v2 78b9000.i2c: TIMEOUT_ERROR(val:510msec) misconfigured GPIO or slave pulling bus line(s) low
[ 8.326738] : msgs(n:1 cur:0 tx) bc(rx:0 tx:2) mode:FIFO slv_addr:0x20 MSTR_STS:0x00132100 OPER:0x00000090
[ 8.446717] i2c-msm-v2 78b9000.i2c: bus lines held low by a slave detected
[ 8.452546] i2c-msm-v2 78b9000.i2c: Executing bus recovery procedure (9 clk pulse)
[ 8.550364] i2c-msm-v2 78b9000.i2c: Bus recovery fail after 10 retries
[ 8.555857] synaptics_rmi4_i2c 5-0020: synaptics_rmi4_set_page: I2C retry 3
[ 9.096747] i2c-msm-v2 78b9000.i2c: TIMEOUT_ERROR(val:510msec) misconfigured GPIO or slave pulling bus line(s) low
[ 9.096747] : msgs(n:1 cur:0 tx) bc(rx:0 tx:2) mode:FIFO slv_addr:0x20 MSTR_STS:0x00132100 OPER:0x00000090
[ 9.216717] i2c-msm-v2 78b9000.i2c: bus lines held low by a slave detected
[ 9.222545] i2c-msm-v2 78b9000.i2c: Executing bus recovery procedure (9 clk pulse)
[ 9.320362] i2c-msm-v2 78b9000.i2c: Bus recovery fail after 10 retries
[ 9.325854] synaptics_rmi4_i2c 5-0020: synaptics_rmi4_set_page: I2C retry 4
[ 9.866733] i2c-msm-v2 78b9000.i2c: TIMEOUT_ERROR(val:510msec) misconfigured GPIO or slave pulling bus line(s) low
[ 9.866733] : msgs(n:1 cur:0 tx) bc(rx:0 tx:2) mode:FIFO slv_addr:0x20 MSTR_STS:0x00132100 OPER:0x00000090
[ 9.986716] i2c-msm-v2 78b9000.i2c: bus lines held low by a slave detected
[ 9.992545] i2c-msm-v2 78b9000.i2c: Executing bus recovery procedure (9 clk pulse)
[ 10.082834] i2c-msm-v2 78b9000.i2c: Bus recovery fail after 10 retries
[ 10.088343] synaptics_rmi4_i2c 5-0020: synaptics_rmi4_set_page: I2C retry 5
[ 10.626735] i2c-msm-v2 78b9000.i2c: TIMEOUT_ERROR(val:510msec) misconfigured GPIO or slave pulling bus line(s) low
[ 10.626735] : msgs(n:1 cur:0 tx) bc(rx:0 tx:2) mode:FIFO slv_addr:0x20 MSTR_STS:0x00132100 OPER:0x00000090
[ 10.746716] i2c-msm-v2 78b9000.i2c: bus lines held low by a slave detected
[ 10.752544] i2c-msm-v2 78b9000.i2c: Executing bus recovery procedure (9 clk pulse)
[ 10.850362] i2c-msm-v2 78b9000.i2c: Bus recovery fail after 10 retries
[ 10.855854] synaptics_rmi4_i2c 5-0020: synaptics_rmi4_set_page: I2C retry 6
[ 11.396735] i2c-msm-v2 78b9000.i2c: TIMEOUT_ERROR(val:510msec) misconfigured GPIO or slave pulling bus line(s) low
[ 11.396735] : msgs(n:1 cur:0 tx) bc(rx:0 tx:2) mode:FIFO slv_addr:0x20 MSTR_STS:0x00132100 OPER:0x00000090
[ 11.516716] i2c-msm-v2 78b9000.i2c: bus lines held low by a slave detected
[ 11.522545] i2c-msm-v2 78b9000.i2c: Executing bus recovery procedure (9 clk pulse)
[ 11.615773] i2c-msm-v2 78b9000.i2c: Bus recovery fail after 10 retries
[ 11.621284] synaptics_rmi4_i2c 5-0020: synaptics_rmi4_set_page: I2C retry 7
[ 12.166736] i2c-msm-v2 78b9000.i2c: TIMEOUT_ERROR(val:510msec) misconfigured GPIO or slave pulling bus line(s) low
[ 12.166736] : msgs(n:1 cur:0 tx) bc(rx:0 tx:2) mode:FIFO slv_addr:0x20 MSTR_STS:0x00132100 OPER:0x00000090
[ 12.286717] i2c-msm-v2 78b9000.i2c: bus lines held low by a slave detected
[ 12.292546] i2c-msm-v2 78b9000.i2c: Executing bus recovery procedure (9 clk pulse)
[ 12.383821] i2c-msm-v2 78b9000.i2c: Bus recovery fail after 10 retries
[ 12.389330] synaptics_rmi4_i2c 5-0020: synaptics_rmi4_set_page: I2C retry 8
[ 12.926735] i2c-msm-v2 78b9000.i2c: TIMEOUT_ERROR(val:510msec) misconfigured GPIO or slave pulling bus line(s) low
[ 12.926735] : msgs(n:1 cur:0 tx) bc(rx:0 tx:2) mode:FIFO slv_addr:0x20 MSTR_STS:0x00132100 OPER:0x00000090
[ 13.046733] i2c-msm-v2 78b9000.i2c: bus lines held low by a slave detected
[ 13.052561] i2c-msm-v2 78b9000.i2c: Executing bus recovery procedure (9 clk pulse)
[ 13.142847] i2c-msm-v2 78b9000.i2c: Bus recovery fail after 10 retries
[ 13.148356] synaptics_rmi4_i2c 5-0020: synaptics_rmi4_set_page: I2C retry 9
[ 13.686735] i2c-msm-v2 78b9000.i2c: TIMEOUT_ERROR(val:510msec) misconfigured GPIO or slave pulling bus line(s) low
[ 13.686735] : msgs(n:1 cur:0 tx) bc(rx:0 tx:2) mode:FIFO slv_addr:0x20 MSTR_STS:0x00132100 OPER:0x00000090
[ 13.806717] i2c-msm-v2 78b9000.i2c: bus lines held low by a slave detected
[ 13.812545] i2c-msm-v2 78b9000.i2c: Executing bus recovery procedure (9 clk pulse)
[ 13.910360] i2c-msm-v2 78b9000.i2c: Bus recovery fail after 10 retries
[ 13.915852] synaptics_rmi4_i2c 5-0020: synaptics_rmi4_set_page: I2C retry 10
[ 13.946730] synaptics_rmi4_i2c 5-0020: synaptics_rmi4_probe: Failed to query device
[ 13.956638] synaptics_rmi4_i2c: probe of 5-0020 failed with error -5
[ 13.963330] input: input_mt_wrapper as /devices/virtual/input/input0
[ 13.970463] input: hbtp_vm as /devices/virtual/input/input1
[ 14.077178] i2c-msm-v2 78b6000.i2c: NACK: slave not responding, ensure its powered: msgs(n:2 cur:0 tx) bc(rx:1 tx:1) mode:FIFO slv_addr:0x68 MSTR_STS:0x011363c8 OPER:0x00000010
[ 14.091908] mpu6050 0-0068: Fail to read power mode, ret=-107
[ 14.097656] mpu6050 0-0068: Cannot get invalid chip type
[ 14.102987] mpu6050 0-0068: Probe device return error-107
[ 14.111567] mpu6050: probe of 0-0068 failed with error -107
[ 14.206889] i2c-msm-v2 78b6000.i2c: NACK: slave not responding, ensure its powered: msgs(n:1 cur:0 tx) bc(rx:0 tx:2) mode:FIFO slv_addr:0xc MSTR_STS:0x051363c8 OPER:0x00000090
[ 14.117193] AKM compass driver: initialize.
[ 14.221524] akm8963 0-000c: akm_i2c_txdata: transfer failed.
[ 14.227327] akm8963 0-000c: AKECS_Set_PowerDown: Can not set to powerdown mode.
[ 14.234740] i2c-msm-v2 78b6000.i2c: NACK: slave not responding, ensure its powered: msgs(n:2 cur:0 tx) bc(rx:2 tx:1) mode:FIFO slv_addr:0xc MSTR_STS:0x0d1343c8 OPER:0x00000010
[ 14.250254] akm8963 0-000c: akm_i2c_rxdata: transfer failed.
[ 14.259180] akm8963: probe of 0-000c failed with error -107
[ 14.264763] AKM compass driver: initialize.
[ 14.268838] i2c-core: driver [lis3dh_acc] using legacy suspend method
[ 14.275304] i2c-core: driver [lis3dh_acc] using legacy resume method
[ 14.281740] i2c-core: driver [bma2x2-accel] using legacy suspend method
[ 14.288258] i2c-core: driver [bma2x2-accel] using legacy resume method
[ 14.295147] qcom,qpnp-rtc qpnp-rtc-4: rtc core: registered qpnp_rtc as rtc0
[ 14.302033] i2c /dev entries driver
[ 14.368373] platform 1d00000.qcom,vidc: Driver msm_vidc_v4l2 requests probe deferral
[ 14.381064] adp1660 i2c_add_driver success
[ 14.384253] msm_flash_init_module:1114 Enter
[ 14.388746] msm_flash_lm3642_init entry
[ 14.476733] cam_src_clk get failed
[ 14.481614] msm_camera_power_up: clk enable failed
[ 14.486388] msm_camera_power_up:1351 failed
[ 14.573059] failed rc -517
[ 14.574750] platform 20.qcom,eeprom: Driver qcom,eeprom requests probe deferral
[ 14.583764] g_sctrl[0] ffffffc031cbb000
[ 14.586846] g_sctrl[1] ffffffc031cbc000<6>[ 14.590223] mt9m114_init_module:1155
[ 14.594184] mt9m114_init_module:1160 rc -19
[ 14.598032] ov5645_init_module:557
[ 14.645081] msm_cci_init: Failed in getting TOP gdscr regulator handle
[ 14.650739] msm_cci_init:781: hw_version = 0x10000008
[ 14.656145] msm_cci_irq:954 MASTER_0 error 0x10000000
[ 14.660749] msm_cci_i2c_read:441 read_words = 0, exp words = 1
[ 14.666538] msm_cci_i2c_read_bytes:519 failed rc -22
[ 14.671504] msm_camera_cci_i2c_read: line 49 rc = -22
[ 14.676520] msm_sensor_match_id: ov5645: read id failed
[ 14.681744] msm_sensor_check_id:1336 match id failed rc -22
[ 14.799720] msm_cci_init: Failed in getting TOP gdscr regulator handle
[ 14.805344] msm_cci_init:781: hw_version = 0x10000008
[ 14.810807] msm_cci_irq:954 MASTER_0 error 0x10000000
[ 14.815387] msm_cci_i2c_read:441 read_words = 0, exp words = 1
[ 14.821193] msm_cci_i2c_read_bytes:519 failed rc -22
[ 14.826121] msm_camera_cci_i2c_read: line 49 rc = -22
[ 14.831172] msm_sensor_match_id: ov5645: read id failed
[ 14.836364] msm_sensor_check_id:1336 match id failed rc -22
[ 14.949712] msm_cci_init: Failed in getting TOP gdscr regulator handle
[ 14.955332] msm_cci_init:781: hw_version = 0x10000008
[ 14.960798] msm_cci_irq:954 MASTER_0 error 0x10000000
[ 14.965376] msm_cci_i2c_read:441 read_words = 0, exp words = 1
[ 14.971186] msm_cci_i2c_read_bytes:519 failed rc -22
[ 14.976114] msm_camera_cci_i2c_read: line 49 rc = -22
[ 14.981175] msm_sensor_match_id: ov5645: read id failed
[ 14.986356] msm_sensor_check_id:1336 match id failed rc -22
[ 15.056732] msm_sensor_platform_probe ov5645 power up failed
[ 15.064644] ovti,ov5645: probe of 78.qcom,camera failed with error -22
[ 15.071217] ov7695_init_module:315

HI Anvesh,

Seems MSM camera power up sequence is failed due to clk setting improper.

Can you please share dtsi changes ?

FYI, Please refer the ov5645 camera sensor dtsi file from here arch/arm/boot/dts/qcom/apq8016-camera-sensor-sbc.dtsi - kernel/msm.git - Git at Google

Thanks,
Ramesh

Hi Ramesh,

Please find the dtsi changes below. They are same.

qcom,camera@78 {
compatible = “ovti,ov5645”;
reg = <0x78 0x0>;
qcom,slave-id = <0x78 0x300a 0x5645>;
/qcom,csiphy-sd-index = <1>; front camera
qcom,csid-sd-index = <1>;
/
qcom,csiphy-sd-index = <0>; /Rear camera/
qcom,csid-sd-index = <0>;
qcom,mount-angle = <90>;
qcom,sensor-name = “ov5645”;
cam_vdig-supply = <&pm8916_s4>;
cam_vana-supply = <&pm8916_l17>;
cam_vio-supply = <&pm8916_l6>;
qcom,cam-vreg-name = “cam_vdig”, “cam_vio”, “cam_vana”;
qcom,cam-vreg-min-voltage = <2100000 0 2850000>;
qcom,cam-vreg-max-voltage = <2100000 0 2850000>;
qcom,cam-vreg-op-mode = <200000 0 80000>;
pinctrl-names = “cam_default”, “cam_suspend”;
pinctrl-0 = <&cam_sensor_mclk1_default &cam_sensor_front_default>;
pinctrl-1 = <&cam_sensor_mclk1_sleep &cam_sensor_front_sleep>;
gpios = <&msm_gpio 27 0>,
<&msm_gpio 28 0>,
<&msm_gpio 33 0>;
qcom,gpio-reset = <1>;
qcom,gpio-standby = <2>;
qcom,gpio-req-tbl-num = <0 1 2>;
qcom,gpio-req-tbl-flags = <1 0 0>;
qcom,gpio-req-tbl-label = “CAMIF_MCLK”,
“CAM_RESET”,
“CAM_STANDBY”;
qcom,gpio-set-tbl-num = <1 1>;
qcom,gpio-set-tbl-flags = <0 2>;
qcom,gpio-set-tbl-delay = <1000 4000>;
qcom,csi-lane-assign = <0x4320>;
qcom,csi-lane-mask = <0x3>;
qcom,sensor-position = <1>;
qcom,sensor-mode = <0>;
qcom,cci-master = <0>;
qcom,mclk-23880000;
clocks = <&clock_gcc clk_mclk1_clk_src>,
<&clock_gcc clk_gcc_camss_mclk1_clk>;
clock-names = “cam_src_clk”, “cam_clk”;
};

Thanks,
N.Anvesh

Hi Anvesh,

Thanks for providing the dtsi changes,

cam_vana-supply = <&pm8916_l17>;

Here <&pm8916_l17>; By default this LDO is not enabled, you can refer the PM8916/PM8916-1 Device Specification from below, under 3.6 Section Output power management.

So, Suggesting to use below LDO for camera supplies this will enable all LDO by default,

cam_vdig-supply = <&vph_pwr_vreg>;
cam_vana-supply = <&vph_pwr_vreg>;
cam_vio-supply = <&vph_pwr_vreg>;

Thanks,
Ramesh