msm8974 camera driver添加新摄像头kernel hal修改

添加一款新摄像头流程

1添加sensor kernel driver, 主要实现上电、rst、pwd、mclk等power setting,sensor prob & sensor  i2c driver prob 和 v4l2_subdev 注册

\kernel\drivers\media\platform\msm\camera_v2\sensor\ov5648.c


2 添加编译选项

obj-$(CONFIG_OV5648)+= ov5648.o

kernel\drivers\media\platform\msm\camera_v2\sensor\Makefile


3 添加编译开关

CONFIG_OV5648=y

kernel/arch/arm/configs/msm8974_defconfig

kernel/arch/arm/configs/msm8974-perf_defconfig

 

config OV5648

       bool "Sensor OV5648 (BAYER 5M)"

       depends on MSMB_CAMERA

       ---help---

              OmniVision 5 MP Bayer Sensor,supports 2 mipi lanes,

              preview and snapshot config at1932 * 1092 at 30 fps,

              hfr video at 60, 90 and 120 fps.This sensor driver does

              not support auto focus.

kernel/drivers/media/platform/msm/camera_v2/Kconfig


4 device tree 修改

添加相应sensor的device tree描述

Kenel/arch/arm/boot/dts/msm8974-camera-sensor-cdp.dtsi


+       qcom,camera@6c {
+               compatible = "qcom,ov5648";
+               reg = <0x6c 0x0>;
+               qcom,slave-id = <0x6c 0x300A 0x5648>;
+               qcom,csiphy-sd-index = <2>;
+               qcom,csid-sd-index = <2>;
+               qcom,mount-angle = <90>;
+               qcom,sensor-name = "ov5648";
+               qcom,vdd-cx-supply = <&pm8841_s2>;
+               qcom,vdd-cx-name = "qcom,vdd-cx";
+               cam_vdig-supply = <&pm8941_l22>;
+               cam_vana-supply = <&pm8941_l17>;
+               cam_vio-supply = <&pm8941_lvs3>;
+               qcom,cam-vreg-name = "cam_vdig", "cam_vana", "cam_vio";
+               qcom,cam-vreg-type = <0 0 1>;
+               qcom,cam-vreg-min-voltage = <1500000 2800000 0>;
+               qcom,cam-vreg-max-voltage = <1500000 2800000 0>;
+               qcom,cam-vreg-op-mode = <105000 80000 0>;
+               qcom,gpio-no-mux = <0>;
+               gpios = <&msmgpio 17 0>,
+                       <&msmgpio 18 0>,
+                       <&msmgpio 89 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_RESET1",
+                                         "CAM_STANDBY";
+               qcom,gpio-set-tbl-num = <1 1>;
+               qcom,gpio-set-tbl-flags = <0 2>;
+               qcom,gpio-set-tbl-delay = <1000 30000>;
+               qcom,csi-lane-assign = <0x4320>;
+               qcom,csi-lane-mask = <0x7>;
+               qcom,sensor-position = <1>;
+               qcom,sensor-mode = <1>;
+               qcom,sensor-type = <0>;
+               qcom,cci-master = <1>;
+               status = "ok";
+       };


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\ ov5648


6 hal层 raw camera效果调试文件

vendor\qcom\proprietary\mm-camera\mm-camera2\media-controller\modules\sensors\chromatix\0301\libchromatix\ chromatix_ov5648


7 hal层编译

MM_CAMERA +=libmmcamera_ov5648

MM_CAMERA +=libchromatix_ov5648_common

MM_CAMERA +=libchromatix_ov5648_preview

MM_CAMERA +=libchromatix_ov5648_default_video

MM_CAMERA +=libchromatix_ov5648_hfr

MM_CAMERA +=libchromatix_ov5648_zsl

vendor/qcom/proprietary/common/config/device-vendor.mk


End微笑微笑

posted on 2016-06-14 14:58  王亮1  阅读(413)  评论(0编辑  收藏  举报

导航