当前位置:网站首页>[camera topic] complete analysis of camera dtsi
[camera topic] complete analysis of camera dtsi
2022-07-03 01:50:00 【C maple_ The day of shopping】
One 、 Nagging
Ashamed to speak , It's been a while since we moved bricks ,dtsi There are some configurations that have not been clarified ,
As a brick expert of salted fish , Just study it !
Two 、 Knowledge point
platform :8909
Main reference kernel/Documentation/devicetree/bindings/media/video/msm-cci.txt Notes , Plus self understanding !
1. sensor To configure
qcom,[email protected]0 {
cell-index = <0>;
compatible = "qcom,camera";
reg = <0x2>;
qcom,csiphy-sd-index = <0>;
qcom,csid-sd-index = <0>;
qcom,mount-angle = <90>;
qcom,eeprom-src = <&eeprom0>;
qcom,actuator-src = <&actuator0>;
qcom,led-flash-src = <&led_flash0>;
cam_vana-supply = <&pm8916_l2>;
cam_vdig-supply = <&pm8916_s3>;
cam_vio-supply = <&pm8916_l10>;
cam_vaf-supply = <&pm8916_l11>;
qcom,cam-vreg-name = "cam_vana","cam_vdig","cam_vio", "cam_vaf";
qcom,cam-vreg-type = <0 0 0 0>;
qcom,cam-vreg-min-voltage = <2800000 1500000 1800000 2800000>;
qcom,cam-vreg-max-voltage = <2800000 1500000 1800000 2800000>;
qcom,cam-vreg-op-mode = <200000 100000 80000 100000>;
pinctrl-names = "cam_default", "cam_suspend";
pinctrl-0 = <&cam_sensor_mclk0_default &cam_sensor_rear_default>;
pinctrl-1 = <&cam_sensor_mclk0_sleep &cam_sensor_rear_sleep>;
gpios = <&msm_gpio 26 0>,
<&msm_gpio 29 0>,
<&msm_gpio 33 0>;
qcom,gpio-reset = <1>;
qcom,gpio-standby = <2>;
qcom,gpio-req-tbl-num = <0 1 2>;
qcom,gpio-req-tbl-flags = <1 0 0>;
qcom,gpio-req-tbl-label = "CAMIF_MCLK",
"CAM_RESET0",
"CAM_STANDBY";
qcom,sensor-position = <0>;
qcom,sensor-mode = <0>;
qcom,cci-master = <0>;
status = "ok";
clocks = <&clock_gcc clk_mclk0_clk_src>,
<&clock_gcc clk_gcc_camss_mclk0_clk>;
clock-names = "cam_src_clk", "cam_clk";
};
1. cell-index = <0>;
Unique identification , Used to distinguish multiple cameras .
Source code :
kernel/drivers/media/platform/msm/camera_v2/sensor/msm_sensor_driver.c
static int32_t msm_sensor_driver_get_dt_data(struct msm_sensor_ctrl_t *s_ctrl){
···
/* * Read cell index - this cell index will be the camera slot where * this camera will be mounted */
rc = of_property_read_u32(of_node, "cell-index", &cell_id);
if (rc < 0) {
pr_err("failed: cell-index rc %d", rc);
goto FREE_SENSOR_DATA;
}
s_ctrl->id = cell_id;
···
}
According to the English notes here ,cell index identification camera Installation location , This value only needs to be unique !
2. compatible = “qcom,camera”;
Match nodes , Drive and equipment compatible Properties are the same , Will call probe function .
dtsi The configuration inside is the equipment , The following source code corresponds to the driver , These two properties are the same .
Source code :
kernel/drivers/media/platform/msm/camera_v2/sensor/msm_sensor_driver.c
static const struct of_device_id msm_sensor_driver_dt_match[] = {
{
.compatible = "qcom,camera"},
{
}
};
MODULE_DEVICE_TABLE(of, msm_sensor_driver_dt_match);
static struct platform_driver msm_sensor_platform_driver = {
.probe = msm_sensor_driver_platform_probe,
.driver = {
.name = "qcom,camera",
.owner = THIS_MODULE,
.of_match_table = msm_sensor_driver_dt_match,
},
.remove = msm_sensor_platform_remove,
};
3. reg = <0x2>;
i2c Address , From experience , As long as the configuration is unique , However, it is recommended to match i2c Address !
The location of the source code call was not found
4. qcom,csiphy-sd-index = <0>;
A device for receiving sensor data csiphy example ,
Configurable values :0,1,2
Source code :
kernel/drivers/media/platform/msm/camera_v2/sensor/io/msm_camera_dt_util.c

5. qcom,csid-sd-index = <0>;
A device for receiving sensor data csid Core instance
Configurable values :0,1,2
Source code :
kernel/drivers/media/platform/msm/camera_v2/sensor/io/msm_camera_dt_util.c
6. qcom,mount-angle = <90>;
The physical installation angle of the camera on the device
Configurable values :0,90,180,360
Generally speaking sensor raw The default direction of the graph is 90 perhaps 270!
7. qcom,eeprom-src = <&eeprom0>;
If the support otp(eeprom) Words , It is configured into various eeprom node , Otherwise, do not configure .
8. qcom,actuator-src = <&actuator0>;
If the motor is supported , They are configured as respective motor nodes , Otherwise, do not configure .
9. qcom,led-flash-src = <&led_flash0>;
If flash is supported , They are configured as their own flash nodes , Otherwise, do not configure .
10. cam_vana-supply = <&pm8916_l2>;
avdd Power supply , Whether to configure , Which system is configured to supply power , Need to communicate with hardware !
11. cam_vdig-supply = <&pm8916_s3>;
dvdd Power supply , Whether to configure , Which system is configured to supply power , Need to communicate with hardware !
12. cam_vio-supply = <&pm8916_l10>;
iovdd Power supply , Whether to configure , Which system is configured to supply power , Need to communicate with hardware !
13. cam_vaf-supply = <&pm8916_l11>;
Motor power supply , Whether to configure , Which system is configured to supply power , Need to communicate with hardware !
14. qcom,cam-vreg-name etc.
qcom,cam-vreg-name = “cam_vana”,“cam_vdig”,“cam_vio”, “cam_vaf”;
To configure sensor All power required .
Configurable options :“cam_vdig”, “cam_vana”, “cam_vio”, “cam_vaf”
Each represents the meaning of :dvdd,avdd,iovdd,af Power supply
It is not necessary to configure all , Which way to use, which way to go , Some circuit hardware is pulled up by itself , Specifically communicate with hardware .qcom,cam-vreg-type = <0 0 0 0>;
Specify for this sensor Type of power supply ,1 No use ,0 Said the use of .
Default configuration 0.
Other configuration references
171 qcom,cam-vreg-type = <0 1>;
172 qcom,cam-vreg-min-voltage = <1200000 0>;
173 qcom,cam-vreg-max-voltage = <1200000 0>;
qcom,cam-vreg-min-voltage = <2800000 1500000 1800000 2800000>;
Maximum value of power supply , Company mV
first dvdd The maximum value is 2800000mA=2.8V, Others in the same wayqcom,cam-vreg-max-voltage = <2800000 1500000 1800000 2800000>;
Minimum value of power supply , Company mV
first dvdd The minimum value is 2800000mA=2.8V, Others in the same wayqcom,cam-vreg-op-mode = <200000100000 80000 100000>;
The best voltage level of the power supply .
Like the first one dvdd The best voltage level is 200000
Common values :200000 100000 105000 80000 0
This node is not fully understood .
Be careful :
qcom,cam-vreg-name = "cam_vana","cam_vdig","cam_vio", "cam_vaf";
qcom,cam-vreg-type = <0 0 0 0>;
qcom,cam-vreg-min-voltage = <2800000 1500000 1800000 2800000>;
qcom,cam-vreg-max-voltage = <2800000 1500000 1800000 2800000>;
qcom,cam-vreg-op-mode = <200000 100000 80000 100000>;
These values correspond to each other in order !
15. pinctrl-names pinctrl-0 pinctrl-1
pinctrl-names = "cam_default", "cam_suspend";
pinctrl-0 = <&cam_sensor_mclk0_default &cam_sensor_rear_default>;
pinctrl-1 = <&cam_sensor_mclk0_sleep &cam_sensor_rear_sleep>;
This is also one-to-one correspondence in order .
- pinctrl-names = “cam_default”, “cam_suspend”;
This is the default configuration , The front represents clk, The latter represents reset Feet and standby foot , Wake up effect .

kernel/drivers/media/platform/msm/camera_v2/sensor/io/msm_camera_dt_util.c
static int msm_camera_pinctrl_init(struct msm_camera_power_ctrl_t *ctrl)
{
struct msm_pinctrl_info *sensor_pctrl = NULL;
sensor_pctrl = &ctrl->pinctrl_info;
sensor_pctrl->pinctrl = devm_pinctrl_get(ctrl->dev);
···
sensor_pctrl->gpio_state_active =
pinctrl_lookup_state(sensor_pctrl->pinctrl,
CAM_SENSOR_PINCTRL_STATE_DEFAULT);
···
sensor_pctrl->gpio_state_suspend
= pinctrl_lookup_state(sensor_pctrl->pinctrl,
CAM_SENSOR_PINCTRL_STATE_SLEEP);
···
return 0;
}
- pinctrl-0 = <&cam_sensor_mclk0_default &cam_sensor_rear_default>;
kernel/arch/arm/boot/dts/qcom/msm8909-pinctrl-i18.dtsi
/*sensors */
cam_sensor_mclk0_default: cam_sensor_mclk0_default {
/* MCLK0 */
mux {
/* CLK, DATA */
pins = "gpio26";
function = "cam_mclk";
};
config {
pins = "gpio26";
bias-disable; /* No PULL */
drive-strength = <2>; /* 2 MA */
};
};
cam_sensor_rear_default: cam_sensor_rear_default {
/* RESET, STANDBY */
mux {
pins = "gpio29", "gpio33";
function = "gpio";
};
config {
pins = "gpio29","gpio33";
bias-disable; /* No PULL */
drive-strength = <2>; /* 2 MA */
};
};
there gpio How many configurations , Communicate with hardware
pinctrl-1 = <&cam_sensor_mclk0_sleep &cam_sensor_rear_sleep>;
cam_sensor_mclk0_sleep: cam_sensor_mclk0_sleep {
/* MCLK0 */
mux {
/* CLK, DATA */
pins = "gpio26";
function = "cam_mclk";
};
config {
pins = "gpio26";
bias-pull-down; /* PULL DOWN */
drive-strength = <2>; /* 2 MA */
};
};
cam_sensor_rear_sleep: cam_sensor_rear_sleep {
/* RESET, STANDBY */
mux {
pins = "gpio29","gpio33";
function = "gpio";
};
config {
pins = "gpio29","gpio33";
bias-disable; /* No PULL */
drive-strength = <2>; /* 2 MA */
};
};
there gpio How many configurations , Communicate with hardware
16. gpio relevant
gpios = <&msm_gpio 26 0>,
<&msm_gpio 29 0>,
<&msm_gpio 33 0>;
qcom,gpio-reset = <1>;
qcom,gpio-standby = <2>;
qcom,gpio-req-tbl-num = <0 1 2>;
qcom,gpio-req-tbl-flags = <1 0 0>;
qcom,gpio-req-tbl-label = "CAMIF_MCLK","CAM_RESET0","CAM_STANDBY";
Here are one-to-one correspondence
such as :
26 Corresponding CAMIF_MCLK
29 Corresponding CAM_RESET0
33 Corresponding CAM_STANDBY
qcom,gpio-reset = <1>;
sensor reset Index of feet , Here is 1qcom,gpio-standby = <2>
sensor standby Index of feet , Here is 2qcom,gpio-req-tbl-num = <0 1 2>;
mclk,reset,stanby The index of , because mclk by 0,qcom,gpio-reset = <1>,qcom,gpio-standby = <2>
Therefore, it is configured as <0,1,2>qcom,gpio-req-tbl-flags = <1 0 0>;
gpio The direction of ,mclk by 1, Indicative output ,reset and standby by 0, Indicates input .qcom,gpio-req-tbl-label
gpio The name of .
Common values :
“CAMIF_MCLK”, “CAM_RESET”,“CAM_STANDBY”;
“CAMIF_MCLK0”, “CAM_RESET0”,“CAM_STANDBY0”;
“CAMIF_MCLK1”, “CAM_RESET1”,“CAM_STANDBY1”;
“CAMIF_MCLK2”, “CAM_RESET2”,“CAM_STANDBY2”;
17. qcom,sensor-position = <0>;
camera Location .
- 0- Post shot
- 1- Front shot
- 0x100- Second shot ( At present, there are only back shots and side shots , The front shot is temporarily unavailable )
18. qcom,sensor-mode = <0>;
Sensor mode support
- 0 -> back camera 2D
- 1 -> front camera 2D
- 2 -> back camera 3D
- 3 -> back camera int 3D
19. qcom,cci-master = <0>;
sensor The use of master id.
Optional value :
- 0 -> MASTER 0
- 1 -> MASTER 1
20. clocks relevant
clocks = <&clock_gcc clk_mclk0_clk_src>,
<&clock_gcc clk_gcc_camss_mclk0_clk>;
clock-names = "cam_src_clk", "cam_clk";
- clocks
Clock used by the device
30 clock_gcc: qcom,[email protected]1800000 {
31 compatible = "qcom,dummycc";
32 #clock-cells = <1>;
33 };
#define clk_mclk0_clk_src 0x266b3853
#define clk_mclk1_clk_src 0xa73cad0c
#define clk_mclk2_clk_src 0x42545468
#define clk_mclk3_clk_src 0x2bfbb714
- clock-names
Name of the clock required by the device
99static struct msm_cam_clk_info cam_8974_clk_info[] = {
100 [SENSOR_CAM_MCLK] = {
"cam_src_clk", 24000000},
101 [SENSOR_CAM_CLK] = {
"cam_clk", 0},
102};
Stay Hungry,Stay Foolish !
边栏推荐
- Technology sharing | Frida's powerful ability to realize hook functions
- [interview question] 1369 when can't I use arrow function?
- 英语常用词汇
- 2022-02-15 reading the meta module inspiration of the influxdb cluster
- 【數據挖掘】任務6:DBSCAN聚類
- Huakaiyun (Zhiyin) | virtual host: what is a virtual host
- C application interface development foundation - form control (2) - MDI form
- 网络安全-最简单的病毒
- Leetcode skimming questions_ Sum of two numbers II - enter an ordered array
- [机缘参悟-36]:鬼谷子-飞箝篇 - 面对捧杀与诱饵的防范之道
猜你喜欢

CF1617B Madoka and the Elegant Gift、CF1654C Alice and the Cake、 CF1696C Fishingprince Plays With Arr
![[data mining] task 4:20newsgroups clustering](/img/76/af1d1338c468ec4825fe12816b84ff.png)
[data mining] task 4:20newsgroups clustering
![[data mining] task 6: DBSCAN clustering](/img/af/ad7aa523b09884eee967c6773a613f.png)
[data mining] task 6: DBSCAN clustering

【Camera专题】手把手撸一份驱动 到 点亮Camera

Why is it not recommended to use BeanUtils in production?

CF1617B Madoka and the Elegant Gift、CF1654C Alice and the Cake、 CF1696C Fishingprince Plays With Arr

How is the mask effect achieved in the LPL ban/pick selection stage?

Qtablewidget lazy load remaining memory, no card!

Three core issues of concurrent programming - "deep understanding of high concurrent programming"

Everything文件搜索工具
随机推荐
[data mining] task 1: distance calculation
Network security - cracking system passwords
Telecom Customer Churn Prediction challenge
Uniapp component -uni notice bar notice bar
PS去除水印详解
Network security - dynamic routing protocol rip
查询商品案例-页面渲染数据
[data mining] task 6: DBSCAN clustering
PS remove watermark details
[shutter] animation animation (animatedbuilder animation use process | create animation controller | create animation | create components for animation | associate animation with components | animatio
Network security ACL access control list
网络安全-NAT网络地址转换
Smart management of Green Cities: Digital twin underground integrated pipe gallery platform
串口抓包/截断工具的安装及使用详解
Analysis, use and extension of open source API gateway apisex
[error record] navigator operation requested with a context that does not include a naviga
网络安全-浅谈安全威胁
网络安全-病毒
Network security OpenVAS
网络安全-最简单的病毒