在dragonboard410c上添加一款新摄像头流程
1添加sensor kernel driver文件:(\kernel\drivers\media\platform\msm\camera_v2\sensor\ov5645.c)
msm_sensor_power_setting、msm_camera_i2c_reg_conf、v4l2_subdev_info
ov5645.c驱动文件主要实现上电、rst、pwd、mclk等power setting 和 sensor prob & sensor i2c driver prob 以及 v4l2_subdev 注册
3 添加编译开关
(android5.1.1-qcom-dragonboard410c\kernel\arch\arm64\configs\msm_defconfig、msm-perf_defconfig、msm-LMT-perf_defconfig)
CONFIG_OV5645=ykernel/drivers/media/platform/msm/camera_v2/Kconfig
qcom,camera@78 {
compatible = "ovti,ov5645";
reg = <0x78 0x0>;
qcom,slave-id = <0x78 0x300a 0x5645>;
qcom,csiphy-sd-index = <1>;
qcom,csid-sd-index = <1>;
qcom,mount-angle = <90>;
qcom,sensor-name = "ov5645";
cam_vdig-supply = <&vph_pwr_vreg>;
cam_vana-supply = <&vph_pwr_vreg>;
cam_vio-supply = <&vph_pwr_vreg>;
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";
};
5 hal层修改,
添加hal层sensor libs 代码,实现对应sensor的init setting, preview setting, 各种resolution setting , group on ,group off,csi csid config etc. customer 端sensor主要实现
vendor\qcom\proprietary\mm-camera\mm-camera2\media-controller\modules\sensors\sensor_libs\ ov5645