qcom camera bring up

尝试点亮前摄camera,平台SDM450,android 8.0,sensor型号:hi846

本次只是点亮camera,并不包含马达,eeprom驱动等

kernel修改文件比较少,一般只修改一个文件

arch/arm/boot/dts/qcom/msm8953-camera-sensor-mtp.dtsi

想要具体确定修改哪个文件,一般定义在文件kernel/msm-3.18/include/soc/qcom/socinfo.h

或者kernel/msm-3.18/arch/arm/boot/dts/qcom/sdm450-pmiXXX.dts

添加代码:这里包括电源,时钟,管脚等的配置

qcom,camera@1{
cell-index = <2>;
compatible = "qcom,camera";
reg = <0x01>;
qcom,csiphy-sd-index = <1>;
qcom,csid-sd-index = <1>;
qcom,mount-angle = <90>;  //camera角度
cam_vdig-supply = <&pm8953_l23>;  //camera vdig对应管脚
cam_vio-supply = <&pm8953_l6>;   //camera vio 对应管脚
cam_vana-supply = <&pm8953_l22>; //camera vana 对应管脚,这戏管脚的具体对应需要查询硬件手册
cam_vaf-supply = <&pm8953_l17>;
qcom,cam-vreg-name = "cam_vdig", "cam_vio", "cam_vana",
"cam_vaf";
qcom,cam-vreg-min-voltage = <1175000 0 2800000 2850000>;
qcom,cam-vreg-max-voltage = <1175000 0 2800000 2850000>; //配置每个管脚的典雅范围
qcom,cam-vreg-op-mode = <105000 0 80000 100000>;
qcom,gpio-no-mux = <0>;
pinctrl-names = "cam_default", "cam_suspend";
pinctrl-0 = <&cam_sensor_mclk1_default
&cam_sensor_front1_default>;
pinctrl-1 = <&cam_sensor_mclk1_sleep
&cam_sensor_front1_sleep>;
gpios = <&tlmm 27 0>,
<&tlmm 129 0>,
<&tlmm 130 0>;
qcom,gpio-reset = <1>;
qcom,gpio-standby = <2>;  //配置对应gpio口
qcom,gpio-req-tbl-num = <0 1 2>;
qcom,gpio-req-tbl-flags = <1 0 0>;
qcom,gpio-req-tbl-label = "CAMIF_MCLK2",
 "CAM_RESET2",
 "CAM_STANDBY2";
qcom,sensor-position = <0>;
qcom,sensor-mode = <0>;
qcom,cci-master = <1>;
status = "ok";
clocks = <&clock_gcc clk_mclk1_clk_src>,
<&clock_gcc clk_gcc_camss_mclk1_clk>;
clock-names = "cam_src_clk", "cam_clk";
qcom,clock-rates = <24000000 0>;  //配置对应时钟
};

vendor目录下的修改:

vendor/qcom/proprietory/mm-camera/mm-camera2/media-controller/modules/sensors/configs/msm8953_camera.xml

添加代码:这里对应的是camera的基础配置信息,包含name position MountAngle lens等

 
    2
    hi846
    hi846_chromatix //这里是对应的配置chromatix的文件名
    1
    FRONT
    270
   
      1
      0x1F
      0x4320
      0
   

   
      2.54
      2.4
      1.2
      68.0
      51.0
      0.1
   

 

添加文件:(与上述配置对应)

vendor/qcom/proprietory/mm-camera/mm-camera2/media-controller/modules/sensors/configs/hi846_chromatix.xml


 
   
      hi846_common
      hi846_postproc
      hi846_cpp_preview
      hi846_cpp_snapshot
      hi846_cpp_liveshot
   

   
      hi846_cpp_us_chromatix
   

   
      hi846_cpp_ds_chromatix
   

 

 
   
      hi846_snapshot
      hi846_snapshot
      hi846_default_video
      hi846_cpp_video
      hi846_zsl_preview
      hi846_zsl_video
   

   
      hi846_preview
      hi846_preview
      hi846_default_video
      hi846_cpp_video
      hi846_a3_default_preview
      hi846_a3_default_video
   

   
      hi846_hfr_60
      hi846_hfr_60
      hi846_hfr_60
      hi846_cpp_hfr_60
      hi846_a3_hfr_60
      hi846_a3_hfr_60
   

   
      hi846_hfr_90
      hi846_hfr_90
      hi846_hfr_90
      hi846_cpp_hfr_90
      hi846_a3_hfr_90
      hi846_a3_hfr_90
   

   
      hi846_hfr_120
      hi846_hfr_120
      hi846_hfr_120
      hi846_cpp_hfr_120
      hi846_a3_hfr_120
      hi846_a3_hfr_120
   

 

这里配置了所需要的chromatix资料,对应不同型号模组,一般修改名字就可以了

vendor/qcom/proprietory/mm-camera/mm-camera2/media-controller/modules/sensors/configs/Android.mk

这里需要把hi846_chromatix.xml添加进android.mk,否则就不会被编译进系统

添加驱动文件:

vendor/qcom/proprietory/mm-camera/mm-camera2/media-controller/modules/sensors/sensor/libs/hi846/

驱动文件的配置信息参考:https://blog.csdn.net/wing12345678910/article/details/79586264

具体的驱动文件内容就需要和供应商确定如何获得了。如果实在没有可参考其他型号模组驱动,自己尝试写一下

添加效果配置文件:

vendor/qcom/proprietory/mm-camera/mm-camera2/media-controller/modules/sensors/chromatix/0309/chromatix_hi846

该目录下对应的是不同模式下的效果配置,同样需要供应商沟通获得

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

添加所有会新生成的库文件名,否则整编是无法生成对应的库文件

例如:MM_CAMERA += libmmcamera_hi846

至此camera的bring up就已经完成了

另外:解析camera 在kernel中dtsi信息的文件是:msm_camera_dt_util.c

总结:

camera bring up需要修改的文件

kernel

kernel/msm-3.18/arch/arm/boot/dts/qcom/msm8953-camera-sensor-mtp.dtsi

vendor

vendor/qcom/proprietory/mm-camera/mm-camera2/media-controller/modules/sensors/configs/msm8953_camera.xml

vendor/qcom/proprietory/mm-camera/mm-camera2/media-controller/modules/sensors/configs/Android.mk

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

添加的文件:

vendor/qcom/proprietory/mm-camera/mm-camera2/media-controller/modules/sensors/configs/hi846_chromatix.xml

新添加的目录

vendor/qcom/proprietory/mm-camera/mm-camera2/media-controller/modules/sensors/chromatix/0309/chromatix_hi846/

vendor/qcom/proprietory/mm-camera/mm-camera2/media-controller/modules/sensors/sensor/libs/hi846/

 

 

 

 

你可能感兴趣的:(android_camera)