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
總結
以上是生活随笔為你收集整理的msm8974 camera driver添加新摄像头kernel hal修改的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 平述factory reset——从ma
- 下一篇: qualcomm memory dump