在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 注册
obj-$(CONFIG_OV5645) += ov5645.o
kernel\drivers\media\platform\msm\camera_v2\sensor\Makefile
3 添加编译开关
(android5.1.1-qcom-dragonboard410c\kernel\arch\arm64\configs\msm_defconfig、msm-perf_defconfig、msm-LMT-perf_defconfig)
CONFIG_OV5645=y
kernel/drivers/media/platform/msm/camera_v2/Kconfig
bool "Sensor OV5645 (YUV 5.0MP)"
depends on MSMB_CAMERA
---help---
OV5645 is Omnivision YUV sensor. It supports 5.0 MP preview
and snapshot. The preview and snapshot resolution shall be
1280 * 270. It does not support auto focus. It supports
few special effects like saturation.
4 device tree 修改
添加相应sensor的device tree描述
Kenel/arch/arm64/boot/dts/apq8016-camera-sensor-sbc.dtsi
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\ ov56456 hal层 raw camera效果调试文件
vendor\qcom\proprietary\mm-camera\mm-camera2\media-controller\modules\sensors\chromatix\0301\libchromatix\ chromatix_ov5645
7 hal层编译(vendor/qcom/proprietary/common/config/device-vendor.mk)
MM_CAMERA +=libmmcamera_ov5645
MM_CAMERA +=libchromatix_ov5645_common
MM_CAMERA +=libchromatix_ov5645_preview
MM_CAMERA +=libchromatix_ov5645_default_video
MM_CAMERA +=libchromatix_ov5645_hfr
MM_CAMERA +=libchromatix_ov5645_zsl