Qualcomm camera bring up

原创 2017年12月27日 14:38:29

Qualcomm camera bring up


1.1 kernel层

1.1.1 电源、时钟、RESET管脚等配置(dtsi配置):

file path:kernel/arch/arm/boot/dts/qcom/sdm660-camera-sensor-mtp_gm8plus.dtsi

example

qcom,camera@2 {
    cell-index = <2>;
    compatible = "qcom,camera";
    reg = <0x02>;
    qcom,csiphy-sd-index = <2>;
    qcom,csid-sd-index = <2>;
    qcom,mount-angle = <270>;
    //qcom,actuator-src = <&actuator2>;
    //qcom,led-flash-src = <&led_flash1>;
    //qcom,eeprom-src = <&eeprom2>;
    cam_vio-supply = <&pm660_l11>;
    cam_vana-supply = <&cam_avdd_gpio_regulator>;
    cam_vdig-supply = <&cam_dvdd_gpio_regulator>;
    qcom,cam-vreg-name = "cam_vio", "cam_vana", "cam_vdig";
    qcom,cam-vreg-min-voltage = <1780000 0 0>;
    qcom,cam-vreg-max-voltage = <1950000 0 0>;
    qcom,cam-vreg-op-mode = <105000 0 0>;
    qcom,gpio-no-mux = <0>;
    pinctrl-names = "cam_default", "cam_suspend";
    pinctrl-0 = <&cam_sensor_mclk1_active
             &cam_sensor_front_active>;
    pinctrl-1 = <&cam_sensor_mclk1_suspend
             &cam_sensor_front_suspend>;
    gpios = <&tlmm 33 0>,
        <&tlmm 47 0>;
    qcom,gpio-reset = <1>;
    qcom,gpio-req-tbl-num = <0 1>;
    qcom,gpio-req-tbl-flags = <1 0>;
    qcom,gpio-req-tbl-label = "CAMIF_MCLK1",
                "CAM_RESET1";
    qcom,sensor-position = <1>;
    qcom,sensor-mode = <0>;
    qcom,cci-master = <1>;
    status = "ok";
    clocks = <&clock_mmss MCLK1_CLK_SRC>,
        <&clock_mmss MMSS_CAMSS_MCLK1_CLK>;
    clock-names = "cam_src_clk", "cam_clk";
    qcom,clock-rates = <24000000 0>;
};

cam_avdd_gpio_regulator: cam_avdd_fixed_regulator {
    compatible = "regulator-fixed";
    regulator-name = "cam_avdd_gpio_regulator";
    regulator-min-microvolt = <2800000>;
    regulator-max-microvolt = <2800000>;
    enable-active-high;
    gpio = <&tlmm 31 0>;
    vin-supply = <&pm660l_bob>;
};

cam_dvdd_gpio_regulator: cam_dvdd_fixed_regulator {
    compatible = "regulator-fixed";
    regulator-name = "cam_dvdd_gpio_regulator";
    regulator-min-microvolt = <1200000>;
    regulator-max-microvolt = <1200000>;
    enable-active-high;
    gpio = <&tlmm 29 0>;
    vin-supply = <&pm660_s5>;
};


1.2 hal层

1.2.1 添加驱动文件:

file path:vendor/qcom/proprietary/mm-camera/mm-camera2/media-controller/modules/sensors/sensor/libs/

example
1.创建sensor库文件夹。
2.添加以下驱动恩建及Makefile:
(1)<sensor>_lib.c
(2)<sensor>_lib.h
(3)Make file

key note:在<sensor>_lib.h文件中注意填写正确的I2C地址与上下电时序。

1.2.2 添加效果文件:

file path:vendor/qcom/proprietary/mm-camera/mm-camera2/media-controller/modules/sensors/chromatix/0310/

example
1.创建sensor的效果文件夹。
2.添加效果文件。

1.2.3 添加<sensor>_chromatix.xml配置文件:

1.创建<sensor>_chromatix.xml配置文件。
file path:vendor/qcom-proprietary/mm-camera/mm-camera2/media-controller/modules/sensors/configs/

example

<ChromatixConfigurationRoot>
  <CommonChromatixInfo>
    <ChromatixName>
      <ISPCommon>s5k3h7_sunny_a8s05a_front_i_common</ISPCommon>
      <PostProc>s5k3h7_sunny_a8s05a_front_i_postproc</PostProc>
    </ChromatixName>
  </CommonChromatixInfo>
  <ResolutionChromatixInfo>
    <ChromatixName sensor_resolution_index="0">
      <ISPPreview>s5k3h7_sunny_a8s05a_front_i_snapshot</ISPPreview>
      <ISPSnapshot>s5k3h7_sunny_a8s05a_front_i_snapshot</ISPSnapshot>
      <ISPVideo>s5k3h7_sunny_a8s05a_front_i_video_full</ISPVideo>
      <CPPVideo>s5k3h7_sunny_a8s05a_front_i_cpp_video_full</CPPVideo>
      <CPPPreview>s5k3h7_sunny_a8s05a_front_i_cpp_preview</CPPPreview>
      <CPPSnapshot>s5k3h7_sunny_a8s05a_front_i_cpp_snapshot</CPPSnapshot>
      <CPPLiveshot>s5k3h7_sunny_a8s05a_front_i_cpp_liveshot</CPPLiveshot>
      <A3Preview>s5k3h7_sunny_a8s05a_front_i_zsl_preview</A3Preview>
      <A3Video>s5k3h7_sunny_a8s05a_front_i_zsl_video</A3Video>
    </ChromatixName>
    <ChromatixName sensor_resolution_index="1">
      <ISPPreview>s5k3h7_sunny_a8s05a_front_i_preview</ISPPreview>
      <ISPSnapshot>s5k3h7_sunny_a8s05a_front_i_preview</ISPSnapshot>
      <ISPVideo>s5k3h7_sunny_a8s05a_front_i_default_video</ISPVideo>
      <CPPVideo>s5k3h7_sunny_a8s05a_front_i_cpp_video</CPPVideo>
      <CPPPreview>s5k3h7_sunny_a8s05a_front_i_cpp_preview</CPPPreview>
      <CPPSnapshot>s5k3h7_sunny_a8s05a_front_i_cpp_snapshot</CPPSnapshot>
      <CPPLiveshot>s5k3h7_sunny_a8s05a_front_i_cpp_liveshot</CPPLiveshot>
      <A3Preview>s5k3h7_sunny_a8s05a_front_i_a3_default_preview</A3Preview>
      <A3Video>s5k3h7_sunny_a8s05a_front_i_a3_default_video</A3Video>
    </ChromatixName>
    <ChromatixName sensor_resolution_index="2">
      <ISPPreview>s5k3h7_sunny_a8s05a_front_i_hfr_60</ISPPreview>
      <ISPSnapshot>s5k3h7_sunny_a8s05a_front_i_hfr_60</ISPSnapshot>
      <ISPVideo>s5k3h7_sunny_a8s05a_front_i_hfr_60</ISPVideo>
      <CPPVideo>s5k3h7_sunny_a8s05a_front_i_cpp_hfr_60</CPPVideo>
      <CPPPreview>s5k3h7_sunny_a8s05a_front_i_cpp_hfr_60</CPPPreview>
      <CPPSnapshot>s5k3h7_sunny_a8s05a_front_i_cpp_hfr_60</CPPSnapshot>
      <CPPLiveshot>s5k3h7_sunny_a8s05a_front_i_cpp_hfr_60</CPPLiveshot>
      <A3Preview>s5k3h7_sunny_a8s05a_front_i_a3_hfr_60</A3Preview>
      <A3Video>s5k3h7_sunny_a8s05a_front_i_a3_hfr_60</A3Video>
    </ChromatixName>
    <ChromatixName sensor_resolution_index="3">
      <ISPPreview>s5k3h7_sunny_a8s05a_front_i_hfr_90</ISPPreview>
      <ISPSnapshot>s5k3h7_sunny_a8s05a_front_i_hfr_90</ISPSnapshot>
      <ISPVideo>s5k3h7_sunny_a8s05a_front_i_hfr_90</ISPVideo>
      <CPPVideo>s5k3h7_sunny_a8s05a_front_i_cpp_hfr_90</CPPVideo>
      <CPPPreview>s5k3h7_sunny_a8s05a_front_i_cpp_hfr_90</CPPPreview>
      <CPPSnapshot>s5k3h7_sunny_a8s05a_front_i_cpp_hfr_90</CPPSnapshot>
      <CPPLiveshot>s5k3h7_sunny_a8s05a_front_i_cpp_hfr_90</CPPLiveshot>
      <A3Preview>s5k3h7_sunny_a8s05a_front_i_a3_hfr_90</A3Preview>
      <A3Video>s5k3h7_sunny_a8s05a_front_i_a3_hfr_90</A3Video>
    </ChromatixName>
    <ChromatixName sensor_resolution_index="4">
      <ISPPreview>s5k3h7_sunny_a8s05a_front_i_hfr_120</ISPPreview>
      <ISPSnapshot>s5k3h7_sunny_a8s05a_front_i_hfr_120</ISPSnapshot>
      <ISPVideo>s5k3h7_sunny_a8s05a_front_i_hfr_120</ISPVideo>
      <CPPVideo>s5k3h7_sunny_a8s05a_front_i_cpp_hfr_120</CPPVideo>
      <CPPPreview>s5k3h7_sunny_a8s05a_front_i_cpp_hfr_120</CPPPreview>
      <CPPSnapshot>s5k3h7_sunny_a8s05a_front_i_cpp_hfr_120</CPPSnapshot>
      <CPPLiveshot>s5k3h7_sunny_a8s05a_front_i_cpp_hfr_120</CPPLiveshot>
      <A3Preview>s5k3h7_sunny_a8s05a_front_i_a3_hfr_120</A3Preview>
      <A3Video>s5k3h7_sunny_a8s05a_front_i_a3_hfr_120</A3Video>
    </ChromatixName>
  </ResolutionChromatixInfo>
</ChromatixConfigurationRoot>

key note:文件中一系列“s5k3h7_sunny_a8s05a_front_i_* name一定要与1.2.2中添加的效果文件中的Makefile里的LOCAL_MODULE名字一样。

2.配置make file文件:
file path:/vendor/qcom-proprietary/mm-camera/mm-camera2/media-controller/modules/sensors/configs/Android.mk

example

include $(CLEAR_VARS)
LOCAL_MODULE:= gm8plus_s5k3h7_sunny_front_i_chromatix.xml
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_SRC_FILES := gm8plus_s5k3h7_sunny_front_i_chromatix.xml
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/camera
LOCAL_MODULE_OWNER := qti
include $(BUILD_PREBUILT)

1.2.4 配置<project&platform>_camera.xml文件:

file path:vendor/qcom/proprietary/mm-camera/mm-camera2/media-controller/modules/sensors/configs/gm8plus_camera.xml

example

<CameraModuleConfig>
    <CameraId>2</CameraId>
    <SensorName>gm8plus_s5k3h7_sunny_front_i</SensorName>
    <!--EepromName>gm8plus_s5k3h7_sunny_front_i_eeprom</EepromName-->
    <FlashName>pmic</FlashName>
    <ChromatixName>gm8plus_s5k3h7_sunny_front_i_chromatix</ChromatixName>
    <ModesSupported>1</ModesSupported>
    <Position>FRONT</Position>
    <MountAngle>270</MountAngle>
    <CSIInfo>
        <CSIDCore>2</CSIDCore>
        <LaneMask>0x1F</LaneMask>
        <LaneAssign>0x4320</LaneAssign>
        <ComboMode>0</ComboMode>
    </CSIInfo>
    <LensInfo>
        <FocalLength>1.97</FocalLength>
        <FNumber>2.0</FNumber>
        <TotalFocusDistance>1.9</TotalFocusDistance>
        <HorizontalViewAngle>84.0</HorizontalViewAngle>
        <VerticalViewAngle>63.0</VerticalViewAngle>
        <MinFocusDistance>0.1</MinFocusDistance>
    </LensInfo>
</CameraModuleConfig>

key note:上述代码中的SensorName、EepromName和ChromatixName一定要填写正确。

1.2.5 把前面所有make file中的LOCAL_MODULE添加最终的make file(device-vendor.mk):

file path:vendor/qcom/proprietary/common/config/device-vendor.mk

example

MM_CAMERA += libchromatix_gm8plus_s5k3h7_sunny_front_i_common
MM_CAMERA += libchromatix_gm8plus_s5k3h7_sunny_front_i_postproc
MM_CAMERA += libchromatix_gm8plus_s5k3h7_sunny_front_i_cpp_preview
MM_CAMERA += libchromatix_gm8plus_s5k3h7_sunny_front_i_cpp_snapshot
MM_CAMERA += libchromatix_gm8plus_s5k3h7_sunny_front_i_cpp_liveshot
MM_CAMERA += libchromatix_gm8plus_s5k3h7_sunny_front_i_cpp_us_chromatix
MM_CAMERA += libchromatix_gm8plus_s5k3h7_sunny_front_i_cpp_ds_chromatix
MM_CAMERA += libchromatix_gm8plus_s5k3h7_sunny_front_i_cpp_video_full
MM_CAMERA += libchromatix_gm8plus_s5k3h7_sunny_front_i_cpp_video
MM_CAMERA += libchromatix_gm8plus_s5k3h7_sunny_front_i_cpp_hfr_120
MM_CAMERA += libchromatix_gm8plus_s5k3h7_sunny_front_i_cpp_hfr_90
MM_CAMERA += libchromatix_gm8plus_s5k3h7_sunny_front_i_cpp_hfr_60
MM_CAMERA += libchromatix_gm8plus_s5k3h7_sunny_front_i_a3_default_preview
MM_CAMERA += libchromatix_gm8plus_s5k3h7_sunny_front_i_a3_default_video
MM_CAMERA += libchromatix_gm8plus_s5k3h7_sunny_front_i_a3_hfr_60
MM_CAMERA += libchromatix_gm8plus_s5k3h7_sunny_front_i_a3_hfr_90
MM_CAMERA += libchromatix_gm8plus_s5k3h7_sunny_front_i_a3_hfr_120
MM_CAMERA += libchromatix_gm8plus_s5k3h7_sunny_front_i_zsl_preview
MM_CAMERA += libchromatix_gm8plus_s5k3h7_sunny_front_i_zsl_video
MM_CAMERA += libchromatix_gm8plus_s5k3h7_sunny_front_i_snapshot
MM_CAMERA += libchromatix_gm8plus_s5k3h7_sunny_front_i_video_full
MM_CAMERA += libchromatix_gm8plus_s5k3h7_sunny_front_i_preview
MM_CAMERA += libchromatix_gm8plus_s5k3h7_sunny_front_i_liveshot
MM_CAMERA += libchromatix_gm8plus_s5k3h7_sunny_front_i_default_video
MM_CAMERA += libchromatix_gm8plus_s5k3h7_sunny_front_i_hfr_60
MM_CAMERA += libchromatix_gm8plus_s5k3h7_sunny_front_i_hfr_90
MM_CAMERA += libchromatix_gm8plus_s5k3h7_sunny_front_i_hfr_120

MM_CAMERA += libmmcamera_gm8plus_s5k3h7_sunny_front_i
MM_CAMERA += gm8plus_s5k3h7_sunny_front_i_chromatix.xml

设备树详解

转载:http://blog.csdn.net/qq_28992301/article/details/53321610 设备树详解 在Linux3.x版本后,arch/arm/pla...
  • huohongpeng
  • huohongpeng
  • 2018年01月03日 09:26
  • 70

Linux电源管理-Linux regulator framework概述

前言 1.  什么是regulator?      regulator翻译为"调节器",分为voltage regulator(电压调节器)和current(电流调节器)。一般电源管理芯片(Power...
  • longwang155069
  • longwang155069
  • 2016年11月14日 14:53
  • 1557

Qualcomm camera bring up

Qualcomm camera bring up 1 kernel层 11 电源时钟RESET管脚等配置dtsi配置 2 hal层 21 添加驱动文件 22 添加效果文件 23 添加sensor_ch...
  • liaokesen168
  • liaokesen168
  • 2017年12月27日 14:38
  • 444

qualcomm平台camera bring up 分析

1  camera基本代码架构     高通平台对于camera的代码组织,大体上还是遵循Android的框架:即上层应用和HAL层交互,高通平台在HAL层里面实现自己的一套管理策略;在ke...
  • weijory
  • weijory
  • 2017年04月17日 16:12
  • 905

基础:高通bring up camera

bring UP 需要做的工作 1、kernelspace sensor driver : 驱动和设备树 2、userspace camera 对应的chromatix librar...
  • liwei16611
  • liwei16611
  • 2016年11月06日 21:26
  • 1350

高通camera bring up软件流程

高通camera bring up分为两种类型:YUV和bayer bring up yuv sensor 1、kernel空间 1) vim kernel/driver/media/platf...
  • liwei16611
  • liwei16611
  • 2016年04月29日 10:09
  • 1449

Qualcomm camera OTP bring up

Qualcomm camera OTP bring up 1 kernel层 11 eeprom读取地址大小和sensor上电时序等配置dts配置 2 hal层 21 添加eeprom驱动文件 22 ...
  • liaokesen168
  • liaokesen168
  • 2017年12月27日 15:22
  • 35

高通Camera Bring Up问题汇总

高通camera探测探测流程: 1)开机过程中power up 2)read chip id&match chip id 3)power down 1)camera probe f...
  • shallot0000
  • shallot0000
  • 2015年11月06日 20:10
  • 959

基于qualcomm平台的Camera Bring up

前言: 趁手头有块820板子(MSM8096)和一个摄像头(信利16021),就自己尝试bring up一下camera了,之前也没弄过摄像头方面的东西额,纯粹是操作一步记录一步的方式额,不喜勿喷,仅...
  • weijory
  • weijory
  • 2016年12月22日 11:16
  • 1817

Qualcomm Camera 开发遇到的错误及解决方法

图像处理(9) . 版权声明:本文为博主原创文章,未经博主允许不得转载。1. Camera module probe error: (2011.6.28)I2C slave address:0x48 ...
  • cosmoslhf
  • cosmoslhf
  • 2015年12月22日 16:00
  • 1341
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:Qualcomm camera bring up
举报原因:
原因补充:

(最多只允许输入30个字)