1. 程式人生 > 實用技巧 >高通Android Camera Actuator Bring up

高通Android Camera Actuator Bring up

高通Android Camera Actuator的移植

reference:https://blog.csdn.net/mr_zjc/article/details/105736925

介紹

自動對焦功能需要靠馬達帶動鏡片移動來實現,在拍照時候仔細聽能聽到對焦馬達發出的咔咔聲。因此,在Camera sensor bring up以後,就需要關注這個部分的控制。

這篇文章主要介紹在高通平臺的CamX框架裡面,如何去點亮攝像頭馬達,需要修改哪些相關的檔案。

mm-camera 也是類似的。

大體瀏覽

先來個整體的瀏覽,看下涉及到需要修改哪些目錄下的檔案。要讓馬達運轉起來,我們需要修改的基本就是下面4個目錄下的相關檔案。

目錄 意義
vendor/qcom/proprietary/chi-cdk/oem/qcom/actuator 各種型號的馬達配置檔案目錄
vendor/qcom/proprietary/chi-cdk/oem/qcom/module Camera sensor配置檔案目錄
vendor/qcom/proprietary/chi-cdk/tools/buildbins 各個Camera sensor編譯配置的檔案目錄
vendor/qcom/proprietary/camera-devicetree dtsi檔案相關,主要配置Camera sensor上電時序等資訊

修改檔案內容詳細分析

例如,某個sensor是s5k3p9sx、馬達型號是dw9763。

actuator配置

路徑:vendor/qcom/proprietary/chi-cdk/oem/qcom/actuator

這個目錄下,是各個型號的馬達配置檔案,高通原始碼裡面已經有一些比較常見的馬達型號的配置檔案,我們可以進行參考。

vendor/qcom/proprietary/chi-cdk/oem/qcom/actuator$ ls
ak7371_actuator.xml      dw9714v_actuator.xml  dw9763b_actuator.xml  gt9764_actuator.xml      lc898217xc_actuator.xml
ak7374_actuator.xml      dw9718s_actuator.xml  dw9767_actuator.xml   gt9772_actuator.xml
bu64297gwz_actuator.xml  dw9763_actuator.xml   dw9800_actuator.xml   

我們隨便打開個xml的檔案:cat dw9763_actuator.xml

<?xml version="1.0" encoding="utf-8" ?>
<!--========================================================================-->
<!-- Copyright (c) 2017-2018 Qualcomm Technologies, Inc.                         -->
<!-- All Rights Reserved.                                                   -->
<!-- Confidential and Proprietary - Qualcomm Technologies, Inc.             -->
<!--========================================================================-->
<actuatorDriver
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation="../../../api/sensor/camxactuatordriver.xsd">
  <module_version major_revision="1" minor_revision="0" incr_revision="0"/>

  <!--Actuator slave information -->
  <slaveInfo>
    <!--Name of the actuator -->
    <actuatorName>dw9763</actuatorName>
    <!--8-bit or 10-bit write slave address -->
    <slaveAddress>0x18</slaveAddress>
    <!--I2C frequency mode of slave
        Supported modes are: STANDARD (100 KHz), FAST (400 KHz), FAST_PLUS (1 MHz), CUSTOM (Custom frequency in DTSI) -->
    <i2cFrequencyMode>FAST</i2cFrequencyMode>
    <!--Actuator type
        Supported types are: VCM, BIVCM -->
    <actuatorType>VCM</actuatorType>
    <!--Data width in bits -->
    <dataBitWidth>10</dataBitWidth>
    <!--Sequence of power configuration type and configuration value required to control power to the device -->
    <powerUpSequence>
      <!--Power setting configuration
          Contains: configType, configValue and delay in milli seconds -->
      <powerSetting>
        <!--Power configuration type
            Supported types are: MCLK, VANA, VDIG, VIO, VAF, RESET, STANDBY -->
        <configType>VAF</configType>
        <!--Configuration value for the type of configuration -->
        <configValue>0</configValue>
        <!--Delay in milli seconds -->
        <delayMs>1</delayMs>
      </powerSetting>
    </powerUpSequence>
    <!--Sequence of power configuration type and configuration value required to control power to the device -->
    <powerDownSequence>
      <!--Power setting configuration
          Contains: configType, configValue and delay in milli seconds -->
      <powerSetting>
        <!--Power configuration type
            Supported types are: MCLK, VANA, VDIG, VIO, VAF, RESET, STANDBY -->
        <configType>VAF</configType>
        <!--Configuration value for the type of configuration -->
        <configValue>0</configValue>
        <!--Delay in milli seconds -->
        <delayMs>1</delayMs>
      </powerSetting>
    </powerDownSequence>
  </slaveInfo>
  <!--Sequence of register configuration -->
  <registerConfig>
    <!--Actuator register configuration -->
    <registerParam>
      <!--Register address / data size in bytes -->
      <regAddrType range="[1,4]">1</regAddrType>
      <!--Register address / data size in bytes -->
      <regDataType range="[1,4]">2</regDataType>
      <!--Register address that is accessed -->
      <registerAddr>0x03</registerAddr>
      <!--Register data to be programmed -->
      <registerData>0</registerData>
      <!--Actuator operations
          Supported operations are: WRITE_HW_DAMP, WRITE_DAC, WRITE, WRITE_DIR_REG, POLL, READ_WRITE -->
      <operation>WRITE_DAC_VALUE</operation>
      <!--Delay in micro seconds -->
      <delayUs>0</delayUs>
      <!--Hardware mask -->
      <hwMask>0</hwMask>
      <!--Number of bits to shift for HW -->
      <hwShift>0</hwShift>
      <!--Number of bits to shift for data -->
      <dataShift>0</dataShift>
    </registerParam>
  </registerConfig>
  <!--Sequence of register settings to configure the device -->
  <initSettings>
    <!--Register setting configuration
        Contains: register address, register data, register address type, register data type, operation and delay in micro seconds -->
    <regSetting>
      <!--Register address that is accessed -->
      <registerAddr>0x02</registerAddr>
      <!--If operation is WRITE, registerData is the data value to be written into the specified register address
          If operation is READ, registerData is the number of bytes to be read from the specified register address -->
      <registerData>0x02</registerData>
      <!--Register address / data size in bytes -->
      <regAddrType range="[1,4]">1</regAddrType>
      <!--Register address / data size in bytes -->
      <regDataType range="[1,4]">1</regDataType>
      <!--Type of the operation
          Valid values are: WRITE, READ, POLL -->
      <operation>WRITE</operation>
      <!--Delay in micro seconds -->
      <delayUs>0</delayUs>
    </regSetting>
    <!--Register setting configuration
        Contains: register address, register data, register address type, register data type, operation and delay in micro seconds -->
    <regSetting>
      <!--Register address that is accessed -->
      <registerAddr>0x02</registerAddr>
      <!--If operation is WRITE, registerData is the data value to be written into the specified register address
          If operation is READ, registerData is the number of bytes to be read from the specified register address -->
      <registerData>0x02</registerData>
      <!--Register address / data size in bytes -->
      <regAddrType range="[1,4]">1</regAddrType>
      <!--Register address / data size in bytes -->
      <regDataType range="[1,4]">1</regDataType>
      <!--Type of the operation
          Valid values are: WRITE, READ, POLL -->
      <operation>WRITE</operation>
      <!--Delay in micro seconds -->
      <delayUs>0</delayUs>
    </regSetting>
    <!--Register setting configuration
        Contains: register address, register data, register address type, register data type, operation and delay in micro seconds -->
    <regSetting>
      <!--Register address that is accessed -->
      <registerAddr>0x06</registerAddr>
      <!--If operation is WRITE, registerData is the data value to be written into the specified register address
          If operation is READ, registerData is the number of bytes to be read from the specified register address -->
      <registerData>0x41</registerData>
      <!--Register address / data size in bytes -->
      <regAddrType range="[1,4]">1</regAddrType>
      <!--Register address / data size in bytes -->
      <regDataType range="[1,4]">1</regDataType>
      <!--Type of the operation
          Valid values are: WRITE, READ, POLL -->
      <operation>WRITE</operation>
      <!--Delay in micro seconds -->
      <delayUs>0</delayUs>
    </regSetting>
    <!--Register setting configuration
        Contains: register address, register data, register address type, register data type, operation and delay in micro seconds -->
    <regSetting>
      <!--Register address that is accessed -->
      <registerAddr>0x07</registerAddr>
      <!--If operation is WRITE, registerData is the data value to be written into the specified register address
          If operation is READ, registerData is the number of bytes to be read from the specified register address -->
      <registerData>0x3F</registerData>
      <!--Register address / data size in bytes -->
      <regAddrType range="[1,4]">1</regAddrType>
      <!--Register address / data size in bytes -->
      <regDataType range="[1,4]">1</regDataType>
      <!--Type of the operation
          Valid values are: WRITE, READ, POLL -->
      <operation>WRITE</operation>
      <!--Delay in micro seconds -->
      <delayUs>0</delayUs>
    </regSetting>
    <!--Register setting configuration
        Contains: register address, register data, register address type, register data type, operation and delay in micro seconds -->
    <regSetting>
      <!--Register address that is accessed -->
      <registerAddr>0x08</registerAddr>
      <!--If operation is WRITE, registerData is the data value to be written into the specified register address
          If operation is READ, registerData is the number of bytes to be read from the specified register address -->
      <registerData>0x00</registerData>
      <!--Register address / data size in bytes -->
      <regAddrType range="[1,4]">1</regAddrType>
      <!--Register address / data size in bytes -->
      <regDataType range="[1,4]">1</regDataType>
      <!--Type of the operation
          Valid values are: WRITE, READ, POLL -->
      <operation>WRITE</operation>
      <!--Delay in micro seconds -->
      <delayUs>0</delayUs>
    </regSetting>
  </initSettings>
  <!--Actuator tuning parameters -->
  <tunedParams>
    <!--Initial DAC code -->
    <initialCode>180</initialCode>
    <!--Actuator region parameters for all regions -->
    <regionParams>
      <!--Actuator region parameters -->
      <region>
        <!--Macro step boundary. In Near / forward direction -->
        <macroStepBoundary>400</macroStepBoundary>
        <!--Infinity step boundary. In Far / backward direction -->
        <infinityStepBoundary>0</infinityStepBoundary>
        <!--Code per step -->
        <codePerStep>1</codePerStep>
        <!--Q Value to convert float / double to integer format -->
        <qValue>128</qValue>
      </region>
    </regionParams>
    <!--Actuator scenario ringing and damping information
        Damping parameters in forward / near direction -->
    <forwardDamping>
      <!--Actuator ringing scenario value -->
      <ringingScenario>400</ringingScenario>
      <!--Actuator damping parameters for all scenarios -->
      <scenarioDampingParams>
        <!--Actuator damping parameters for all regions -->
        <scenario>
          <!--Actuator damping parameters -->
          <region>
            <!--Actuator damping step -->
            <dampingStep>0x3FF</dampingStep>
            <!--Actuator damping delay in micro seconds that must be applied after programming damping step -->
            <dampingDelayUs>1000</dampingDelayUs>
            <!--Actuator HW parameters -->
            <hwParams>0x0</hwParams>
          </region>
        </scenario>
      </scenarioDampingParams>
    </forwardDamping>
    <!--Actuator scenario ringing and damping information
        Damping parameters in backward / far direction -->
    <backwardDamping>
      <!--Actuator ringing scenario value -->
      <ringingScenario>400</ringingScenario>
      <!--Actuator damping parameters for all scenarios -->
      <scenarioDampingParams>
        <!--Actuator damping parameters for all regions -->
        <scenario>
          <!--Actuator damping parameters -->
          <region>
            <!--Actuator damping step -->
            <dampingStep>0x3FF</dampingStep>
            <!--Actuator damping delay in micro seconds that must be applied after programming damping step -->
            <dampingDelayUs>1000</dampingDelayUs>
            <!--Actuator HW parameters -->
            <hwParams>0x0</hwParams>
          </region>
        </scenario>
      </scenarioDampingParams>
    </backwardDamping>
  </tunedParams>
</actuatorDriver>

基本上,用到的Camera sensor的xml,需要根據實際情況進行配置:

  • 如果xml不存在,那麼需要在vendor/qcom/proprietary/chi-cdk/oem/qcom/actuator添加個一個xml的檔案。模組廠會給我們提供關於該顆sensor的相關文件,我們需要獲取的馬達相關資訊,也能從提供的文件中找到。

  • 如果sersor 用的馬達型號對應的xml已經有了,那基於初始配置就可以了。

根據實際硬體情況,只需要做少量的改動即可(甚至不需要)。

常見的改動有:

  • slaveAddress :i2c裝置地址。
  • i2cFrequencyMode:i2c速率。
  • 上下電時序需要根據資料手冊進行修改。

camera sensor配置

路徑:vendor/qcom/proprietary/chi-cdk/oem/qcom/module

這個目錄下,就是關於camera sensor的配置檔案了,關於某顆sensor的的詳細資訊,是在這邊進行建立新增的。

vendor/qcom/proprietary/chi-cdk/oem/qcom/module$ ls
altek1_imx577_module.xml            liteon_ov9282_master_module.xml   sunny_imx481_module.xml
altek2_imx577_module.xml            liteon_ov9282_slave_module.xml    sunny_imx519_module_talos.xml
...

同樣地,隨便開啟一個module配置:cat truly_s5k3p9sx_module.xml

<?xml version="1.0" encoding="utf-8" ?>
<!--========================================================================-->
<!-- Copyright (c) 2018 Qualcomm Technologies, Inc.                         -->
<!-- All Rights Reserved.                                                   -->
<!-- Confidential and Proprietary - Qualcomm Technologies, Inc.             -->
<!--========================================================================-->
<cameraModuleData
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation="..\..\cdk\sensor\camxmoduleconfig.xsd">
  <module_version major_revision="1" minor_revision="0" incr_revision="0"/>
    <!--Module group can contain either 1 module or 2 modules
      Dual camera, stereo camera use cases contain 2 modules in the group -->
  <moduleGroup>
    <!--Module configuration -->
    <moduleConfiguration description="Module configuration">
      <!--CameraId is the id to which DTSI node is mapped.
          Typically CameraId is the slot Id for non combo mode. -->
      <cameraId>0</cameraId>
      <!--Name of the module integrator -->
      <moduleName>truly</moduleName>
      <!--Name of the sensor in the image sensor module -->
      <sensorName>s5k3p9sx</sensorName>
      <!--Actuator name in the image sensor module
          This is an optional element. Skip this element if actuator is not present -->
      <actuatorName>dw9763</actuatorName>
      <oisName></oisName>
      <!--EEPROM name in the image sensor module
          This is an optional element. Skip this element if EEPROM is not present -->
      <!--eepromName>truly_gt24c64</eepromName-->
      <!--Flash name is used to used to open binary.
          Binary name is of form flashName_flash.bin Ex:- pmic_flash.bin -->
      <flashName>pmic</flashName>
      <!--Chromatix name is used to used to open binary.
          Binary name is of the form sensor_model_chromatix.bin -->
      <chromatixName>default</chromatixName>
      <!--Position of the sensor module.
          Valid values are: REAR, FRONT, REAR_AUX, FRONT_AUX, EXTERNAL -->
      <position>REAR</position>
      <!--CSI Information -->
      <CSIInfo description="CSI Information">
          <laneAssign>0x3210</laneAssign>
          <isComboMode>0</isComboMode>
      </CSIInfo>
      <!--Lens information -->
      <lensInfo description="Lens Information">
        <!--Focal length of the lens in millimeters. -->
        <focalLength>3.65</focalLength>
        <!--F-Number of the optical system. -->
        <fNumber>1.85</fNumber>
        <!--Minimum focus distance in meters. -->
        <minFocusDistance>0.1</minFocusDistance>
        <!--Total focus distance in meters. -->
        <maxFocusDistance>1.9</maxFocusDistance>
        <!--Horizontal view angle in degrees. -->
        <horizontalViewAngle>61.5</horizontalViewAngle>
        <!--Vertical view angle in degrees. -->
        <verticalViewAngle>46.05</verticalViewAngle>
        <!--Maximum Roll Degree. Valid values are: 0 to 359 -->
        <maxRollDegree>360</maxRollDegree>
        <!--Maximum Pitch Degree. Valid values are: 0, 90, 180, 270 -->
        <maxPitchDegree>360</maxPitchDegree>
        <!--Maximum Yaw Degree. Valid values are: 0 to 359 -->
        <maxYawDegree>360</maxYawDegree>
      </lensInfo>
      <!--pdafName>s5k3p9sx_pdaf</pdafName-->
    </moduleConfiguration>
  </moduleGroup>
</cameraModuleData>

如果是廠商會提供這樣的配置,那是最好,基本上不用怎麼修改,但如果是自己弄的話,就需要注意以下部分:

  • actuatorName:馬達名稱(例如dw9763),這個部分要和上面的actuator配置中的actuatorName匹配
  • cameraId:要和裝置樹匹配。
  • position:前後攝像頭等

編譯系統

上面的2個配置已經配好了,但是需要在這裡進行編輯才能夠編譯進驅動中。

yaml檔案

路徑: vendor/qcom/proprietary/chi-cdk/tools/buildbins

vendor/qcom/proprietary/chi-cdk/tools/buildbins$ ls
buildbins_bengal.yaml  buildbins_lito.yaml  buildbins_sm6150.yaml  linux64  win32
buildbins_kona.yaml    buildbins.py         buildbins.yaml         NOTICE   yaml

在Camx架構中,各個功能模組(每顆sensor的module和turning等模組),都可以編譯成各自獨立的so檔案。

修改某個模組的內容後,我們可以切到chi-cdk目錄下,進行mm編譯,編譯生成的對應so檔案在vendor/lib*/目錄下。

我們開啟其中一個yaml檔案,看下里面的內容:

sensor_drivers: 
- com.qti.sensormodule.truly_s5k3p9sx: 
- sensor/default/s5k3p9sx/s5k3p9sx_sensor.xml 
- sensor/default/s5k3p9sx/s5k3p9sx_pdaf.xml # 新增 
  - module/truly_s5k3p9sx_module.xml 
  - actuator/default/dw9763_actuator.xml    # 新增
- flash/back_sensor_flash.xml

...

mk檔案

路徑:vendor/qcom/proprietary/common/config/device-vendor.mk

確保對應的camera-sensor以及actuator編譯進:

...
MM_CAMERA += com.qti.sensor.s5k3p9sx
...
MM_CAMERA += com.qti.actuator.dw9763

裝置樹

在驅動框架、編譯系統都準備就緒以後,就要實際結合硬體來進行修改了,這部分的工作主要以配置引腳等屬性為主。

路徑:vendor/qcom/proprietary/devicetree-4.19/qcom/camera

根據版本不同,目錄略有差異,但類似,例如vendor/qcom/proprietary/camera-devicetree

camera-devicetree 這邊的dtsi檔案,配置的就是和camera上電相關的內容了, 修改了該目錄下的檔案後,我們需要編譯dtbo.img檔案來燒錄更新修改。

vendor/qcom/proprietary/camera-devicetree$ ls 
bengal-camera.dtsi             kona-camera-sensor-mtp.dtsi    lito-camera.dtsi
bengal-camera-sensor-idp.dtsi  kona-camera-sensor-qrd.dtsi    lito-camera-sensor-cdp.dtsi

camera.dtsi

我們開啟需要編譯的dtsi檔案,看下里面的內容:

/*
 * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */
&soc {
	led_flash_rear: qcom,camera-flash@0 {
		cell-index = <0>;
		reg = <0x00 0x00>;
		compatible = "qcom,camera-flash";
		flash-source = <&pmi8998_flash0 &pmi8998_flash1>;
		torch-source = <&pmi8998_torch0 &pmi8998_torch1>;
		switch-source = <&pmi8998_switch0>;
		status = "ok";
	};
	led_flash_rear_aux: qcom,camera-flash@1 {
		cell-index = <1>;
		reg = <0x01 0x00>;
		compatible = "qcom,camera-flash";
		flash-source = <&pmi8998_flash0 &pmi8998_flash1>;
		torch-source = <&pmi8998_torch0 &pmi8998_torch1>;
		switch-source = <&pmi8998_switch0>;
		status = "ok";
	};
	led_flash_front: qcom,camera-flash@2 {
		cell-index = <2>;
		reg = <0x02 0x00>;
		compatible = "qcom,camera-flash";
		flash-source = <&pmi8998_flash2>;
		torch-source = <&pmi8998_torch2>;
		switch-source = <&pmi8998_switch1>;
		status = "ok";
	};
	led_flash_iris: qcom,camera-flash@3 {
		cell-index = <3>;
		reg = <0x03 0x00>;
		compatible = "qcom,camera-flash";
		flash-source = <&pmi8998_flash2>;
		torch-source = <&pmi8998_torch2>;
		switch-source = <&pmi8998_switch2>;
		status = "ok";
	};
	actuator_regulator: gpio-regulator@0 {
		compatible = "regulator-fixed";
		reg = <0x00 0x00>;
		regulator-name = "actuator_regulator";
		regulator-min-microvolt = <2800000>;
		regulator-max-microvolt = <2800000>;
		regulator-enable-ramp-delay = <100>;
		enable-active-high;
		gpio = <&tlmm 93 0>;  /* 馬達對應的 pin*/
		vin-supply = <&pmi8998_bob>;
	};
	camera_rear_ldo: gpio-regulator@1 {
		compatible = "regulator-fixed";
		reg = <0x01 0x00>;
		regulator-name = "camera_rear_ldo";
		//regulator-min-microvolt = <1050000>;
		//regulator-max-microvolt = <1050000>;
		regulator-enable-ramp-delay = <135>;
		enable-active-high;
		gpio = <&pm8998_gpios 12 0>;
		pinctrl-names = "default";
		pinctrl-0 = <&camera_rear_dvdd_en_default>;
		//vin-supply = <&pm8998_s3>;
	};
	camera_ldo: gpio-regulator@2 {
		compatible = "regulator-fixed";
		reg = <0x02 0x00>;
		regulator-name = "camera_ldo";
		//regulator-min-microvolt = <1050000>;
		//regulator-max-microvolt = <1050000>;
		regulator-enable-ramp-delay = <233>;
		enable-active-high;
		gpio = <&pm8998_gpios 9 0>;
		pinctrl-names = "default";
		pinctrl-0 = <&camera_dvdd_en_default>;
		//vin-supply = <&pm8998_s3>;
	};
};

&cam_cci {
	qcom,cam-res-mgr {
		compatible = "qcom,cam-res-mgr";
		status = "ok";
	};
    
	actuator_rear: qcom,actuator@0 {
		cell-index = <0>;
		reg = <0x0>;
		compatible = "qcom,actuator";
		cci-master = <0>;
		cam_vaf-supply = <&actuator_regulator>;
		regulator-names = "cam_vaf";
		rgltr-cntrl-support;
		rgltr-min-voltage = <2800000>;
		rgltr-max-voltage = <2800000>;
		rgltr-load-current = <0>;
	};
    
	actuator_rear_aux: qcom,actuator@1 {
		cell-index = <1>;
		reg = <0x1>;
		compatible = "qcom,actuator";
		cci-master = <1>;
		cam_vaf-supply = <&actuator_regulator>;
		regulator-names = "cam_vaf";
		rgltr-cntrl-support;
		rgltr-min-voltage = <2800000>;
		rgltr-max-voltage = <2800000>;
		rgltr-load-current = <0>;
	};
    
	actuator_front: qcom,actuator@2 {
		cell-index = <2>;
		reg = <0x2>;
		compatible = "qcom,actuator";
		cci-master = <1>;
		cam_vaf-supply = <&actuator_regulator>;
		regulator-names = "cam_vaf";
		rgltr-cntrl-support;
		rgltr-min-voltage = <2800000>;
		rgltr-max-voltage = <2800000>;
		rgltr-load-current = <0>;
	};
    
	ois_rear: qcom,ois@0 {
		cell-index = <0>;
		reg = <0x0>;
		compatible = "qcom,ois";
		cci-master = <0>;
		cam_vaf-supply = <&actuator_regulator>;
		regulator-names = "cam_vaf";
		rgltr-cntrl-support;
		rgltr-min-voltage = <2800000>;
		rgltr-max-voltage = <2800000>;
		rgltr-load-current = <0>;
		status = "ok";
	};
    
	eeprom_rear: qcom,eeprom@0 {
		cell-index = <0>;
		reg = <0>;
		compatible = "qcom,eeprom";
		cam_vio-supply = <&pm8998_lvs1>;
		cam_vana-supply = <&pmi8998_bob>;
		cam_vdig-supply = <&camera_rear_ldo>;
		cam_clk-supply = <&titan_top_gdsc>;
		cam_vaf-supply = <&actuator_regulator>;
		regulator-names = "cam_vio", "cam_vana", "cam_vdig",
						  "cam_clk", "cam_vaf";
		rgltr-cntrl-support;
		rgltr-min-voltage = <0 3312000 1050000 0 2800000>;
		rgltr-max-voltage = <0 3600000 1050000 0 2800000>;
		rgltr-load-current = <0 80000 105000 0 0>;
		gpio-no-mux = <0>;
		pinctrl-names = "cam_default", "cam_suspend";
		pinctrl-0 = <&cam_sensor_mclk0_active
					 &cam_sensor_rear_active>;
		pinctrl-1 = <&cam_sensor_mclk0_suspend
					 &cam_sensor_rear_suspend>;
		gpios = <&tlmm 13 0>,
				<&tlmm 80 0>,
				<&tlmm 79 0>;
		gpio-reset = <1>;
		gpio-vana = <2>;
		gpio-req-tbl-num = <0 1 2>;
		gpio-req-tbl-flags = <1 0 0>;
		gpio-req-tbl-label = "CAMIF_MCLK0",
							 "CAM_RESET0",
							 "CAM_VANA0";
		sensor-position = <0>;
		sensor-mode = <0>;
		cci-master = <0>;
		status = "ok";
		clocks = <&clock_camcc CAM_CC_MCLK0_CLK>;
		clock-names = "cam_clk";
		clock-cntl-level = "turbo";
		clock-rates = <24000000>;
	};
    
	eeprom_rear_aux: qcom,eeprom@1 {
		cell-index = <1>;
		reg = <0x1>;
		compatible = "qcom,eeprom";
		cam_vdig-supply = <&camera_ldo>;
		cam_vio-supply = <&pm8998_lvs1>;
		cam_vana-supply = <&pmi8998_bob>;
		cam_clk-supply = <&titan_top_gdsc>;
		cam_vaf-supply = <&actuator_regulator>;
		regulator-names = "cam_vdig", "cam_vio", "cam_vana",
						  "cam_clk", "cam_vaf";
		rgltr-cntrl-support;
		rgltr-min-voltage = <1050000 0 3312000 0 2800000>;
		rgltr-max-voltage = <1050000 0 3600000 0 2800000>;
		rgltr-load-current = <105000 0 80000 0 0>;
		gpio-no-mux = <0>;
		pinctrl-names = "cam_default", "cam_suspend";
		pinctrl-0 = <&cam_sensor_mclk2_active
				 	 &cam_sensor_rear2_active>;
		pinctrl-1 = <&cam_sensor_mclk2_suspend
					 &cam_sensor_rear2_suspend>;
		gpios = <&tlmm 15 0>,
					<&tlmm 9 0>,
					<&tlmm 8 0>;
		gpio-reset = <1>;
		gpio-vana = <2>;
		gpio-req-tbl-num = <0 1 2>;
		gpio-req-tbl-flags = <1 0 0>;
		gpio-req-tbl-label = "CAMIF_MCLK1",
							 "CAM_RESET1",
							 "CAM_VANA1";
		sensor-position = <0>;
		sensor-mode = <0>;
		cci-master = <1>;
		status = "ok";
		clocks = <&clock_camcc CAM_CC_MCLK2_CLK>;
		clock-names = "cam_clk";
		clock-cntl-level = "turbo";
		clock-rates = <24000000>;
	};
    
	eeprom_front: qcom,eeprom@2 {
		cell-index = <2>;
		reg = <0x2>;
		compatible = "qcom,eeprom";
		cam_vio-supply = <&pm8998_lvs1>;
		cam_vana-supply = <&pmi8998_bob>;
		cam_vdig-supply = <&camera_ldo>;
		cam_clk-supply = <&titan_top_gdsc>;
		cam_vaf-supply = <&actuator_regulator>;
		regulator-names = "cam_vio", "cam_vana", "cam_vdig",
						  "cam_clk", "cam_vaf";
		rgltr-cntrl-support;
		rgltr-min-voltage = <0 3312000 1050000 0 2800000>;
		rgltr-max-voltage = <0 3600000 1050000 0 2800000>;
		rgltr-load-current = <0 80000 105000 0 0>;
		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 14 0>,
				<&tlmm 28 0>,
				<&tlmm 8 0>;
		gpio-reset = <1>;
		gpio-vana = <2>;
		gpio-req-tbl-num = <0 1 2>;
		gpio-req-tbl-flags = <1 0 0>;
		gpio-req-tbl-label = "CAMIF_MCLK2",
						 	 "CAM_RESET2",
							 "CAM_VANA2";
		sensor-position = <1>;
		sensor-mode = <0>;
		cci-master = <1>;
		status = "ok";
		clocks = <&clock_camcc CAM_CC_MCLK1_CLK>;
		clock-names = "cam_clk";
		clock-cntl-level = "turbo";
		clock-rates = <24000000>;
	};
    
	qcom,cam-sensor@0 { // 後置攝像頭
		cell-index = <0>;
		compatible = "qcom,cam-sensor";
		reg = <0x0>;
		csiphy-sd-index = <0>;
		sensor-position-roll = <270>;
		sensor-position-pitch = <0>;
		sensor-position-yaw = <180>;
        /* 如果用到了閃光燈、馬達;則需要對應有關的節點。*/
		led-flash-src = <&led_flash_rear>;
		actuator-src = <&actuator_rear>; 
		//ois-src = <&ois_rear>;
		//eeprom-src = <&eeprom_rear>;
		cam_vio-supply = <&pm8998_lvs1>;
		//cam_vana-supply = <&camera_vana_ldo>;
		cam_vdig-supply = <&camera_rear_ldo>;
		cam_clk-supply = <&titan_top_gdsc>;
		regulator-names = "cam_vio","cam_vdig", "cam_clk";
		rgltr-cntrl-support;
		rgltr-min-voltage = <0 1050000 0>;
		rgltr-max-voltage = <0 1050000 0>;
		rgltr-load-current = <0 105000 0>;
		gpio-no-mux = <0>;
		pinctrl-names = "cam_default", "cam_suspend";
		pinctrl-0 = <&cam_sensor_mclk0_active
					 &cam_sensor_rear_active>;
		pinctrl-1 = <&cam_sensor_mclk0_suspend
					 &cam_sensor_rear_suspend>;
		gpios = <&tlmm 13 0>,
				<&tlmm 9 0>,
				<&tlmm 26 0>,
				<&tlmm 8 0>;
		gpio-reset = <1>;
		gpio-standby = <2>;
		gpio-custom1 = <3>; //vana
		gpio-req-tbl-num = <0 1 2 3>;
		gpio-req-tbl-flags = <1 0 0 0>;
		gpio-req-tbl-label = "CAMIF_MCLK0",
							 "CAM_RESET0",
							 "CAM_STANDBY0",
							 "CAM_CUSTOM1";
		sensor-mode = <0>;
		cci-master = <0>;
		status = "ok";
		clocks = <&clock_camcc CAM_CC_MCLK0_CLK>;
		clock-names = "cam_clk";
		clock-cntl-level = "turbo";
		clock-rates = <24000000>;
	};
    
    qcom,cam-sensor@1 { // 前置攝像頭
		cell-index = <1>;
		compatible = "qcom,cam-sensor";
		reg = <0x1>;
		csiphy-sd-index = <1>;
		sensor-position-roll = <270>;
		sensor-position-pitch = <0>;
		sensor-position-yaw = <0>;
        /* 如果用到了閃光燈、馬達;則需要對應有關的節點。*/
		//actuator-src = <&actuator_front>;
		led-flash-src = <&led_flash_front>;
		//eeprom-src = <&eeprom_front>;
		cam_vdig-supply = <&camera_ldo>;
		cam_vio-supply = <&pm8998_lvs1>;
		//cam_vana-supply = <&camera_vana_ldo>;
		cam_clk-supply = <&titan_top_gdsc>;
		regulator-names = "cam_vdig", "cam_vio", "cam_clk";
		rgltr-cntrl-support;
		rgltr-min-voltage = <1050000 0 0>;
		rgltr-max-voltage = <1050000 0 0>;
		rgltr-load-current = <105000 0 0>;
		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 14 0>,
				<&tlmm 7 0>,
				<&tlmm 40 0>,
				<&tlmm 84 0>;
		gpio-reset = <1>;
		gpio-standby = <2>;
		gpio-custom1 = <3>; //vana
		gpio-req-tbl-num = <0 1 2 3>;
		gpio-req-tbl-flags = <1 0 0 0>;
		gpio-req-tbl-label = "CAMIF_MCLK1",
							 "CAM_RESET1",
							 "CAM_STANDBY1",
							 "CAM_CUSTOM1";
		sensor-mode = <0>;
		cci-master = <1>;
		status = "ok";
		clocks = <&clock_camcc CAM_CC_MCLK1_CLK>;
		clock-names = "cam_clk";
		clock-cntl-level = "turbo";
		clock-rates = <24000000>;
	};
    
    //...
};