概述
尝试点亮前摄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等
<CameraModuleConfig>
<CameraId>2</CameraId>
<SensorName>hi846</SensorName>
<ChromatixName>hi846_chromatix</ChromatixName> //这里是对应的配置chromatix的文件名
<ModesSupported>1</ModesSupported>
<Position>FRONT</Position>
<MountAngle>270</MountAngle>
<CSIInfo>
<CSIDCore>1</CSIDCore>
<LaneMask>0x1F</LaneMask>
<LaneAssign>0x4320</LaneAssign>
<ComboMode>0</ComboMode>
</CSIInfo>
<LensInfo>
<FocalLength>2.54</FocalLength>
<FNumber>2.4</FNumber>
<TotalFocusDistance>1.2</TotalFocusDistance>
<HorizontalViewAngle>68.0</HorizontalViewAngle>
<VerticalViewAngle>51.0</VerticalViewAngle>
<MinFocusDistance>0.1</MinFocusDistance>
</LensInfo>
</CameraModuleConfig>
添加文件:(与上述配置对应)
vendor/qcom/proprietory/mm-camera/mm-camera2/media-controller/modules/sensors/configs/hi846_chromatix.xml
<ChromatixConfigurationRoot>
<CommonChromatixInfo>
<ChromatixName>
<ISPCommon>hi846_common</ISPCommon>
<PostProc>hi846_postproc</PostProc>
<CPPPreview>hi846_cpp_preview</CPPPreview>
<CPPSnapshot>hi846_cpp_snapshot</CPPSnapshot>
<CPPLiveshot>hi846_cpp_liveshot</CPPLiveshot>
</ChromatixName>
<ChromatixName special_mode_mask="ZOOM_UPSCALE">
<CPPSnapshot>hi846_cpp_us_chromatix</CPPSnapshot>
</ChromatixName>
<ChromatixName special_mode_mask="ZOOM_DOWNSCALE">
<CPPSnapshot>hi846_cpp_ds_chromatix</CPPSnapshot>
</ChromatixName>
</CommonChromatixInfo>
<ResolutionChromatixInfo>
<ChromatixName sensor_resolution_index="0">
<ISPPreview>hi846_snapshot</ISPPreview>
<ISPSnapshot>hi846_snapshot</ISPSnapshot>
<ISPVideo>hi846_default_video</ISPVideo>
<CPPVideo>hi846_cpp_video</CPPVideo>
<A3Preview>hi846_zsl_preview</A3Preview>
<A3Video>hi846_zsl_video</A3Video>
</ChromatixName>
<ChromatixName sensor_resolution_index="1">
<ISPPreview>hi846_preview</ISPPreview>
<ISPSnapshot>hi846_preview</ISPSnapshot>
<ISPVideo>hi846_default_video</ISPVideo>
<CPPVideo>hi846_cpp_video</CPPVideo>
<A3Preview>hi846_a3_default_preview</A3Preview>
<A3Video>hi846_a3_default_video</A3Video>
</ChromatixName>
<ChromatixName sensor_resolution_index="2">
<ISPPreview>hi846_hfr_60</ISPPreview>
<ISPSnapshot>hi846_hfr_60</ISPSnapshot>
<ISPVideo>hi846_hfr_60</ISPVideo>
<CPPVideo>hi846_cpp_hfr_60</CPPVideo>
<A3Preview>hi846_a3_hfr_60</A3Preview>
<A3Video>hi846_a3_hfr_60</A3Video>
</ChromatixName>
<ChromatixName sensor_resolution_index="3">
<ISPPreview>hi846_hfr_90</ISPPreview>
<ISPSnapshot>hi846_hfr_90</ISPSnapshot>
<ISPVideo>hi846_hfr_90</ISPVideo>
<CPPVideo>hi846_cpp_hfr_90</CPPVideo>
<A3Preview>hi846_a3_hfr_90</A3Preview>
<A3Video>hi846_a3_hfr_90</A3Video>
</ChromatixName>
<ChromatixName sensor_resolution_index="4">
<ISPPreview>hi846_hfr_120</ISPPreview>
<ISPSnapshot>hi846_hfr_120</ISPSnapshot>
<ISPVideo>hi846_hfr_120</ISPVideo>
<CPPVideo>hi846_cpp_hfr_120</CPPVideo>
<A3Preview>hi846_a3_hfr_120</A3Preview>
<A3Video>hi846_a3_hfr_120</A3Video>
</ChromatixName>
</ResolutionChromatixInfo>
</ChromatixConfigurationRoot>
这里配置了所需要的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/
最后
以上就是自信发箍为你收集整理的qcom camera bring up的全部内容,希望文章能够帮你解决qcom camera bring up所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复