Android L 5.1.1 Rear Camera - DB410c AISTARVISION
Coming back!
接着上一篇,我们基于AISTARVISION MIPI CSI Adapter V2.0继续分享ov5645 rear camera的porting方法。因为在DB410c的android L 5.1.1系统中默认带有ov5645的sensor driver,所以同学们对于这一颗sensor只需要修改configuration就ok了。
1. kernel部分修改camera cci dtsi文件,我截取了需要修改的字段,
qcom,[email protected] {
compatible = "ovti,ov5645";
qcom,csiphy-sd-index = <0>; /*should contain csiphy instance that will used toreceive sensor data*/
qcom,csid-sd-index = <0>; /*should contain csid core instance that will used toreceive
sensor data*/
gpios= <&msm_gpio 26 0>,
<&msm_gpio 35 0>,
<&msm_gpio 34 0>; /*should contain phandle to gpio controller node and array of #gpio-cells specifying specific gpio (controller specific)*/
qcom,csi-lane-assign = <0x4320>; /*should contain lane assignment value to map CSIPHYlanes
to CSID lanes*/
qcom,csi-lane-mask = <0x3>; /*should contain lane mask that specifies CSIPHY lanes tobe
enabled*/
qcom,sensor-position = <0>; /*should contain the mount angle of the camera sensor*/ /*0 -> back
camera 1 -> front camera*/
qcom,sensor-mode = <0>;
/*should contain sensor mode supported*/ /*0 -> back camera 2D 1 -> front camera 2D
2 -> back camera 3D 3 -> back camera int 3D*/
qcom,cci-master = <0>; /*should contain i2c master id to be used for this camerasensor*/
clocks = <&clock_gcc clk_mclk0_clk_src>, <&clock_gcc clk_gcc_camss_mclk0_clk>;
clock-names = "cam_src_clk", "cam_clk"; /*name of the clocks required for the device*/
};
2. user space部分修改ov5645_lib.c,这里也同样截取需要修改的字段,字段的意思比较容易理解,我就不额外加注释了。
static struct msm_sensor_init_params sensor_init_params = {
.modes_supported =1,
.position = 0,
.sensor_mount_angle= 0,
};
static struct csi_lane_params_t csi_lane_params = {
.csi_lane_assign =0x4320,
.csi_lane_mask =0x7,
.csi_if = 1,
.csid_core = {0},
.csi_phy_sel = 0,
};
static struct msm_camera_csi2_params ov5645_csi_params = {
.csid_params = {
.lane_cnt = 2,
},
.csiphy_params = {
.lane_cnt = 2,
.settle_cnt = 29,
},
};3. 通过以上两部分对ov5645 sensor configuration file的修改,再结合上篇博文的AISTARVISION MIPI CSI Adapter V2.0的硬件连接说明,“如果使用rear camera,sensor连接到J3
connector,J13就只需要用跳线帽(pin19连pin20,pin21连pin22)即可。”大家就可以看到Rear Camera的图像啦!share两张靓照
第一张是拍摄到影像的屏幕截图,这清晰度有点……,第二张是AISTARVISION MIPI Adapter V2.0, camera接在J3
connector。
OK,这篇博文就先写到这,后续我们会有更多的camera sensor porting的案例(包括3A tuning)和machine vision的系统方案share给大家,see you next time.