第15讲 Camera Sensor KMD DTS 配置

本讲是Camera Sensor驱动专题的第15讲,我们介绍Camera Sensor点亮之 KMD DTS 配置。

更多资源:

资源 描述
在线课程 极客笔记在线课程
知识星球 星球名称:深入浅出Android Camera
星球ID: 17296815
Wechat 极客笔记圈

什么是DTS

DTS是一种用于描述硬件信息的数据结构和语言,它是树状结构的。

  • bengal-camera-sensor-qrd.dtsi
    • camera模组相关硬件描述(sensor,eeprom,actuator,flash,etc)
  • bengal-camera.dtsi
    • 平台相关camera硬件描述(ife,ipe,csiphy,csid,cci,etc)

soc 节点(flash,cam-res-mgr)

bengal-camera-sensor-qrd.dtsi //类似于C语言的头文件

&soc {
    led_flash_rear: qcom,camera-flash@0 {
        cell-index = <0>;  //唯一标号
        compatible = "qcom,camera-flash"; //和driver匹配,匹配后调驱动probe
        flash-source  = <&pmi632_flash0 &pmi632_flash1>; //引用flash节点,由BSP实现
        torch-source  = <&pmi632_torch0 &pmi632_torch1>;//引用torch节点,由BSP实现
        switch-source = <&pmi632_switch0 &pmi632_switch1>; //引用switch节点
        status = "ok"; //ok or disable
    };
    ,,,

    qcom,cam-res-mgr {    //管理GPIO资源,封装kernel API 接口
        compatible = "qcom,cam-res-mgr"; //和driver匹配,probe
        status = "ok"; //ok or disable
    };
};

cam_cci 节点

actuator

&cam_cci0 {     //平台cci0 控制器
    actuator_rear: qcom,actuator0 {    
        cell-index = <0>;   //唯一标号
        compatible = "qcom,actuator";       //和driver匹配,匹配后调驱动probe
        cci-master = <0>;         //cci index
        cam_vaf-supply = <&L5P>;        //电源引用节点,由BSP实现
        regulator-names = "cam_vaf";       //电源名称
        rgltr-cntrl-support;                //regulator 精确控制使能
        rgltr-min-voltage = <2800000>;   //最小电压值,单位µV
        rgltr-max-voltage = <2800000>;   //最大电压值,单位µV
        rgltr-load-current = <100000>;    //电流,单位µA
        status = "ok";
    };
    actuator_rear_aux: qcom,actuator1 {
        cell-index = <1>;
        compatible = "qcom,actuator";
        cci-master = <1>;
        cam_vaf-supply = <&L5P>;
        regulator-names = "cam_vaf";
        rgltr-cntrl-support;
        rgltr-min-voltage = <2800000>;
        rgltr-max-voltage = <2800000>;
        rgltr-load-current = <100000>;
        status = "ok";
    };

sensor

    qcom,cam-sensor0 {
        cell-index = <0>;     //唯一标号,slot id 和 module xml id唯一匹配
        compatible = "qcom,cam-sensor";    //和driver匹配,匹配后调驱动probe
        csiphy-sd-index = <0>;           //csiphy id, 绑定csiphy
        sensor-position-roll = <270>;      //会被xml配置覆盖
        sensor-position-pitch = <0>;       
        sensor-position-yaw = <180>;
        actuator-src = <&actuator_rear>;    //绑定actuator节点
        led-flash-src = <&led_flash_rear>;  //绑定flash节点
        eeprom-src = <&eeprom_rear>;      //绑定eeprom节点
        cam_vio-supply = <&L7P>;         //引用IOvdd 节点,由BSP具体实现
        cam_vana-supply = <&L4P>;        //引用Avdd 节点,由BSP具体实现
        cam_vdig-supply = <&L2P>;         //引用Dvdd 节点,由BSP具体实现
        cam_vaf-supply = <&L5P>;          //引用AFvdd 节点,由BSP具体实现
        cam_clk-supply = <&gcc_camss_top_gdsc>; //引用gdsc 时钟,由BSP实现 
        regulator-names = "cam_vio", "cam_vana", "cam_vdig",
            "cam_clk", "cam_vaf";
        rgltr-cntrl-support;    //regulator 精确控制使能
        rgltr-min-voltage = <1800000 2800000 1050000 0 2800000>;
        rgltr-max-voltage = <1800000 2800000 1050000 0 2800000>;
        rgltr-load-current = <120000 80000 1200000 0 100000>;
        gpio-no-mux = <0>;
        pinctrl-names = "cam_default", "cam_suspend";   //active, deactive
        pinctrl-0 = <&cam_sensor_mclk0_active
                &cam_sensor_rear0_reset_active>;  //active
        pinctrl-1 = <&cam_sensor_mclk0_suspend
                &cam_sensor_rear0_reset_suspend>; //deactive
        gpios = <&tlmm 20 0>,  // GPIO No.
            <&tlmm 18 0>; //GPIO No.
        gpio-reset = <1>;       //指定上面哪一个作为GPIO RESET使用
        gpio-req-tbl-num = <0 1>;    // GPIO 数组index
        gpio-req-tbl-flags = <1 0>;  //GPIO direction, 0:输出,1:输入
        gpio-req-tbl-label = "CAMIF_MCLK0",
                 "CAM_RESET0";
        cci-master = <0>;     //cci总线
        status = "ok";
        clocks = <&gcc GCC_CAMSS_MCLK0_CLK>;  //引用MCLK节点,由BSP提供具体实现
        clock-names = "cam_clk";   //MCLK时钟名称
        clock-cntl-level = "turbo";   
        clock-rates = <19200000>;  //MCLK时钟频率,19.2M or 24M
    };

EEPROM

Camera Sensor点亮之 KMD DTS 配置详解

Camera课程

Python教程

Java教程

Web教程

数据库教程

图形图像教程

办公软件教程

Linux教程

计算机教程

大数据教程

开发工具教程