2.1 Power on template
Add your sensor to PowerOnList @ kd_camera_hw.c
No default power on sequence
kdCISModulePowerOn()
kdCISModulePowerOn()
– hwpoweron()
- _hwPowerOn() for regulator( aka LDO)
- mtkcam_gpio_set() for gpio
- mt_set_gpio_mode(), mt_set_gpio_dir() and mt_set_gpio_out()
- hwPowerOn() regulator( aka LDO)
2.2 GPIO
2.2.1 Usage
– To control the PWD/RST pin for camera power on
– To control the external LDO for camera
2.2.2Kernel 3.18
– Kernel standard
– PINCTRL
For details, please find kernel-3.18/ Documentation/pinctrl.txt
– Need customized for each project manually
Ex.kernel-3.18/arch/arm64/boot/dts/amt6797_64_open.dts
2.3 PINCTRL
pinctrl_state
Functions
– pinctrl_lookup_state()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | /* GPIO Pin control*/ struct platform_device *cam_plt_dev = NULL; struct pinctrl *camctrl = NULL; struct pinctrl_state *cam0_pnd_h = NULL;/* main cam */ struct pinctrl_state *cam0_pnd_l = NULL; struct pinctrl_state *cam0_rst_h = NULL; struct pinctrl_state *cam0_rst_l = NULL; struct pinctrl_state *cam1_pnd_h = NULL;/* sub cam */ struct pinctrl_state *cam1_pnd_l = NULL; struct pinctrl_state *cam1_rst_h = NULL; struct pinctrl_state *cam1_rst_l = NULL; struct pinctrl_state *cam2_pnd_h = NULL;/* main2 cam */ struct pinctrl_state *cam2_pnd_l = NULL; struct pinctrl_state *cam2_rst_h = NULL; struct pinctrl_state *cam2_rst_l = NULL; struct pinctrl_state *cam_ldo_vcama_h = NULL;/* for AVDD */ struct pinctrl_state *cam_ldo_vcama_l = NULL; struct pinctrl_state *cam_ldo_vcamd_h = NULL;/* for DVDD */ struct pinctrl_state *cam_ldo_vcamd_l = NULL; struct pinctrl_state *cam_ldo_vcamio_h = NULL;/* for DOVDD */ struct pinctrl_state *cam_ldo_vcamio_l = NULL; struct pinctrl_state *cam_ldo_vcamaf_h = NULL;/* for AFVDD */ struct pinctrl_state *cam_ldo_vcamaf_l = NULL; struct pinctrl_state *cam_ldo_sub_vcamd_h = NULL;/* for SUB_DVDD */ struct pinctrl_state *cam_ldo_sub_vcamd_l = NULL; struct pinctrl_state *cam_ldo_main2_vcamd_h = NULL;/* for MAIN2_DVDD */ struct pinctrl_state *cam_ldo_main2_vcamd_l = NULL; |
– get specified pinctrl_state descripted in xxx.dts
am0_pnd_hGPIO state for PDN of main cam @ high,
cam0_pnd_l→GPIO state for PDN of main cam @ low
– pinctrl_select_state()
pinctrl_select_state(camctrl, cam0_pnd_l); →set PDN of main cam to low