当前位置: 首页 > 工具软件 > Focal Camera > 使用案例 >

SDM660 camera bringup指南

越风史
2023-12-01


前言

基于mm-camera 架构的老平台camera移植指南。

1.首先根据原理图我们知道调试camera需要了解一下信息,以后摄为例:
CCI(I2c0)
MIPI(CSI0)
MCLK (MCLK0)
三路供电(AVDD DVDD IOVDD),对于大部分camera来说只要电供上就可以了,没有严格的时序要求,如果读不到ID,需要检查上电时序以及I2c地址。
AF(供电)
flash (闪光灯一般PMIC控制,参考平台添加即可)

2.所以根据原理图我们了解到以下信息:

后摄:
mipi 0
cci 0
clk0-32
rst-46
pwd-44

avdd-72(共用)
dvdd- pm660 -gpio4
iovdd  (sensor使用的1.8,长供不用管,共用)

AF-pm660l gpio3(共用)



后摄1:
cci1
mipi1
clk1-33
rst-48
pwd-55

avdd-72
dvdd-45



前摄:
cci1
mipi 2
clk2-34
rst-47
pwd-50

avdd-72
dvdd- pm660 gpio4

一、添加设备树配置

kernel/msm-4.14/arch/arm64/boot/dts/qcom/sdm660-camera-sensor-qrd.dtsi
/*
 * Copyright (c) 2017, 2019-2020 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_flash0: qcom,camera-flash@0 {
		cell-index = <0>;
		compatible = "qcom,camera-flash";
		qcom,flash-source = <&pm660l_flash0 &pm660l_flash1>;
		qcom,torch-source = <&pm660l_torch0 &pm660l_torch1>;
		qcom,switch-source = <&pm660l_switch0>;
		status = "ok";
	};

	led_flash1: qcom,camera-flash@1 {
		cell-index = <1>;
		compatible = "qcom,camera-flash";
		qcom,flash-source = <&pm660l_flash2>;
		qcom,torch-source = <&pm660l_torch2>;
		qcom,switch-source = <&pm660l_switch1>;
		status = "ok";
	};

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

	cam_vaf_gpio_regulator:cam_vaf_fixed_regulator {
		compatible = "regulator-fixed";
		regulator-name = "cam_vaf_gpio_regulator";
		regulator-min-microvolt = <3600000>;
		regulator-max-microvolt = <3600000>;
		enable-active-high;
		//gpio = <&tlmm 50 0>;
		//gpio = <&pm660l_gpios 3 0>;
		vin-supply = <&pm660l_bob>;
	};

	cam_rear_dvdd_gpio_regulator: cam_rear_dvdd_fixed_regulator {
		compatible = "regulator-fixed";
		regulator-name = "cam_rear_dvdd_gpio_regulator";
		regulator-min-microvolt = <1350000>;
		regulator-max-microvolt = <1350000>;
		enable-active-high;
		gpio = <&pm660l_gpios 4 0>;
		pinctrl-names = "default";
		pinctrl-0 = <&cam_sensor_eldo4_default>;
		vin-supply = <&pm660_s5>;
	};
};

&tlmm {
	cam_sensor_rear_active: cam_sensor_rear_active {
		/* RESET */
		mux {
			pins = "gpio46","gpio44","gpio72";
			function = "gpio";
		};

		config {
			pins = "gpio46","gpio44","gpio72";
			bias-disable; /* No PULL */
			drive-strength = <2>; /* 2 MA */
		};
	};

	cam_sensor_rear_suspend: cam_sensor_rear_suspend {
		/* RESET */
		mux {
			pins = "gpio46","gpio44";
			function = "gpio";
		};

		config {
			pins = "gpio46","gpio44";
			bias-disable; /* No PULL */
			drive-strength = <2>; /* 2 MA */
		};
	};

	cam_sensor_rear2_active: cam_sensor_rear2_active {
		/* RESET */
		mux {
			pins = "gpio45","gpio48","gpio55","gpio72";
			function = "gpio";
		};

		config {
			pins = "gpio45","gpio48","gpio55","gpio72";
			bias-disable; /* No PULL */
			drive-strength = <2>; /* 2 MA */
		};
	};

	cam_sensor_rear2_suspend: cam_sensor_rear2_suspend {
		/* RESET */
		mux {
			pins = "gpio45","gpio48","gpio55";
			function = "gpio";
		};

		config {
			pins = "gpio45","gpio48","gpio55";
			bias-disable; /* No PULL */
			drive-strength = <2>; /* 2 MA */
		};
	};

	cam_sensor_front_active: cam_sensor_front_active {
		/* RESET */
		mux {
			pins = "gpio47","gpio50","gpio72";
			function = "gpio";
		};

		config {
			pins = "gpio47","gpio50","gpio72";
			bias-disable; /* No PULL */
			drive-strength = <2>; /* 2 MA */
		};
	};

	cam_sensor_front_suspend: cam_sensor_front_suspend {
		/* RESET */
		mux {
			pins = "gpio47";
			function = "gpio";
		};

		config {
			pins = "gpio47";
			bias-disable; /* No PULL */
			drive-strength = <2>; /* 2 MA */
		};
	};
};

&pm660_gpios {
	cam_sensor_rear_dvd4 {
		cam_sensor_dvd4_default: cam_sensor_dvd4_default {
			pins = "gpio4";
			function = "normal";
			output-high;
			bias-disable;
		};
	};
	
};

&cci {
	actuator0: qcom,actuator@0 {
		cell-index = <0>;
		reg = <0x0>;
		compatible = "qcom,actuator";
		qcom,cci-master = <0>;
		cam_vaf-supply = <&cam_vaf_gpio_regulator>;
		qcom,cam-vreg-name = "cam_vaf";
		qcom,cam-vreg-min-voltage = <3600000>;
		qcom,cam-vreg-max-voltage = <3600000>;
		qcom,cam-vreg-op-mode = <0>;
	};

	actuator1: qcom,actuator@1 {
		cell-index = <1>;
		reg = <0x1>;
		compatible = "qcom,actuator";
		qcom,cci-master = <1>;
		cam_vaf-supply = <&cam_vaf_gpio_regulator>;
		qcom,cam-vreg-name = "cam_vaf";
		qcom,cam-vreg-min-voltage = <3600000>;
		qcom,cam-vreg-max-voltage = <3600000>;
		qcom,cam-vreg-op-mode = <0>;
	};

	qcom,camera@0 {
		cell-index = <0>;
		compatible = "qcom,camera";
		reg = <0x0>;
		qcom,csiphy-sd-index = <0>;
		qcom,csid-sd-index = <0>;
		qcom,mount-angle = <90>;
		qcom,led-flash-src = <&led_flash0>;
		qcom,actuator-src = <&actuator0>;
		cam_vio-supply = <&pm660_l11>;
		cam_vana-supply = <&pm660l_bob>;
		cam_vdig-supply = <&pm660_s5>;
		qcom,cam-vreg-name = "cam_vio", "cam_vana", "cam_vdig";
		qcom,cam-vreg-min-voltage = <1780000 3300000 1350000>;
		qcom,cam-vreg-max-voltage = <1950000 3300000 1350000>;
		qcom,cam-vreg-op-mode = <105000 80000 105000>;
		qcom,gpio-no-mux = <0>;
		pinctrl-names = "cam_default", "cam_suspend";
		pinctrl-0 = <&cam_sensor_mclk0_active
				 &cam_sensor_rear_active
				 &cam_sensor_dvd4_default>;
		pinctrl-1 = <&cam_sensor_mclk0_suspend
				 &cam_sensor_rear_suspend>;
		gpios = <&tlmm 32 0>, 
			<&tlmm 46 0>, 
			<&tlmm 44 0>, 
			<&tlmm 72 0>, 
			<&pm660_gpios 4 0>;
		qcom,gpio-reset = <1>;
		qcom,gpio-standby = <2>;
		qcom,gpio-vana = <3>;
		qcom,gpio-vdig = <4>;
		qcom,gpio-req-tbl-num = <0 1 2 3 4>;
		qcom,gpio-req-tbl-flags = <1 0 0 0 0>;
		qcom,gpio-req-tbl-label = "CAMIF_MCLK0",
					"CAM_RESET0",
					"CAM_STANDBY0",
					"CAM_VANA",
					"CAM_VDIG";
		qcom,sensor-position = <0>;
		qcom,sensor-mode = <0>;
		qcom,cci-master = <0>;
		status = "ok";
		clocks = <&clock_mmss MCLK0_CLK_SRC>,
				<&clock_mmss MMSS_CAMSS_MCLK0_CLK>;
		clock-names = "cam_src_clk", "cam_clk";
		qcom,clock-rates = <24000000 0>;
	};

	qcom,camera@1 {
		cell-index = <1>;
		compatible = "qcom,camera";
		reg = <0x1>;
		qcom,csiphy-sd-index = <1>;
		qcom,csid-sd-index = <1>;
		qcom,mount-angle = <90>;
		qcom,led-flash-src = <&led_flash0>;
		qcom,actuator-src = <&actuator1>;
		cam_vio-supply = <&pm660_l11>;
		cam_vana-supply = <&pm660l_bob>;
		cam_vdig-supply = <&pm660_s5>;
		qcom,cam-vreg-name = "cam_vio", "cam_vana", "cam_vdig";
		qcom,cam-vreg-min-voltage = <1780000 3300000 1350000>;
		qcom,cam-vreg-max-voltage = <1950000 3300000 1350000>;
		qcom,cam-vreg-op-mode = <105000 80000 105000>;
		qcom,gpio-no-mux = <0>;
		pinctrl-names = "cam_default", "cam_suspend";
		pinctrl-0 = <&cam_sensor_mclk1_active
				 &cam_sensor_rear2_active>;
		pinctrl-1 = <&cam_sensor_mclk1_suspend
				 &cam_sensor_rear2_suspend>;
		gpios = <&tlmm 33 0>,
			<&tlmm 48 0>,
			<&tlmm 55 0>,
			<&tlmm 72 0>,
			<&tlmm 45 0>;
		qcom,gpio-reset = <1>;
		qcom,gpio-standby = <2>;
		qcom,gpio-vana = <3>;
		qcom,gpio-vdig = <4>;
		qcom,gpio-req-tbl-num = <0 1 2 3 4>;
		qcom,gpio-req-tbl-flags = <1 0 0 0 0>;
		qcom,gpio-req-tbl-label = "CAMIF_MCLK1",
					"CAM_RESET1",
					"CAM_STANDBY1",
					"CAM_VANA",
					"CAM_VDIG";
		qcom,sensor-position = <0>;
		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>;
	};

	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,led-flash-src = <&led_flash0>;
		cam_vio-supply = <&pm660_l11>;
		cam_vana-supply = <&pm660l_bob>;
		cam_vdig-supply = <&pm660_s5>;
		qcom,cam-vreg-name = "cam_vio", "cam_vana", "cam_vdig";
		qcom,cam-vreg-min-voltage = <1780000 3300000 1350000>;
		qcom,cam-vreg-max-voltage = <1950000 3300000 1350000>;
		qcom,cam-vreg-op-mode = <105000 80000 105000>;
		qcom,gpio-no-mux = <0>;
		pinctrl-names = "cam_default", "cam_suspend";
		pinctrl-0 = <&cam_sensor_mclk2_active
				 &cam_sensor_front_active
				&cam_sensor_dvd4_default>;
		pinctrl-1 = <&cam_sensor_mclk2_suspend
				 &cam_sensor_front_suspend>;
		gpios = <&tlmm 34 0>,
			<&tlmm 47 0>,
			<&tlmm 50 0>,
			<&tlmm 72 0>,
			<&pm660_gpios 4 0>;
		qcom,gpio-reset = <1>;
		qcom,gpio-standby = <2>;
		qcom,gpio-vana = <3>;
		qcom,gpio-vdig = <4>;
		qcom,gpio-req-tbl-num = <0 1 2 3 4>;
		qcom,gpio-req-tbl-flags = <1 0 0 0 0>;
		qcom,gpio-req-tbl-label = "CAMIF_MCLK2",
					"CAM_RESET2",
					"CAM_STANDBY2",
					"CAM_VANA",
					"CAM_VDIG";
		qcom,sensor-position = <1>;
		qcom,sensor-mode = <0>;
		qcom,cci-master = <1>;
		status = "ok";
		clocks = <&clock_mmss MCLK2_CLK_SRC>,
			<&clock_mmss MMSS_CAMSS_MCLK2_CLK>;
		clock-names = "cam_src_clk", "cam_clk";
		qcom,clock-rates = <24000000 0>;
	};
};

&pm660l_gpios {
	cam_sensor_eldo3 {
		cam_sensor_eldo3_default: cam_sensor_eldo3_default {
			pins = "gpio3";
			function = "normal";
			output-high;
			bias-disable;
		};
	};
	cam_sensor_eldo4 {
		cam_sensor_eldo4_default: cam_sensor_eldo4_default {
			pins = "gpio4";
			function = "normal";
			output-low;
			bias-disable;
		};
	};
};

需要注意的是,要把被踩到的GPIO注释掉。

二、添加驱动配置

1.添加驱动以及配置

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

MM_CAMERA += libchromatix_s5k3m2xx_4k_video_ad5816g
#add start
MM_CAMERA += libchromatix_s5k4h7yx_a3_default_video
MM_CAMERA += libchromatix_s5k4h7yx_a3_hfr_60
MM_CAMERA += libchromatix_s5k4h7yx_a3_hfr_120
MM_CAMERA += libchromatix_s5k4h7yx_a3_default_preview
MM_CAMERA += libchromatix_s5k4h7yx_a3_zsl_video
MM_CAMERA += libchromatix_s5k4h7yx_a3_hfr_90
MM_CAMERA += libchromatix_s5k4h7yx_a3_zsl_preview
MM_CAMERA += libchromatix_s5k4h7yx_common
MM_CAMERA += libchromatix_s5k4h7yx_postproc
MM_CAMERA += libchromatix_s5k4h7yx_cpp_video
MM_CAMERA += libchromatix_s5k4h7yx_cpp_hfr_60
MM_CAMERA += libchromatix_s5k4h7yx_cpp_preview
MM_CAMERA += libchromatix_s5k4h7yx_cpp_hfr_90
MM_CAMERA += libchromatix_s5k4h7yx_cpp_hfr_120
MM_CAMERA += libchromatix_s5k4h7yx_cpp_us_chromatix
MM_CAMERA += libchromatix_s5k4h7yx_cpp_snapshot
MM_CAMERA += libchromatix_s5k4h7yx_cpp_liveshot
MM_CAMERA += libchromatix_s5k4h7yx_cpp_ds_chromatix
MM_CAMERA += libchromatix_s5k4h7yx_snapshot
MM_CAMERA += libchromatix_s5k4h7yx_liveshot
MM_CAMERA += libchromatix_s5k4h7yx_hfr_60
MM_CAMERA += libchromatix_s5k4h7yx_hfr_120
MM_CAMERA += libchromatix_s5k4h7yx_default_video
MM_CAMERA += libchromatix_s5k4h7yx_hfr_90
MM_CAMERA += libchromatix_s5k4h7yx_preview
MM_CAMERA += libchromatix_s5k5e8_sa50_a3_default_video
MM_CAMERA += libchromatix_s5k5e8_sa50_a3_hfr_60
MM_CAMERA += libchromatix_s5k5e8_sa50_a3_hfr_120
MM_CAMERA += libchromatix_s5k5e8_sa50_a3_default_preview
MM_CAMERA += libchromatix_s5k5e8_sa50_a3_zsl_video
MM_CAMERA += libchromatix_s5k5e8_sa50_a3_hfr_90
MM_CAMERA += libchromatix_s5k5e8_sa50_a3_zsl_preview
MM_CAMERA += libchromatix_s5k5e8_sa50_common
MM_CAMERA += libchromatix_s5k5e8_sa50_postproc
MM_CAMERA += libchromatix_s5k5e8_sa50_cpp_video
MM_CAMERA += libchromatix_s5k5e8_sa50_cpp_hfr_60
MM_CAMERA += libchromatix_s5k5e8_sa50_cpp_preview
MM_CAMERA += libchromatix_s5k5e8_sa50_cpp_hfr_90
MM_CAMERA += libchromatix_s5k5e8_sa50_cpp_hfr_120
MM_CAMERA += libchromatix_s5k5e8_sa50_cpp_us_chromatix
MM_CAMERA += libchromatix_s5k5e8_sa50_cpp_snapshot
MM_CAMERA += libchromatix_s5k5e8_sa50_cpp_liveshot
MM_CAMERA += libchromatix_s5k5e8_sa50_cpp_ds_chromatix
MM_CAMERA += libchromatix_s5k5e8_sa50_snapshot
MM_CAMERA += libchromatix_s5k5e8_sa50_liveshot
MM_CAMERA += libchromatix_s5k5e8_sa50_hfr_60
MM_CAMERA += libchromatix_s5k5e8_sa50_hfr_120
MM_CAMERA += libchromatix_s5k5e8_sa50_default_video
MM_CAMERA += libchromatix_s5k5e8_sa50_hfr_90
MM_CAMERA += libchromatix_s5k5e8_sa50_preview
#add end
MM_CAMERA += libchromatix_s5k3m2xm_common
MM_CAMERA += libchromatix_s5k3m2xm_cpp_hfr_120
MM_CAMERA += libchromatix_s5k3m2xm_cpp_hfr_60
MM_CAMERA += libchromatix_s5k3m2xm_cpp_hfr_90
MM_CAMERA += libchromatix_s5k3m2xm_cpp_liveshot
MM_CAMERA += libchromatix_s5k3m2xm_cpp_preview
MM_CAMERA += libchromatix_s5k3m2xm_cpp_snapshot
MM_CAMERA += libchromatix_s5k3m2xm_cpp_video
MM_CAMERA += libchromatix_s5k3m2xm_default_preview_dw9761b
MM_CAMERA += libchromatix_s5k3m2xm_default_video
MM_CAMERA += libchromatix_s5k3m2xm_default_video_dw9761b
MM_CAMERA += libchromatix_s5k3m2xm_hfr_120
MM_CAMERA += libchromatix_s5k3m2xm_hfr_120_dw9761b
MM_CAMERA += libchromatix_s5k3m2xm_hfr_60
MM_CAMERA += libchromatix_s5k3m2xm_hfr_60_dw9761b
MM_CAMERA += libchromatix_s5k3m2xm_hfr_90
MM_CAMERA += libchromatix_s5k3m2xm_hfr_90_dw9761b
MM_CAMERA += libchromatix_s5k3m2xm_liveshot
MM_CAMERA += libchromatix_s5k3m2xm_postproc
MM_CAMERA += libchromatix_s5k3m2xm_preview
MM_CAMERA += libchromatix_s5k3m2xm_snapshot
MM_CAMERA += libchromatix_s5k3m2xm_zsl_preview_dw9761b




MM_CAMERA += libmmcamera_s5k3l8_mono
MM_CAMERA += libmmcamera_s5k2l7
MM_CAMERA += libmmcamera_s5k2l7sx
MM_CAMERA += libmmcamera_s5k3p8sp
MM_CAMERA += libmmcamera_ov5670
MM_CAMERA += libmmcamera_imx298
MM_CAMERA += libmmcamera_imx378
MM_CAMERA += libois_bu63165
MM_CAMERA += libmmcamera_pdaf
MM_CAMERA += libmmcamera_pdafcamif
MM_CAMERA += libmmcamera_plugin
MM_CAMERA += libmmcamera_SKUAA_ST_gc0339
MM_CAMERA += libmmcamera_skuab_shinetech_gc0339
MM_CAMERA += libmmcamera_SKUAB_ST_s5k4e1
MM_CAMERA += libmmcamera_s5k3m2xx
#add  start
MM_CAMERA += libmmcamera_s5k4h7_sa80
MM_CAMERA += libmmcamera_s5k5e8_sa50
#add end
MM_CAMERA += libmmcamera_S5K4E1_13P1BA
MM_CAMERA += libmmcamera_skuf_ov12830_p12v01c
MM_CAMERA += libmmcamera_skuf_ov5648_p5v23c
MM_CAMERA += libmmcamera_sp1628
MM_CAMERA += libmmcamera_statsproc31
MM_CAMERA += libmmcamera_stillmore_lib
MM_CAMERA += libmmcamera_ofilm_oty5f03_eeprom
MM_CAMERA += libmmcamera_sunny_q13v04b_eeprom
MM_CAMERA += libmmcamera_ofilm_ohs0443_ov12a10_eeprom
MM_CAMERA += libmmcamera_ofilm_ohs0443_ov13880_eeprom
MM_CAMERA += libmmcamera_sonyimx135_eeprom
MM_CAMERA += libmmcamera_sunny_ov13855_eeprom
MM_CAMERA += libmmcamera_sunny_gt24c64_s5k2l7sx_eeprom
MM_CAMERA += libmmcamera_sunny_p12v01m_eeprom
MM_CAMERA += libmmcamera_sunny_p5v23c_eeprom
MM_CAMERA += libmmcamera_sunny_q8v18a_eeprom
MM_CAMERA += libmmcamera_sunny_ov8858_q8v19w_eeprom
MM_CAMERA += libmmcamera_sunny_q5v41b_eeprom
MM_CAMERA += libmmcamera_sunny_q5v22e_eeprom
MM_CAMERA += libmmcamera_sunny_gt24c64_s5k2l7_eeprom
MM_CAMERA += libmmcamera_sunny_gt24c64_s5k2l7sx_eeprom
MM_CAMERA += libmmcamera_sunny_gt24c64_imx298_eeprom
MM_CAMERA += libmmcamera_target
MM_CAMERA += libmmcamera_trueportrait_lib



MM_CAMERA += s5k3m3sm_chromatix.xml
MM_CAMERA += s5k2l7_8953_chromatix.xml
MM_CAMERA += ov13850_q13v06k_chromatix.xml
MM_CAMERA += s5k3m2xm_chromatix.xml
MM_CAMERA += s5k3m2xm_chromatix_bear.xml
MM_CAMERA += s5k3m2xx_chromatix.xml
#add  start
MM_CAMERA += s5k4h7_sa80_chromatix.xml
MM_CAMERA += s5k5e8_sa50_chromatix.xml
#add  end
MM_CAMERA += s5k3p3sm_chromatix.xml
MM_CAMERA += sensors.hal.tof

添加供应商或者官网下载的驱动:
添加效果:
vendor/qcom/proprietary/mm-camera/mm-camera2/media-controller/modules/sensors/chromatix/0310/chromatix_s5k4h7_sa80/
添加驱动:
vendor/qcom/proprietary/mm-camera/mm-camera2/media-controller/modules/sensors/sensor/libs/s5k4h7_sa80/
添加配置:
vendor/qcom/proprietary/mm-camera/mm-camera2/media-controller/modules/sensors/configs/s5k4h7_sa80_chromatix.xml

vendor/qcom/proprietary/mm-camera/mm-camera2/media-controller/modules/sensors/configs/sdm660_camera.xml
这个文件就很重要了,比如这里前两个配置0-s5k3m2xx为后摄,2-s5k5e8_sa50为前摄;那么此时打开的就是这两个摄像头。如果前两个配置的是2-s5k5e8_sa50,1-s5k4h7_sa80,那么打开的就是这两个摄像头。注意camera-id 0 1 2;其实对应的是设备树里不同的cell-index;对应板子上就是不同位置的camera,比如前摄位置,后摄位置,后辅摄位置。

<CameraConfigurationRoot>
    <CameraModuleConfig>
    <CameraId>0</CameraId>
    <SensorName>s5k3m2xx</SensorName>
    <ActuatorName>dw9714</ActuatorName>
    <FlashName>pmic</FlashName>
    <ChromatixName>s5k3m2xx_chromatix</ChromatixName>
    <ModesSupported>1</ModesSupported>
    <Position>BACK</Position>
    <MountAngle>90</MountAngle>
    <CSIInfo>
      <CSIDCore>0</CSIDCore>
      <LaneMask>0x1F</LaneMask>
      <LaneAssign>0x4320</LaneAssign>
      <ComboMode>0</ComboMode>
    </CSIInfo>
    <LensInfo>
      <FocalLength>3.47</FocalLength>
      <FNumber>2.2</FNumber>
      <TotalFocusDistance>1.9</TotalFocusDistance>
      <HorizontalViewAngle>63.84</HorizontalViewAngle>
      <VerticalViewAngle>47.88</VerticalViewAngle>
      <MinFocusDistance>0.1</MinFocusDistance>
    </LensInfo>
  </CameraModuleConfig>
  <CameraModuleConfig>
    <CameraId>2</CameraId>
    <SensorName>s5k5e8_sa50</SensorName>
    <FlashName>pmic</FlashName>
    <ChromatixName>s5k5e8_sa50_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>3.47</FocalLength>
      <FNumber>2.2</FNumber>
      <TotalFocusDistance>1.9</TotalFocusDistance>
      <HorizontalViewAngle>63.84</HorizontalViewAngle>
      <VerticalViewAngle>47.88</VerticalViewAngle>
      <MinFocusDistance>0.1</MinFocusDistance>
    </LensInfo>
  </CameraModuleConfig>
  <CameraModuleConfig>
    <CameraId>1</CameraId>
    <SensorName>s5k3m2xx</SensorName>
    <ActuatorName>dw9714</ActuatorName>
    <FlashName>pmic</FlashName>
    <ChromatixName>s5k3m2xx_chromatix</ChromatixName>
    <ModesSupported>1</ModesSupported>
    <Position>BACK</Position>
    <MountAngle>90</MountAngle>
    <CSIInfo>
      <CSIDCore>1</CSIDCore>
      <LaneMask>0x1F</LaneMask>
      <LaneAssign>0x4320</LaneAssign>
      <ComboMode>0</ComboMode>
    </CSIInfo>
    <LensInfo>
      <FocalLength>3.47</FocalLength>
      <FNumber>2.2</FNumber>
      <TotalFocusDistance>1.9</TotalFocusDistance>
      <HorizontalViewAngle>63.84</HorizontalViewAngle>
      <VerticalViewAngle>47.88</VerticalViewAngle>
      <MinFocusDistance>0.1</MinFocusDistance>
    </LensInfo>
  </CameraModuleConfig>
  <CameraModuleConfig>
    <CameraId>1</CameraId>
    <SensorName>s5k4h7_sa80</SensorName>
    <ActuatorName>dw9714</ActuatorName>
    <FlashName>pmic</FlashName>
    <ChromatixName>s5k4h7_sa80_chromatix</ChromatixName>
    <ModesSupported>1</ModesSupported>
    <Position>BACK</Position>
    <MountAngle>90</MountAngle>
    <CSIInfo>
      <CSIDCore>1</CSIDCore>
      <LaneMask>0x1F</LaneMask>
      <LaneAssign>0x4320</LaneAssign>
      <ComboMode>0</ComboMode>
    </CSIInfo>
    <LensInfo>
      <FocalLength>3.47</FocalLength>
      <FNumber>2.2</FNumber>
      <TotalFocusDistance>1.9</TotalFocusDistance>
      <HorizontalViewAngle>63.84</HorizontalViewAngle>
      <VerticalViewAngle>47.88</VerticalViewAngle>
      <MinFocusDistance>0.1</MinFocusDistance>
    </LensInfo>
  </CameraModuleConfig>
  <CameraModuleConfig>
    <CameraId>0</CameraId>
    <SensorName>s5k4h7_sa80</SensorName>
    <ActuatorName>dw9714</ActuatorName>
    <FlashName>pmic</FlashName>
    <ChromatixName>s5k4h7_sa80_chromatix</ChromatixName>
    <ModesSupported>1</ModesSupported>
    <Position>BACK</Position>
    <MountAngle>90</MountAngle>
    <CSIInfo>
      <CSIDCore>0</CSIDCore>
      <LaneMask>0x1F</LaneMask>
      <LaneAssign>0x4320</LaneAssign>
      <ComboMode>0</ComboMode>
    </CSIInfo>
    <LensInfo>
      <FocalLength>3.47</FocalLength>
      <FNumber>2.2</FNumber>
      <TotalFocusDistance>1.9</TotalFocusDistance>
      <HorizontalViewAngle>63.84</HorizontalViewAngle>
      <VerticalViewAngle>47.88</VerticalViewAngle>
      <MinFocusDistance>0.1</MinFocusDistance>
    </LensInfo>
  </CameraModuleConfig>
  <CameraModuleConfig>
    <CameraId>2</CameraId>
    <SensorName>s5k4h7_sa80</SensorName>
    <FlashName>pmic</FlashName>
    <ChromatixName>s5k4h7_sa80_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>3.47</FocalLength>
      <FNumber>2.2</FNumber>
      <TotalFocusDistance>1.9</TotalFocusDistance>
      <HorizontalViewAngle>63.84</HorizontalViewAngle>
      <VerticalViewAngle>47.88</VerticalViewAngle>
      <MinFocusDistance>0.1</MinFocusDistance>
    </LensInfo>
  </CameraModuleConfig>
</CameraConfigurationRoot>

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

LOCAL_SRC_FILES := s5k3m2xm_chromatix.xml
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/camera
LOCAL_MODULE_OWNER := qti
include $(BUILD_PREBUILT)

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

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

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

总结

如上配置后就可以看到camera可以点亮了,一般调试时建议先不要添加对焦和闪光灯这些,等点亮camera后再添加。
有遇到一个问题,camera id读到了但是不出图,根本原因还没有找到,待后续更新。

 类似资料: