注: 1. 37m androidM/N/O 驱动及hal代码一样,可以公用
2. 37m 与37t 驱动代码一样,hal层代码格式不一样
3. 37m 与39 驱动代码一样,只有头文件#include "kd_camera_hw.h" --> #include "kd_camera_typedef.h"
hal 层代码camera_isp_pca_gc8024mipi_raw.h、camera_isp_regs_gc8024mipi_raw.h、camera_tuning_para_gc8024mipi_raw.cpp三个格式不一样,需要参考39平台原生的imx219修改
其余一样
零、点亮新camera
1. 修改device\lentek\len6737m_35_m0\ProjectConfig.mk
CUSTOM_HAL_IMGSENSOR =gc8024_mipi_raw gc5005_mipi_raw gc2365_mipi_raw
CUSTOM_HAL_MAIN_IMGSENSOR =gc8024_mipi_raw
CUSTOM_KERNEL_IMGSENSOR =gc8024_mipi_raw gc5005_mipi_raw gc2365_mipi_raw
CUSTOM_KERNEL_MAIN_IMGSENSOR =gc8024_mipi_raw
2. 修改kernel-3.18\arch\arm\configs\len6737m_35_m0_debug_defconfig、len6737m_35_m0_defconfig
CONFIG_CUSTOM_KERNEL_IMGSENSOR="gc5005_mipi_raw gc2365_mipi_raw"(添加指定摄像头)
3. 修改device\mediatek\common\kernel-headers\kd_imgsensor.h
#define GC8024MIPI_SENSOR_ID 0x8024
#define SENSOR_DRVNAME_GC8024MIPI_RAW "gc8024mipiraw"
4. 修改kernel-3.18\drivers\misc\mediatek\imgsensor\inc\kd_imgsensor.h
#define GC8024MIPI_SENSOR_ID 0x8024
#define SENSOR_DRVNAME_GC8024MIPI_RAW "gc8024mipiraw"
5. 添加驱动代码,放到kernel-3.18\drivers\misc\mediatek\imgsensor\src\mt6735m\
创建文件夹gc8024_mipi_raw文件夹中包含gc8024mipi_Sensor.c、gc8024mipi_Sensor.h、Makefile
6. 修改kernel-3.18\drivers\misc\mediatek\imgsensor\src\mt6735m\camera_hw\kd_camera_hw.c
6.1 上电时序
//POWER ON
if (On) {
if ((currSensorName && (0 == strcmp(SENSOR_DRVNAME_GC8024MIPI_RAW, currSensorName))) ||
(currSensorName && (0 == strcmp(SENSOR_DRVNAME_GC5005MIPI_RAW, currSensorName))))
{
// VCM_D
if((currSensorName && (0 == strcmp(SENSOR_DRVNAME_GC8024MIPI_RAW, currSensorName))) ||
(currSensorName && (0 == strcmp(SENSOR_DRVNAME_GC5005MIPI_RAW, currSensorName))))
{}
}
}
6.2 掉电时序(三个相同)
//POWER OFF
else{
if((currSensorName && (0 == strcmp(SENSOR_DRVNAME_GC8024MIPI_RAW, currSensorName))) ||
(currSensorName && (0 == strcmp(SENSOR_DRVNAME_GC5005MIPI_RAW, currSensorName))) ||
(currSensorName && (0 == strcmp(SENSOR_DRVNAME_GC2365MIPI_RAW, currSensorName))))
{}
}
7. 修改kernel-3.18\drivers\misc\mediatek\imgsensor\src\mt6735m\kd_sensorlist.h
UINT32 GC8024MIPI_RAW_SensorInit(PSENSOR_FUNCTION_STRUCT *pfFunc);
#if defined(GC8024_MIPI_RAW)
{GC8024MIPI_SENSOR_ID, SENSOR_DRVNAME_GC8024MIPI_RAW,GC8024MIPI_RAW_SensorInit},
#endif
====================================以下是HAL层====================================
8. 添加HAL层代码vendor\mediatek\proprietary\custom\mt6735\hal\D2\imgsensor
创建文件夹gc8024_mipi_raw文件夹中包含camera_flicker_para_gc8024mipi_raw.cpp等文件
9. 修改vendor\mediatek\proprietary\custom\mt6735\hal\D2\imgsensor_src\sensorlist.cpp
注意:此处camera IC的顺序应该跟kd_sensorlist.h中的顺序一致
#if defined(GC8024_MIPI_RAW)
RAW_INFO(GC8024MIPI_SENSOR_ID, SENSOR_DRVNAME_GC8024MIPI_RAW,NULL),
#endif
10. 添加cameraHAL层插值文件vendor\mediatek\proprietary\custom\mt6735\hal\D2\sendepfeature
添加文件夹gc8024_mipi_raw,里面添加文件config.ftbl.gc8024mipi_raw.h
注意:第十步,可不要,有默认配置可用
零一、mt6739平台(kernel-4.4 以vd6955cm_mipi_raw为例):
1. device/mediatek/common/kernel-headers/kd_imgsensor.h
+ #define VD6955CMMIPI_SENSOR_ID 0x07A3
+ #define SENSOR_DRVNAME_VD6955CMMIPI_RAW "vd6955cm_mipi_raw"
2. kernel-4.4/drivers/misc/mediatek/imgsensor/inc/kd_imgsensor.h
+ #define SENSOR_DRVNAME_VD6955CMMIPI_RAW "vd6955cm_mipi_raw"
3. 【这一步有的camera不需要,还是搞明白】kernel-4.4/drivers/misc/mediatek/imgsensor/src/common/v1/imgsensor_hw.c
+ if(curr_sensor_name&&(0 == strcmp(SENSOR_DRVNAME_VD6955CMMIPI_RAW, curr_sensor_name))){
+ if(sensor_idx == 1){
+ return IMGSENSOR_RETURN_ERROR;
+ }
+ }
imgsensor_hw_power_sequence(); // 在这个函数之前
4. kernel-4.4/drivers/misc/mediatek/imgsensor/src/common/v1/imgsensor_sensor_list.c
+ #if defined(VD6955CM_MIPI_RAW)
+ {VD6955CMMIPI_SENSOR_ID, SENSOR_DRVNAME_VD6955CMMIPI_RAW, VD6955CMMIPI_RAW_SensorInit},
+ #endif
5. kernel-4.4/drivers/misc/mediatek/imgsensor/src/common/v1/imgsensor_sensor_list.h
+ UINT32 VD6955CMMIPI_RAW_SensorInit(PSENSOR_FUNCTION_STRUCT *pfFunc);
6. kernel-4.4/drivers/misc/mediatek/imgsensor/src/mt6739/camera_hw/imgsensor_cfg_table.c
+ #if defined(VD6955CM_MIPI_RAW)
+ {
+ SENSOR_DRVNAME_VD6955CMMIPI_RAW,
+ {
+ {SensorMCLK, Vol_High, 0},
+ {AVDD, Vol_2800, 10},
+ {DOVDD, Vol_1800, 10},
+ {DVDD, Vol_1500, 10},
+ {AFVDD, Vol_2800, 5},
+ {PDN, Vol_Low, 0},
+ {PDN, Vol_High, 0},
+ {RST, Vol_Low, 0},
+ {RST, Vol_High, 0}
+ },
+ },
+ #endif
7. kernel-4.4/drivers/misc/mediatek/imgsensor/src/mt6739/目录下新建文件夹: vd6955cm_mipi_raw
包含5个文件
Makefile
vd6955cmmipiraw_CameraCustomized.h
vd6955cmmipiraw_Camera_Sensor_para.h
vd6955cmmipiraw_Sensor.c
vd6955cmmipiraw_Sensor.h
8. vendor/mediatek/proprietary/custom/mt6739/hal/imgsensor/目录下新建文件夹: vd6955cm_mipi_raw
包含11个文件
camera_AE_PLineTable_vd6955cmmipiraw.h
camera_feature_para_vd6955cmmipiraw.h
camera_flash_awb_para_vd6955cmmipiraw.h
camera_flicker_para_vd6955cmmipiraw.cpp
camera_info_vd6955cmmipiraw.h
camera_isp_lsc_vd6955cmmipiraw.h
camera_isp_pca_vd6955cmmipiraw.h
camera_isp_regs_vd6955cmmipiraw.h
camera_tsf_data_vd6955cmmipiraw.h
camera_tsf_para_vd6955cmmipiraw.h
camera_tuning_para_vd6955cmmipiraw.cpp
9. vendor/mediatek/proprietary/custom/mt6739/hal/imgsensor_src/sensorlist.cpp
+ #if defined(VD6955CM_MIPI_RAW)
+ RAW_INFO(VD6955CMMIPI_SENSOR_ID, SENSOR_DRVNAME_VD6955CMMIPI_RAW, NULL),
+ #endif
10. vendor/mediatek/proprietary/custom/mt6739/hal/lens/src/lenslist.cpp
MSDK_LENS_INIT_FUNCTION_STRUCT LensList_main[MAX_NUM_OF_SUPPORT_LENS] =
{
{DUMMY_SENSOR_ID, DUMMY_LENS_ID, "Dummy", pDummy_getDefaultData},
#if defined(FM50AF)
+ {VD6955CMMIPI_SENSOR_ID, FM50AF_LENS_ID, "FM50AF", pFM50AF_getDefaultData},
11. vendor/mediatek/proprietary/custom/mt6739/hal/sendepfeature/目录下新建文件夹: vd6955cm_mipi_raw
包含1个文件
config.ftbl.vd6955cm_mipi_raw.h
追加、关于上电:
1. 关于Camera 上电
AVDD = 2.8V (依据芯片规格,目前为止调试的芯片均为2.8V)
AFVDD = 2.8V (自动对焦马达电压,目前为止调试的芯片均为2.8V)
IOVDD = 1.8V (MTK 平台IO即I2C 电压均为1.8V)
DVDD = 1.8V (依据芯片不同进行定义如IMX219 DVDD=1.2V)// DVDD 若软件配置不匹配会导致读不到ID, I2C不通
MT6735/37等4G平台只能支持到1.5V DVDD
MT6580/70/72等可以支持到1.8V DVDD
一、摄像头上下左右颠倒
1. 格科的GC系列: 驱动中都有相关的宏可以控制 - 开关就行(四选一)
#define IMAGE_NO_MIRROR
//#define IMAGE_H_MIRROR
//#define IMAGE_V_MIRROR
//#define IMAGE_HV_MIRROR
2. 思比科的sp系列 与 ov公司的ov系列 与 sony 的imx系列 :
2.1 可以直接修改驱动中的寄存器,各个ic的寄存器不一
2.2 用以下方式实现,本质也是修改寄存器,只是封装成了一个函数:
static imgsensor_struct imgsensor = {
.mirror = IMAGE_HV_MIRROR, // 跟格科的一样有四种
static void set_mirror_flip(kal_uint8 image_mirror) // 在以下四个地方需要调用这个函数
preview(){
set_mirror_flip(IMAGE_HV_MIRROR);
return ERROR_NONE;
}
capture(){
set_mirror_flip(IMAGE_HV_MIRROR);
return ERROR_NONE;
}
normal_video(){
set_mirror_flip(IMAGE_HV_MIRROR);
return ERROR_NONE;
}
hs_video(){
set_mirror_flip(IMAGE_HV_MIRROR);
return ERROR_NONE;
}
3. hal层还有一个地方可以改,作用与所有摄像头
vendor/mediatek/proprietary/custom/mt6735/hal/D2/imgsensor_src/cfg_setting_imgsensor.cpp
static SensorOrientation_T const inst = {
u4Degree_0 : 90, // main sensor in degree (0, 90, 180, 270)
u4Degree_1 : 270, // sub sensor in degree (0, 90, 180, 270)
u4Degree_2 : 90, // main2 sensor in degree (0, 90, 180, 270)
};
二、后副摄
1.测试后副摄是否调通[微掌]
1.1 cat /proc/driver/dualcam_brightness // 1 -- 光线强 0 -- 光线弱 有变化说明驱动通了,但是没有虚化效果,是因为上层的宏没配
1.2 上层的宏,临时开关,不能提交:
Z:\code5_37_n_base_oule_user\update\alps\system_conf.sh
KST_BeautySnap=4
GANGYUN_BOKEH_SUPPORT=yes
KST_GANGYUN_BOKEH_SUPPORT=1
KST_OPEN_DOUBLE_CAMERA=yes
1.3 cat /sys/bus/platform/drivers/image_sensor/yuv_shutter // 可以获得亮度值
1.4 查看是否读到id(这里看不到后副摄)
cat /proc/driver/camera_info
三、调试方法
1.查看硬件原理图连接--MCLK
经查看v661_bst_k1项目,前后摄连接在同一个MCLK上
2.查看硬件原理图连接--i2c_num
经查看v661_bst_k1项目,前摄连接在i2c总线2上
i2c_num 写在dws中 - 没有写错
四、AF(len)调试
1.对焦框不能变绿(变绿代表对焦ok)
修改alps/vendor/mediatek/proprietary/custom/mt6735/hal/D1/lens/fm50af/lens_para_FM50AF.cpp
- 2, // i4AFC_FAIL_CNT
+ 5, // i4AFC_FAIL_CNT 增大循环次数,改善概率性马达对焦时间长的问题。(四个地方都改)
四一、“自动闪光”亮处也闪 - 减小参数
修改alps\vendor\mediatek\proprietary\custom\mt6735\hal\D2\imgsensor\imx219_mipi_raw\camera_AE_PLineTable_imx219mipiraw.h
- 3, //u4StrobeTrigerBV
+ -10, //u4StrobeTrigerBV -- 共有20多处,全部改过来
五、FlashLight调试
1.hal层代码合入(根据FAE提供),只需要修改engTab[],其余不动
alps\vendor\mediatek\proprietary\custom\mt6735\hal\D2\flashlight\flash_tuning_custom_cct.cpp
int cust_fillDefaultStrobeNVRam_main (void* data)
{
int i;
NVRAM_CAMERA_STROBE_STRUCT* p;
p = (NVRAM_CAMERA_STROBE_STRUCT*)data;
static short engTab[]=
- {1339,1940,2505,3586,4562,5486,6348,7168,7943,8665,9349,9999};
+ #if defined(KST_V618_P300) // 添加宏控,在mk文件中配上:KST_MISC_CUSTOM= KST_V618_P300
+ {9633,9872,9999,9292,9450,9815,9757,9282,9667,8884,8969,8962}; // 这一串数组来自FAE提供
+ #else
+ {1339,1940,2505,3586,4562,5486,6348,7168,7943,8665,9349,9999};
+ #endif
六、TSF - 需要先由项目经理联系mtk,mtk处理后返回代码,由驱动工程师合入
1.邮件联系mtk:
欧乐V618-P300后摄GC8024需要做TSF 具体信息如下:
1.公司备案项目名: V618
2.模组具体型号: GC8024
3.OB值: 0
4.是否带OTP: 否
5.符合命名规则的raw文件:http://pan.baidu.com/s/1dFOnZX3 // 几十张RAW图像
2.mtk返回代码:
camera_tsf_data.h
camera_tsf_para.h
3.合入到hal层效果代码:
alps\vendor\mediatek\proprietary\custom\mt6735\hal\D2\imgsensor\gc8024mipi_raw\camera_tsf_data_gc8024mipi_raw.h
alps\vendor\mediatek\proprietary\custom\mt6735\hal\D2\imgsensor\gc8024mipi_raw\camera_tsf_para_gc8024mipi_raw.h
4.使能TSF,并#include两个TSF.h文件
修改alps\vendor\mediatek\proprietary\custom\mt6735\hal\D2\imgsensor\gc8024mipi_raw\camera_tuning_para_gc8024mipi_raw.cpp
const CAMERA_TSF_TBL_STRUCT CAMERA_TSF_DEFAULT_VALUE =
{
{
1, // isTsfEn // 1 - 使能TSF 0 - 失能TSF
2, // tsfCtIdx
{20, 2000, -110, -110, 512, 512, 512, 0} // rAWBInput[8]
},
#include INCLUDE_FILENAME_TSF_PARA // #define INCLUDE_FILENAME_TSF_PARA "camera_tsf_para_gc8024mipi_raw.h"
#include INCLUDE_FILENAME_TSF_DATA // #define INCLUDE_FILENAME_TSF_DATA "camera_tsf_data_gc8024mipi_raw.h"
};
八、单独编译camera hal层:
1.编译命令:
source build/envsetup.sh ; lunch full_magc6737m_65_n-eng; mmma vendor/mediatek/proprietary/custom/mt6735/hal 2>&1 | tee mm.log
2.编译生成:
Z:alps\out\target\product\magc6737m_65_c_m0\system\lib\libcameracustom.so
Z:alps\out\target\product\magc6737m_65_c_m0\system\lib64\libcameracustom.so
3.push到手机
adb remount
adb push *** /system/lib/
adb push *** /system/lib64/
adb shell
rm -r /data/media/0/mtklog
reboot
九、插值修改(即像素作假)
以662_R2项目为例: 插值配置 前摄 QVGA/VGA/1MP/2MP/3MP/5MP 后摄 QVGA/VGA/1MP/2MP/3MP/5MP/8MP/13MP(默认 13MP)
修改以下三个文件,并打开3个宏:CAMERA_MAIN_1300W CAMERA_SUB_500W KST_V662_R2_CAMERA_PIXEL
后摄145
alps/vendor/mediatek/proprietary/custom/mt6735/hal/D2/sendepfeature/imx145_mipi_raw/config.ftbl.imx145_mipi_raw.h
...
#elif defined(CAMERA_MAIN_1300W) // 这个宏定义在alps/device/magcomm/magc6737m_65_n/ProjectConfig.mk: KST_CAM_CUSTOM=CAMERA_MAIN_1300W
+ #if defined(KST_V662_R2_CAMERA_PIXEL) // 这个宏定义在alps/device/magcomm/magc6737m_65_n/ProjectConfig.mk: KST_MISC_CUSTOM=KST_SUB_FLASH_SUPPORT
+ ITEM_AS_DEFAULT_("4160x3120"),/* default 1300w */ // 二数相乘即是像素
+ ITEM_AS_VALUES_(
"320x240", "640x480", "1280x960", "1600x1200", "2048x1536", "2560x1920", "3264x2448", "4160x3120", /* 4:3*/ // QVGA/VGA/1MP/2MP/3MP/5MP/8MP/13MP
"320x180", "640x360", "1536x864", "1600x912", "2048x1152", "2560x1440", "3328x1872", "4608x2592", /* 16:9 */ // QVGA/VGA/1MP/2MP/3MP/5MP/8MP/13MP
"400x240", "640x360", "1280x768", "1600x960", "1600x960", "2560x1536", "2880x1728", "4160x2496", /* 5:3 */ // QVGA/VGA/1MP/2MP/3MP/5MP/8MP/13MP
+ )
+ #else
ITEM_AS_DEFAULT_("4160x3120"),
ITEM_AS_VALUES_(
"3680x2752", "4032x3024", "4160x3120", /* 4:3 */
"3328x1872", "4096x2304", "4608x2592", /* 16:9 */
"2880x1728", "3600x2160", "4160x2496",/* 5:3 */
)
+ #endif
前摄190
alps/vendor/mediatek/proprietary/custom/mt6735/hal/D2/sendepfeature/ov509s_mipi_raw/config.ftbl.ov509s_mipi_raw.h
#elif defined(CAMERA_SUB_500W)
#if defined(KST_V662_R2_CAMERA_PIXEL)
ITEM_AS_DEFAULT_("2560x1920"),
ITEM_AS_VALUES_(
"320x240", "640x480", "1280x960", "1600x1200", "2048x1536", "2560x1920", /* 4:3*/ // QVGA/VGA/1MP/2MP/3MP/5MP
"320x180", "640x360", "1280x720", "1600x912", "2048x1152", "2560x1440", /* 16:9*/ // QVGA/VGA/1MP/2MP/3MP/5MP
"400x240", "640x384", "1280x768","1600x960", "2560x1536", /* 5:3*/ // QVGA/VGA/1MP/2MP/3MP/5MP
)
#else
ITEM_AS_DEFAULT_("2560x1920"),
ITEM_AS_VALUES_(
"1600x1200", "2048x1536", "2560x1920", /* 4:3 200w-300w-500w*/
"1600x912", "2048x1152", "2560x1440", /* 16:9 220w-490w*/
"1280x768", "1600x960", "2560x1536", /* 5:3 100w-300w-500w*/
)
#endif
十、 摄像头变焦倍数设置:1.0/1.1倍等
alps/vendor/mediatek/proprietary/custom/mt6580/hal/sendepfeature/gc2355m_mipi_raw/config.ftbl.gc2355m_mipi_raw.h
// Zoom - 变焦
FTABLE_CONFIG_AS_TYPE_OF_USER(
KEY_AS_(MtkCameraParameters::KEY_ZOOM),
SCENE_AS_DEFAULT_SCENE(
ITEM_AS_DEFAULT_("0"), //Zoom Index
ITEM_AS_USER_LIST_(
//Zoom Ratio
#if defined(KST_CAMERA_ZOOM_1P1)
"114", "132", "151", "174", "200", // 去掉1.0倍变焦["100"]
"229", "263", "303", "348", "400",
#elif defined(MIPI_RAW_ZOOM_MAX_2P5)
"100", "114", "132", "151", "174",
"200", "220", "250", // 限制最大为2.5倍变焦 ["250"]
#else
"100", "114", "132", "151", "174", // 原本分别为1.0/1.1/1.3/.../4.0倍变焦
"200", "229", "263", "303", "348",
"400",
#endif
)
),
)
十一、 相机菜单中删除或增加某些场景如HDR
alps/vendor/mediatek/proprietary/custom/mt6735/hal/D2/sendepfeature/imx145_mipi_raw/config.ftbl.imx145_mipi_raw.h
// Scene Mode
FTABLE_CONFIG_AS_TYPE_OF_DEFAULT_VALUES(
KEY_AS_(MtkCameraParameters::KEY_SCENE_MODE),
SCENE_AS_DEFAULT_SCENE(
ITEM_AS_DEFAULT_(MtkCameraParameters::SCENE_MODE_AUTO),
ITEM_AS_VALUES_(
MtkCameraParameters::SCENE_MODE_AUTO,
MtkCameraParameters::SCENE_MODE_NORMAL,
MtkCameraParameters::SCENE_MODE_PORTRAIT,
MtkCameraParameters::SCENE_MODE_LANDSCAPE,
MtkCameraParameters::SCENE_MODE_NIGHT,
MtkCameraParameters::SCENE_MODE_NIGHT_PORTRAIT,
MtkCameraParameters::SCENE_MODE_THEATRE,
MtkCameraParameters::SCENE_MODE_BEACH,
MtkCameraParameters::SCENE_MODE_SNOW,
MtkCameraParameters::SCENE_MODE_SUNSET,
MtkCameraParameters::SCENE_MODE_STEADYPHOTO,
MtkCameraParameters::SCENE_MODE_FIREWORKS,
MtkCameraParameters::SCENE_MODE_SPORTS,
MtkCameraParameters::SCENE_MODE_PARTY,
MtkCameraParameters::SCENE_MODE_CANDLELIGHT,
// MtkCameraParameters::SCENE_MODE_HDR,
)
),
)
十二、白平衡 - 增删改查
// White Balance.
FTABLE_CONFIG_AS_TYPE_OF_DEFAULT_VALUES(
KEY_AS_(MtkCameraParameters::KEY_WHITE_BALANCE),
SCENE_AS_DEFAULT_SCENE(
ITEM_AS_DEFAULT_(MtkCameraParameters::WHITE_BALANCE_AUTO),
ITEM_AS_VALUES_(
MtkCameraParameters::WHITE_BALANCE_AUTO, MtkCameraParameters::WHITE_BALANCE_INCANDESCENT,
MtkCameraParameters::WHITE_BALANCE_FLUORESCENT, MtkCameraParameters::WHITE_BALANCE_WARM_FLUORESCENT,
MtkCameraParameters::WHITE_BALANCE_DAYLIGHT, MtkCameraParameters::WHITE_BALANCE_CLOUDY_DAYLIGHT,
MtkCameraParameters::WHITE_BALANCE_TWILIGHT, // MtkCameraParameters::WHITE_BALANCE_SHADE,
)
),
//......................................................................
#if 1 // SCENE LANDSCAPE
SCENE_AS_(MtkCameraParameters::SCENE_MODE_LANDSCAPE,
ITEM_AS_DEFAULT_(MtkCameraParameters::WHITE_BALANCE_DAYLIGHT),
ITEM_AS_VALUES_(
MtkCameraParameters::WHITE_BALANCE_AUTO, MtkCameraParameters::WHITE_BALANCE_INCANDESCENT,
MtkCameraParameters::WHITE_BALANCE_FLUORESCENT, MtkCameraParameters::WHITE_BALANCE_WARM_FLUORESCENT,
MtkCameraParameters::WHITE_BALANCE_DAYLIGHT, MtkCameraParameters::WHITE_BALANCE_CLOUDY_DAYLIGHT,
MtkCameraParameters::WHITE_BALANCE_TWILIGHT, MtkCameraParameters::WHITE_BALANCE_SHADE,
)
)
#endif
//......................................................................
#if 1 // SCENE SUNSET
SCENE_AS_(MtkCameraParameters::SCENE_MODE_SUNSET,
ITEM_AS_DEFAULT_(MtkCameraParameters::WHITE_BALANCE_DAYLIGHT),
ITEM_AS_VALUES_(
MtkCameraParameters::WHITE_BALANCE_AUTO, MtkCameraParameters::WHITE_BALANCE_INCANDESCENT,
MtkCameraParameters::WHITE_BALANCE_FLUORESCENT, MtkCameraParameters::WHITE_BALANCE_WARM_FLUORESCENT,
MtkCameraParameters::WHITE_BALANCE_DAYLIGHT, MtkCameraParameters::WHITE_BALANCE_CLOUDY_DAYLIGHT,
MtkCameraParameters::WHITE_BALANCE_TWILIGHT, MtkCameraParameters::WHITE_BALANCE_SHADE,
)
)
#endif
//......................................................................
#if 1 // SCENE CANDLELIGHT
SCENE_AS_(MtkCameraParameters::SCENE_MODE_CANDLELIGHT,
ITEM_AS_DEFAULT_(MtkCameraParameters::WHITE_BALANCE_INCANDESCENT),
ITEM_AS_VALUES_(
MtkCameraParameters::WHITE_BALANCE_AUTO, MtkCameraParameters::WHITE_BALANCE_INCANDESCENT,
MtkCameraParameters::WHITE_BALANCE_FLUORESCENT, MtkCameraParameters::WHITE_BALANCE_WARM_FLUORESCENT,
MtkCameraParameters::WHITE_BALANCE_DAYLIGHT, MtkCameraParameters::WHITE_BALANCE_CLOUDY_DAYLIGHT,
MtkCameraParameters::WHITE_BALANCE_TWILIGHT, MtkCameraParameters::WHITE_BALANCE_SHADE,
)
)
#endif
//......................................................................
)
调试案例
一些总结:
1.camera读不到id可能的原因: 上电时序不对_没扣好_i2c地址不对_i2c速率不合适_模组打样有问题
2.camera读到id但是没有图像: 驱动版本太老_模组打样有问题
3.37m与37t的kernel层代码是可以公用的
4.37m与37t的hal层代码是不可以公用的 - 格式不一样,无法编译通过
5.同一系列的代码是可以点亮的,如用imx219的代码稍加修改来点亮imx258
6.前摄的点亮常常会受到后摄与后副摄的影响 - 点亮前摄时可以先将它们拔除
案例一 : 前摄gc8024读不到ID - 后摄1335影响
现象 : 单独点亮前摄,代码编译通过之后前摄不亮(后摄未正常工作)
平台 : androidN,MTK6737
排查过程: 1. adb查看是否读到id(cat /dev/driver/camera_info),显示未读到id
2. 查看mtklog(kernel_log.boot),发现因为i2c通讯出错导致读id失败
[344:cameraserver][name:i2c&]: id=2,addr: 10, transfer error
[344:cameraserver][name:i2c&]: I2C_ACKERR
[344:cameraserver][name:kd_sensorlist&][CAMERA SENSOR] I2C send failed!!, Addr = 0x0
[344:cameraserver][name:imx8024mipiraw_Sensor&]imx8024_camera_sensor[get_imgsensor_id] Read sensor id fail, i2c write id: 0x20 id: 0x0
3. 修改上电时序,无作用
4. 将后摄拔掉,前摄成功点亮
处理方案: 先将后摄拔掉,先单独点亮前摄,待后摄也点亮之后再处理
总结 : 后摄,后副摄常常会影响前摄的点亮,在点亮前摄的时候,可以先将后摄与后副摄取下,待前摄点亮再处理
- 原理不明
案例二 : 前摄ov8865读不到ID - 上电时序
现象 : 单点前摄ov8865不亮
平台 : androidN,MTK6737
排查过程: 1. adb查看是否读到id(cat /dev/driver/camera_info),显示未读到id
2. 查看mtklog(kernel_log.boot),发现因为i2c通讯出错导致读id失败
[344:cameraserver][name:i2c&]: id=2,addr: 10, transfer error
[344:cameraserver][name:i2c&]: I2C_ACKERR
[344:cameraserver][name:kd_sensorlist&][CAMERA SENSOR] I2C send failed!!, Addr = 0x0
[344:cameraserver][name:ov8865_mipiraw_Sensor&]ov8865_mipiraw_Sensor[get_imgsensor_id] Read sensor id fail, i2c write id: 0x6c id: 0x0
3. 询问FAE,8865的上电时序RST须先低后高 - 检查上电时序发现没有"后高"的操作
修改上电时序kd_camera_hw.c,三路电压上电之后将RST置高
-> 成功读到id
处理方案: 修改上电时序
总结 : camera读不到id通常都是上电时序的问题,需要找FAE要时序图
案例三 : 前摄ov8865无图像 - 模组打样有问题
现象 : 单点前摄ov8865读到id,但是无图像,点拍照就卡死
平台 : androidN,MTK6737
排查过程: 1. adb查看是否读到id(cat /dev/driver/camera_info),显示已读到id
cat /proc/driver/camera_info
CAM[1]:imx258mipiraw; CAM[2]:ov8865mipiraw;
2. 无图像,怀疑是hal层代码不对,已FAE重新提供的核对,hal没问题
3. jiang工发现前摄fpc线过长(10cm),查看mtklog(kernel_log):
[name:camera_isp_D2&][ISP_D2] Lost pass1 done,P1_SOF_0(0x03134010,0x01100000,0x04500000,0x00000000)
[name:camera_isp_D2&]: Last(0x04500000) == Cur(0x04500000)
[name:camera_isp_D2&][ISP_D2] Lost pass1 done,P1_SOF_0(0x01134010,0x01100000,0x04500000,0x00000000)
[name:camera_isp_D2&]: Last(0x04500000) == Cur(0x04500000)
[name:camera_isp_D2&][ISP_D2] Lost pass1 done,P1_SOF_0(0x02134010,0x01100000,0x04500000,0x00000000)
由log : 出现多次"Lost pass1 done,P1_SOF_0" 可知是MIPI数据丢失导致
4. 最终由FAE与模组厂确认是: mipi排线转接头接错了,camera是4通道的,但是fpc的2通道的,导致mipi数据丢失
-> 将之前使用的FAE提供的4通道驱动 - 改为2通道:
- .mipi_lane_num = SENSOR_MIPI_4_LANE,
+ .mipi_lane_num = SENSOR_MIPI_2_LANE,
- write_cmos_sensor(0x3018,0x72);// ; MIPI 4 lane // 将所有的0x3018寄存器写值改为0x32,有好几个地方
+ write_cmos_sensor(0x3018,0x32);// ; MIPI 2 lane
-> 前摄ov8865成功点亮
处理方案: 由于4lane的camera错打样为2lane,故把驱动也改为2lane
总结 : mipi是高速数据,fpc线不宜过长
mipi数据丢失有两种可能:
1 mipi线过长
2 mipi线不对(错位或漏接)
3 驱动中preview 窗口配置不对(寄存器)
案例四 : 前摄ov8865拍照照片是花的 - 模组打样有问题
现象 : 照片是花的(camera是4lane,但是fpc排线是2lane,就先将驱动改为2lane)
平台 : androidN,MTK6737
排查过程: 1.由FAE更改驱动中几个参数 - 无改善
2.将mtklog发给总监,指出kernel_log以下内容显示mipi数据丢失:
[name:camera_isp_D2&][ISP_D2] P1_SOF_0(0x01134010,0x01100000,0x04500000,0x00000000)
[name:camera_isp_D2&][ISP_D2] P1_SOF_1(0x02234010,0x01100000,0x04900000,0x00000000)
[name:camera_isp_D2&][ISP_D2] P1_SOF_2(0x03334010,0x01100000,0x04d00000,0x00000000)
[name:camera_isp_D2&][ISP_D2] P1_SOF_3(0x01334011,0x01100000,0x04500000,0x00000000)
- 总监指出"P1_SOF_3" 表示数据丢失
- 存疑: 但是这边并没有多次出现,应该不是数据丢失
3.更换camera模组(fpc排线更换为4lane,驱动改回为4lane)
-> 拍照花屏问题解决
-> 但查看kernel_log,还是有“P1_SOF_0” - 存疑 - 需要研读camera_isp代码
处理方案: 更换camera的fpc排线为正常排线
总结 : camera的fpc线也是经常出问题的地方
需要研读camera_isp代码
案例五 : 后摄imx258的af(ad5820)无功能 - android.mk需要配置
现象 : af无功能
平台 : androidN,MTK6737
排查过程: 1. 查看out目录 - 发现有编译生产相应.o文件
2. 在alps\kernel-3.18\drivers\misc\mediatek\lens\main\main_lens.c (架构)和相应驱动中打印log,发现架构有跑,但驱动没跑:
mtklog:
5820 ARCH: AF_SetMotorName
5820 strcmp g_stAF_DrvList[0].uDrvName AD5820AF
5820 strcmp stMotorName.uMotorName = Dummy
-> 【hal层传下来的af是Dummy】(即无af)- 定位到问题出在hal层
3. 查看hal层,怀疑是【[#if defined(AD5820AF)]这个宏没开】,测试->果然没开
修改:alps\vendor\mediatek\proprietary\custom\mt6735\hal\D2\lens\lenslist.cpp
MSDK_LENS_INIT_FUNCTION_STRUCT LensList_main[MAX_NUM_OF_SUPPORT_LENS] =
{
{DUMMY_SENSOR_ID, DUMMY_LENS_ID, "Dummy", pDummy_getDefaultData},
+ //#if defined(AD5820AF)
+ // {OV5648MIPI_SENSOR_ID, AD5820AF_LENS_ID, "AD5820AF", pAD5820AF_getDefaultData},
{IMX258_SENSOR_ID, AD5820AF_LENS_ID, "AD5820AF", pAD5820AF_getDefaultData},
+ //#endif
4. 编译报错,修改alps\vendor\mediatek\proprietary\custom\mt6735\hal\D2\lens\Android.mk
+ LOCAL_SRC_FILES += lens_para_AD5820AF.cpp
-> 后摄af(ad5820)正常工作
处理方案: 修改lenslist.cpp
总结 : 这里的宏,本应由编译脚本开,不知为何没开,干脆先写死为开
案例六 : 前摄ov8865的af(dw9718)无功能 - 多处需要配置
现象 : af无功能
平台 : androidN,MTK6737
排查过程: 1. 查看hal层即kernel发现有相应文件,修改编译脚本(即修改ProjectConfig.mk和***_defconfig),
编译查看out目录有生成相应.o文件
修改alps\vendor\mediatek\proprietary\custom\mt6735\hal\D2\lens\Android.mk
+ LOCAL_SRC_FILES += lens_para_DW9718AF.cp
修改alps\vendor\mediatek\proprietary\custom\mt6735\hal\D2\lens\lenslist.cpp
MSDK_LENS_INIT_FUNCTION_STRUCT LensList_sub[MAX_NUM_OF_SUPPORT_LENS] =
{
+ //#if defined(DW9718AF)
{OV8865_SENSOR_ID, DW9718AF_LENS_ID, "DW9718AF", pDW9718AF_getDefaultData},
+ //#endif
2. 在前摄af的架构和驱动中添加log,查看mtklog,发现无任何相关log打印
3. 查看串口log发现,架构有跑,但是i2c匹配不到(没有跑i2c_probe),【查看dws,缺少前摄af】,修改dws
添加:
CAMERA_SUB_AF I2C_CHANNEL_2 0x0c(由于i2c地址写死在驱动,这边随意写一个)
4. 查看mtklog,发现i2c通讯失败:
mtklog:
9718: s4AF_WriteReg // 我在驱动中加的printk
id=2,addr: c, transfer error
I2C_ACKERR
检查硬件原理图->是i2c总线2没错,询问硬件王工,是【af上电端需要贴一个电阻】。贴上电阻
->前摄af(dw9718)正常工作
处理方案: 修改编译脚本,android.mk,lenslist.cpp,dws,硬件贴电阻
总结 : 公司首次调试前摄af,多处需要配置
案例七 : 前摄(gc2385)卡顿 - 后副摄mipi干扰
现象 : 能动但是很卡顿
平台 : androidN,MTK6737
排查过程: 1. adb查看是否读到id(cat /dev/driver/camera_info),显示已读到id
2. 把后副摄(gc0310)拔掉后正常
3. 询问jiang工,原因为后副摄打样的时候mipi线没有去掉,造成mipi信号干扰
处理方案: 重新打样后副摄(gc0310)
总结 : 后副摄(gc0310)只通过YUV读取亮度值,不需要mipi,为了不对前摄造成干扰,需要把mipi线去掉
后记 : 换了一个已去掉mipi线的其他项目的后副摄,还是会导致前摄卡顿 - ???
案例八 : 前摄(gc2385)无功能 - 前摄座子没扣好 - 有点尴尬
现象 : 读不到ID
平台 : androidN,MTK6737
排查过程: 1. adb查看是否读到id(cat /dev/driver/camera_info),显示未读到id
2. 本来准备把后摄及后副摄拔出,看是否有影响,偶然发现前摄没扣好,扣好之后正常
->结构原因,导致前摄扣好后容易松动(主板一按压就会松动)
处理方案: 改结构
总结 : 由于前摄不好观察扣没扣好,是读不到ID的一个可能性
案例九 : 前摄(3h2)无功能 - i2c地址不对,且版本太老
现象 : 读不到ID
平台 : androidN,MTK6780
排查过程: 1. adb查看是否读到id(cat /dev/driver/camera_info),显示未读到id
2. 检查上电时序,并接示波器查看上电时序,没有问题
3. 在驱动中i2c地址的数组中添加i2c地址 -> 成功读到id
但是无图像
4. 由FAE更换一份驱动 -> ok
处理方案: 更换一份驱动
总结 : 驱动版本太老,老旧的版本中连i2c地址都不对(老旧的版本是客户提供)
案例十 : 后摄(imx135)读不到ID - i2c地址不对
现象 : 读不到ID
平台 : androidN,MTK6737
排查过程: 1. adb查看是否读到id(cat /dev/driver/camera_info),显示未读到id
2. 检查上电时序,没有问题
3. 在驱动中i2c地址的数组中添加一个i2c地址 -> 成功读到id,并有图像
案例十一 : 前摄(ov509即imx190 - 驱动用ov509)读不到ID - 模组问题,用其他项目的摄像头ok - 重新打样
平台 : androidN,MTK6737
排查过程: 1. adb查看是否读到id(cat /dev/driver/camera_info),显示未读到id
2. 由于这个IC的摄像头经常用,驱动和上电不会有问题,怀疑是单体问题
3. 更换模组 -> 前摄点亮
处理方案:
总结 : 模组问题,具体是什么问题不清楚,可能是mipi线接错
案例十二 : 前摄(ov509即imx190 - 驱动用ov509)读不到ID - 主板问题 - 读出来的寄存器有问题
平台 : androidN,MTK6737
排查过程: 1. adb查看是否读到id(cat /dev/driver/camera_info),显示未读到id
2. 由于这个IC的摄像头经常用,驱动和上电不会有问题,怀疑是模组问题
3. 更换新模组,也不行,在读ID的地方添加打印log:
static kal_uint32 return_sensor_id(void)
{
+ printk("ov509s (read_cmos_sensor(0x0000) = 0x%x\n", (read_cmos_sensor(0x0000)));
+ printk("ov509s (read_cmos_sensor(0x0001) = 0x%x\n", (read_cmos_sensor(0x0001)));
return ((read_cmos_sensor(0x0000) << 8) | read_cmos_sensor(0x0001));
}
1.0的主板:
ov509s (read_cmos_sensor(0x0000) = 0x0
ov509s (read_cmos_sensor(0x0001) = 0x90
1.1的主板(在1.0的主板基础上改了硬件):
ov509s (read_cmos_sensor(0x0000) = 0x1
ov509s (read_cmos_sensor(0x0001) = 0x90
按理说应该读到0x190,实际上有的主板读到0x90,有的主板读到0x190,导致读ID判断为失败
4. 修改驱动,读ID为0x90或0x190,都让它通过
sensor_id = return_sensor_id();
- if (sensor_id == 0x90) {
+ if ((sensor_id == 0x90) || (sensor_id == 0x190)) {
总结 : 主板问题 - 具体是何问题未能找到
案例十三 : 编译报错 - 兼容过多摄像头(最多16个)
平台 : androidN,MTK6737
排查过程: 1. 编译报错log:
alps/kernel-3.18/drivers/misc/mediatek/imgsensor/src/mt6580/kd_sensorlist.h:564:5: error: excess elements in array initializer
2. ACDK_KD_SENSOR_INIT_FUNCTION_STRUCT kdSensorList[MAX_NUM_OF_SUPPORT_SENSOR] =
{
#if defined(IMX220_MIPI_RAW)
{IMX220_SENSOR_ID, SENSOR_DRVNAME_IMX220_MIPI_RAW, IMX220_MIPI_RAW_SensorInit},
#endif
#if defined(IMX219_MIPI_RAW)
{IMX219_SENSOR_ID, SENSOR_DRVNAME_IMX219_MIPI_RAW, IMX219_MIPI_RAW_SensorInit},
#endif
3. kernel-3.18/drivers/misc/mediatek/imgsensor/inc/kd_imgsensor_define.h
- #define MAX_NUM_OF_SUPPORT_SENSOR 16
+ #define MAX_NUM_OF_SUPPORT_SENSOR 18
总结 : 同样的问题后来在AF(len)中也遇到了
案例十四 : 后副摄(gc0310)装上之后,后摄(ov8858)读不到id - i2c地址(0x42)相同(同一条i2c总线(总线2))
平台 : androidN,MTK6737
排查过程: 1. adb查看是否读到id(cat /dev/driver/camera_info),显示未读到id
2. 一波检查
3. 对比37,同样ov8858+gc0310可以点亮,查看硬件差异
37的8858在i2c总线0,0310在i2c总线2
80的8858在i2c总线0,0310在i2c总线0
4. 可以让模组厂改ov8858的i2c地址,但是客户选择换掉8858
案例十五 : 待机电流过大(18ma) - 后副摄(gc0310)没有休眠 - 掉电时序
现象 : 整机待机电流正常(7ma),摄像头打开再关闭灭屏后整机待机电流过大(18ma)
平台 : androidN,MTK6737
排查过程: 1. 一个有后副摄,一个没有后副摄对照,发现无后副摄的机器电流正常
2. 引出后副摄的RST 与PDN脚,用万用表测量打开载关闭灭屏之后的电平 - 低
3. 对照gc0310的芯片手册 - PDN脚为高时休眠
4. 掉电时序中将PDN脚拉高
- mtkcam_gpio_set(pinSetIdx, CAMPDN, pinSet[pinSetIdx][IDX_PS_CMPDN + IDX_PS_ON]); // 拉低 前面进行翻转
+ mtkcam_gpio_set(pinSetIdx, CAMPDN, pinSet[pinSetIdx][IDX_PS_CMPDN + IDX_PS_OFF]); // 拉高
5. 改掉电时序之后还是一样电流大,怀疑没跑到,修改的代码中添加log -> log没打印
询问姜工后,修改alps\kernel-3.18\drivers\misc\mediatek\imgsensor\src\mt6735m\kd_sensorlist.c:
在kd_MultiSensorClose()函数中,打开后副摄掉电时序:
- #ifdef CONFIG_KST_DUAL_CAM_YUV0
+ #if ((defined CONFIG_KST_DUAL_CAM_YUV0) || (defined CONFIG_KST_BOARD_V666))
6. log还是没打印,修改掉电时序中: (均打印得知:后副摄 pinSetIdx == 2)
- if((pinSetIdx == 0)&&(currSensorName && (0 == strcmp(SENSOR_DRVNAME_GC0310_MIPI_YUV, currSensorName))))
+ if((pinSetIdx == 2)&&(currSensorName && (0 == strcmp(SENSOR_DRVNAME_GC0310_MIPI_YUV, currSensorName))))
处理方案: 修改掉电时序
案例十六 : 概率性读不到ID - 降i2c速率(从300 降为 100)
平台 : androidN,MTK6580
处理方案: static imgsensor_info_struct imgsensor_info = {
- .i2c_speed = 300, // i2c read/write speed
+ .i2c_speed = 100, // i2c read/write speed
};
案例十七 : 后摄AF(9714)对焦无功能 - 模组AF供电脚短地 - 改模组
平台 : androidM,MTK6580
排查过程: 1. 检查上电kd_camera_hw.c,有2.8v的AF上电
2. 检查hal层lenslist.cpp,配置正常
#if defined(DW9714AF)
{S5K3H7YX_SENSOR_ID, DW9714AF_LENS_ID, "DW9714AF", pDW9714AF_getDefaultData},
#endif
3. 在驱动DW9714AF.c中添加log:
moveAF() // 三个函数均未能跑到
s4AF_ReadReg()
s4AF_WriteReg()
4. 万用表测量主板AF脚电压:2.8v正常
5. 将摄像头模组装上,但不扣到主板卡槽上,对焦正常
==> 摄像头模组AF供电脚与导电外壳短路,导致AF供电不正常(2.8v 接地)
处理方案: 暂时给模组贴绝缘胶布,后期改模组
平台 : androidL,MTK6580
排查过程: 1. 收到工厂样机两台,经硬件交叉验证,问题跟着屏走。有问题的屏不管前摄后摄都是偏红的,换一个屏就ok了
总结 : 不同LCD 个体显示屏色差引起的Camera 预览偏色(如偏红等)!
案例十九 : 兼容两个GC2235后摄(带AF和不带AF), 不带AF的对焦卡死 - 分开出软件
平台 : androidL,MTK6580
排查过程: 1. 此项目兼容了两个GC2235(带AF和不带AF), 带AF的摄像头正常,不带的对焦卡死,且无法拍照
2. 原因分析: 驱动中配置带AF,但摄像头又不带,AF功能一直处于使能状态,实际又无法对焦,
导致机器一直处于对焦过程中,此处由于MTK Camera流程处理,目前无法修改!
处理方案: 由于ID完全相同,又都是后摄,无法从软件上区分,故分开出两版软件
案例二十 : 后摄(gc8034)无法连接CCT(MTK 专用调cam参数工具) - config缺分辨率800x600
平台 : androidN,MTK6737
排查过程: 1. 后摄(gc8034)无法连接CCT,但前摄可以
2. 更换兼容的其他后摄(imx219)可以连接
3. 在mtk-online查到“[FAQ13479] [Camera Tuning]CCT常见问题总结”
CCT无法连接,可以进入meta mode,无法显示预览画面
log中若发现如下error,请在config.ftbl..h 文件的preview size中添加1280x720,问题解决
E/AcdkMhalEng( 215):{#939:mediatek/platform/mt6752/hardware/mtkcam/acdk/src/acdk/AcdkMhalEng.cpp}Err : Prv Size : 1280x720 is not supported. Try 640x480,
【Root cause】找不到匹配的预览size导致无法连接
建议在修改config.ftbl.“sensorname”.h文件时,在不知道CCT previewsize是多大的情况下,先不要删除下面这5个size,320x240,640x480,800x600,960x540,1280x720以免造成cct无法连接问题
4. logcat: 显示
01-01 00:13:49.876 227 261 D MtkCam/PrvCB: (261)[PreviewClient] + this(0x7c6a788000)
01-01 00:13:49.885 227 261 D AcdkMhalEng: [acdkMhalPreviewStart] Prv Size: 800x600; PrvList: 176x144,320x240,352x288,480x320,480x368,640x480,720x480,800x480,1120x840,864x480,960x540,1280x720,1440x1080,1920x1080,1920x1088
01-01 00:13:49.886 227 261 E AcdkMhalEng: {#943:vendor/mediatek/proprietary/hardware/mtkcam/legacy/platform/mt6735m/acdk/src/acdk/AcdkMhalEng.cpp}Err : Prv Size : 800x600 is not supported. Try 640x480
5. 添加分辨率 800x600,==>ok
案例二十一 : 前摄2385s读不到ID -- I2C总线不对
平台 : androidO,MTK6739
排查过程: 1. 新主板新平台,根据串口log读,i2c不通导致camera读不到id
2. 根据原理图,dws中将“i2c”修改为
Slave Device Channel Device Address
- CAMERA_SUB I2C_CHANNEL_0 0x3C
+ CAMERA_SUB I2C_CHANNEL_2 0x3C
案例二十二 : 前摄5025s 开机能读到ID, 打开读不到ID -- mclk配置不正确(实际原理图为mclk0 错配成mclk1-默认mclk1)
平台 : androidO,MTK6739
排查过程: 1. 开机能读到id
cat /proc/driver/camera_info
CAM[1]:gc8024mipi_raw; CAM[2]:gc5025smipiraw;
对应开机读id log:
// 读后摄的时候会遍历所有前后摄,读前摄的时候也会
D [ 43.585714].(2)[422:camerahalserver][name:kd_sensorlist&][kd_sensorlist][kdSetDriver] pD0x00010000/0x00000000 // pD0x00010000中的1代表前摄
D [ 43.585744].(2)[422:camerahalserver][name:kd_sensorlist&]: [kd_sensorlist][kdSetDriver] g_invokeSocketIdx[0]=1,drvIdx[0]=0
D [ 43.585762].(2)[422:camerahalserver][name:kd_sensorlist&]: [kd_sensorlist][kdSetDriver] [0][1][1][gc8024mipi_raw]
D [ 43.585908].(2)[422:camerahalserver][name:camera_isp_D1&]: [ISP]ISP_MCLK1_EN(-1610612735), mMclk1User(1)
D [ 43.585945].(2)[422:camerahalserver][name:kd_camera_hw&][kd_camera_hw][PowerON]pinSetIdx0, currSensorName: gc8024mipi_raw
D [ 43.593239].(2)[422:camerahalserver][name:kd_camera_hw&]: [kd_camera_hw]PinIdx(0) PwrType(0) val(1) // 后摄 CAMRST 置1 - 上电操作
D [ 43.593276].(2)[422:camerahalserver][name:kd_camera_hw&]: [kd_camera_hw]PinIdx(0) PwrType(1) val(0) // 后摄 CAMPDN 置0
D [ 43.728939].(0)[422:camerahalserver][name:kd_camera_hw&][kd_camera_hw][PowerON]pinSetIdx0, currSensorName: gc8024mipi_raw
D [ 43.728971].(0)[422:camerahalserver][name:kd_camera_hw&]: [kd_camera_hw]PinIdx(0) PwrType(0) val(0) // 后摄 CAMRST 置0
D [ 43.730993].(0)[422:camerahalserver][name:kd_camera_hw&]: [kd_camera_hw]PinIdx(0) PwrType(1) val(1) // 后摄 CAMPDN 置1
W [ 43.764205].(0)[422:camerahalserver]: feature_id = 3041 // 上电操作后有hal通过ioctl发送读id命令
W [ 43.771682].(1)[422:camerahalserver]: liuzhigou [gc8024]i2c write id: 0x6e, sensor id: 0x8024 // 成功读到id
W [ 43.772779].(1)[422:camerahalserver]: zlb i2c write id: 0x6e, sensor id: 0x8024
W [ 43.773713].(1)[422:camerahalserver]: i2c write id: 0x6e, sensor id: 0x8024
D [ 43.778988].(1)[422:camerahalserver][name:kd_camera_hw&]: [kd_camera_hw]PinIdx(0) PwrType(0) val(0) // 后摄 CAMRST 置0 - 掉电操作
D [ 43.779019].(1)[422:camerahalserver][name:kd_camera_hw&]: [kd_camera_hw]PinIdx(0) PwrType(1) val(0) // 后摄 CAMPDN 置0
D [ 43.878021].(1)[422:camerahalserver][name:kd_sensorlist&][kd_sensorlist][kdSetDriver] pD0x00010001/0x00000000 // pD0x00010001中后面的1代表第1个摄像头
D [ 43.878045].(1)[422:camerahalserver][name:kd_sensorlist&]: [kd_sensorlist][kdSetDriver] g_invokeSocketIdx[0]=1,drvIdx[0]=1
D [ 43.878063].(1)[422:camerahalserver][name:kd_sensorlist&]: [kd_sensorlist][kdSetDriver] [0][1][1][gc5025smipiraw]
D [ 43.878095].(1)[422:camerahalserver][name:camera_isp_D1&]: [ISP]ISP_MCLK1_EN(-1610612735), mMclk1User(1)
D [ 43.878110].(1)[422:camerahalserver][name:kd_camera_hw&][kd_camera_hw][PowerON]pinSetIdx0, currSensorName: gc5025smipiraw
D [ 43.917914].(1)[422:camerahalserver][name:gc5025smipi_Sensor&]: GC5025S_camera_sensor[feature_control] feature_id = 3041
W [ 43.933729].(0)[422:camerahalserver]: liuzhigou [gc5025s]i2c write id: 0x6e, sensor id: 0x0 // 未上电直接读id - 读id失败
W [ 43.967798].(0)[422:camerahalserver]: liuzhigou [gc5025s]i2c write id: 0x6e, sensor id: 0x0
D [ 43.977578].(0)[422:camerahalserver][name:kd_camera_hw&][kd_camera_hw][PowerOFF]pinSetId0 // pinSetId0 - 代表后摄
D [ 43.979945].(0)[422:camerahalserver][name:kd_camera_hw&]: [kd_camera_hw]PinIdx(0) PwrType(0) val(0) // 掉电操作
D [ 43.979965].(0)[422:camerahalserver][name:kd_camera_hw&]: [kd_camera_hw]PinIdx(0) PwrType(1) val(0)
D [ 43.980785].(0)[422:camerahalserver][name:kd_sensorlist&][kd_sensorlist][kdSetDriver] pD0x00020000/0x00000000 // pD0x00020000中的2代表前摄
D [ 43.980796].(0)[422:camerahalserver][name:kd_sensorlist&]: [kd_sensorlist][kdSetDriver] g_invokeSocketIdx[0]=2,drvIdx[0]=0
D [ 43.980805].(0)[422:camerahalserver][name:kd_sensorlist&]: [kd_sensorlist][kdSetDriver] [0][1][2][gc8024mipi_raw]
D [ 43.980837].(0)[422:camerahalserver][name:camera_isp_D1&]: [ISP]ISP_MCLK1_EN(-1610612735), mMclk1User(1)
D [ 43.980840].(0)[422:camerahalserver][name:kd_camera_hw&][kd_camera_hw][PowerON]pinSetIdx1, currSensorName: gc8024mipi_raw // pinSetIdx1 - 代表前摄
W [ 44.064789].(0)[422:camerahalserver]: liuzhigou [gc8024]i2c write id: 0x6e, sensor id: 0x0 // 未上电直接读id - 读id失败
W [ 44.065337].(0)[422:camerahalserver]: liuzhigou [gc8024]i2c write id: 0x6e, sensor id: 0x0
D [ 44.065359].(0)[422:camerahalserver][name:kd_camera_hw&][kd_camera_hw][PowerOFF]pinSetId1 // pinSetId1 - 代表前摄
D [ 44.067722].(0)[422:camerahalserver][name:kd_camera_hw&]: [kd_camera_hw]PinIdx(1) PwrType(0) val(0) // 掉电操作
D [ 44.067742].(0)[422:camerahalserver][name:kd_camera_hw&]: [kd_camera_hw]PinIdx(1) PwrType(1) val(0)
D [ 44.068548].(0)[422:camerahalserver][name:kd_sensorlist&][kd_sensorlist][kdSetDriver] pD0x00020001/0x00000000 // pD0x00020001中的1代表第1个摄像头
D [ 44.068559].(0)[422:camerahalserver][name:kd_sensorlist&]: [kd_sensorlist][kdSetDriver] g_invokeSocketIdx[0]=2,drvIdx[0]=1
D [ 44.068568].(0)[422:camerahalserver][name:kd_sensorlist&]: [kd_sensorlist][kdSetDriver] [0][1][2][gc5025smipiraw]
D [ 44.068598].(0)[422:camerahalserver][name:camera_isp_D1&]: [ISP]ISP_MCLK1_EN(-1610612735), mMclk1User(1)
D [ 44.068601].(0)[422:camerahalserver][name:kd_camera_hw&][kd_camera_hw][PowerON]pinSetIdx1, currSensorName: gc5025smipiraw // pinSetIdx1 - 代表前摄
D [ 44.086775].(0)[422:camerahalserver][name:kd_camera_hw&]: [kd_camera_hw]PinIdx(1) PwrType(0) val(0) // 上电操作
D [ 44.086795].(0)[422:camerahalserver][name:kd_camera_hw&]: [kd_camera_hw]PinIdx(1) PwrType(1) val(0)
D [ 44.202737].(0)[422:camerahalserver][name:kd_camera_hw&][kd_camera_hw][PowerON]pinSetIdx1, currSensorName: gc5025smipiraw
D [ 44.202772].(0)[422:camerahalserver][name:kd_camera_hw&]: [kd_camera_hw]PinIdx(0) PwrType(1) val(0)
D [ 44.202791].(0)[422:camerahalserver][name:kd_camera_hw&]: [kd_camera_hw]PinIdx(0) PwrType(0) val(0)
D [ 44.202798].(0)[422:camerahalserver][name:kd_camera_hw&]: [kd_camera_hw][PowerON] poweroff_rst_pdn_flag is true, currSensorName: gc5025smipiraw
D [ 44.236267].(0)[422:camerahalserver][name:kd_camera_hw&]: [kd_camera_hw]PinIdx(1) PwrType(0) val(1)
D [ 44.238312].(0)[422:camerahalserver][name:kd_camera_hw&]: [kd_camera_hw]PinIdx(1) PwrType(1) val(1)
D [ 44.273985].(0)[422:camerahalserver][name:gc5025smipi_Sensor&]: GC5025S_camera_sensor[feature_control] feature_id = 3041
W [ 44.291684].(0)[422:camerahalserver]: liuzhigou [gc5025s]i2c write id: 0x6e, sensor id: 0x5025 // 成功读到id
W [ 44.293948].(0)[422:camerahalserver]: [gc5025s]i2c write id: 0x6e, sensor id: 0x5026
D [ 44.300272].(0)[422:camerahalserver][name:kd_camera_hw&]: [kd_camera_hw]PinIdx(1) PwrType(0) val(0) // 掉电操作
D [ 44.300303].(0)[422:camerahalserver][name:kd_camera_hw&]: [kd_camera_hw]PinIdx(1) PwrType(1) val(0)
对应开机后打开camera读id log:
D [ 225.717116] (1)[3868:initCamdevice][name:kd_sensorlist&]: [kd_sensorlist][kdSetDriver] pDrvIndex:0x00010000/0x00020001
D [ 225.717148] (1)[3868:initCamdevice][name:kd_sensorlist&]: [kd_sensorlist][kdSetDriver] g_invokeSocketIdx[0]=1,drvIdx[0]=0
D [ 225.717167] (1)[3868:initCamdevice][name:kd_sensorlist&]: [kd_sensorlist][kdSetDriver] [0][1][1][gc8024mipi_raw]
D [ 225.717186] (1)[3868:initCamdevice][name:kd_sensorlist&]: [kd_sensorlist][kdSetDriver] g_invokeSocketIdx[1]=2,drvIdx[1]=1
D [ 225.717204] (1)[3868:initCamdevice][name:kd_sensorlist&]: [kd_sensorlist][kdSetDriver] [1][1][2][gc5025smipiraw]
W [ 225.717310] (1)[3868:initCamdevice]: feature_id = 3003
W [ 225.717362] (1)[3868:initCamdevice]: feature_id = 3002
D [ 225.721100] (1)[3868:initCamdevice][name:camera_isp_D1&]: [ISP]ISP_MCLK1_EN(-1610612735), mMclk1User(1)
D [ 225.721127] (1)[3868:initCamdevice][name:kd_camera_hw&]: [kd_camera_hw][PowerON]pinSetIdx:0, currSensorName: gc8024mipi_raw
D [ 225.735985] (3)[3868:initCamdevice][name:kd_camera_hw&]: [kd_camera_hw]PinIdx(0) PwrType(0) val(1) // 后摄 CAMRST 置1 - 上电操作
D [ 225.736025] (3)[3868:initCamdevice][name:kd_camera_hw&]: [kd_camera_hw]PinIdx(0) PwrType(1) val(0) // 后摄 CAMPDN 置0
E [ 225.853008] (1)[422:camerahalserver][name:ion_mm_heap&]: [ION]warn: ion mm heap allocate buffer size: 40960 time: 18425384 ns --10
D [ 225.862087] (3)[3827:mediatek.camera]: mtk_cooler_cam: [name:mtk_cooler_cam&]thermal/cooler/cam _cl_cam_read 0
D [ 225.876965] (2)[3868:initCamdevice][name:kd_camera_hw&]: [kd_camera_hw][PowerON]pinSetIdx:0, currSensorName: gc8024mipi_raw
D [ 225.877016] (2)[3868:initCamdevice][name:kd_camera_hw&]: [kd_camera_hw]PinIdx(0) PwrType(0) val(0) // 后摄 CAMRST 置0
D [ 225.883235] (2)[3868:initCamdevice][name:kd_camera_hw&]: [kd_camera_hw]PinIdx(0) PwrType(1) val(1) // 后摄 CAMPDN 置1
I [ 225.891334] (0)[1118:tx_thread][name:wlan_drv_gen2&]: [wlan]nicRxProcessEventPacket:(RX INFO) [F-L]Profile=0x24,BaIdx=0 (0001000)
W [ 225.908974] (2)[3868:initCamdevice]: GC8024,MIPI 2LANE
W [ 225.912013] (2)[3868:initCamdevice]: liuzhigou [gc8024]i2c write id: 0x6e, sensor id: 0x8024
W [ 225.912039] (2)[3868:initCamdevice]: i2c write id: 0x6e, sensor id: 0x8024
D [ 235.259546] (2)[3936:HwBinder:422_3][name:kd_camera_hw&]: [kd_camera_hw][PowerOFF]pinSetIdx:0
D [ 235.261615] (2)[3936:HwBinder:422_3][name:camera_isp_D1&]: [ISP]ISP_MCLK1_EN(-2147483647), mMclk1User(0)
D [ 235.261652] (2)[3936:HwBinder:422_3][name:kd_camera_hw&]: [kd_camera_hw]PinIdx(0) PwrType(0) val(0)// 后摄 CAMRST 置0 - 掉电操作 - 切换为前摄时
D [ 235.261682] (2)[3936:HwBinder:422_3][name:kd_camera_hw&]: [kd_camera_hw]PinIdx(0) PwrType(1) val(0)// 后摄 CAMPDN 置0
D [ 235.403996] (1)[3955:initCamdevice][name:kd_sensorlist&]: [kd_sensorlist][kdSetDriver] pDrvIndex:0x00010000/0x00020001
D [ 235.404027] (1)[3955:initCamdevice][name:kd_sensorlist&]: [kd_sensorlist][kdSetDriver] g_invokeSocketIdx[0]=1,drvIdx[0]=0
D [ 235.404047] (1)[3955:initCamdevice][name:kd_sensorlist&]: [kd_sensorlist][kdSetDriver] [0][1][1][gc8024mipi_raw]
D [ 235.404065] (1)[3955:initCamdevice][name:kd_sensorlist&]: [kd_sensorlist][kdSetDriver] g_invokeSocketIdx[1]=2,drvIdx[1]=1
D [ 235.404083] (1)[3955:initCamdevice][name:kd_sensorlist&]: [kd_sensorlist][kdSetDriver] [1][1][2][gc5025smipiraw]
D [ 235.404133] (1)[3955:initCamdevice][name:gc5025smipi_Sensor&]: GC5025S_camera_sensor[feature_control] feature_id = 3003
D [ 235.404181] (1)[3955:initCamdevice][name:gc5025smipi_Sensor&]: GC5025S_camera_sensor[feature_control] feature_id = 3002
D [ 235.405280] (0)[3955:initCamdevice][name:camera_isp_D1&]: [ISP]ISP_MCLK1_EN(536870913), mMclk1User(1)
D [ 235.405306] (0)[3955:initCamdevice][name:kd_camera_hw&]: [kd_camera_hw][PowerON]pinSetIdx:1, currSensorName: gc5025smipiraw
D [ 235.410518] (2)[3955:initCamdevice][name:kd_camera_hw&]: [kd_camera_hw]PinIdx(1) PwrType(0) val(0) // 前摄 CAMRST 置0
D [ 235.410552] (2)[3955:initCamdevice][name:kd_camera_hw&]: [kd_camera_hw]PinIdx(1) PwrType(1) val(0) // 前摄 CAMPDN 置0
D [ 235.458536] (2)[3955:initCamdevice][name:kd_camera_hw&]: [kd_camera_hw][PowerON]pinSetIdx:1, currSensorName: gc5025smipiraw
D [ 235.458595] (2)[3955:initCamdevice][name:kd_camera_hw&]: [kd_camera_hw]PinIdx(0) PwrType(1) val(0) // 操作后摄?
D [ 235.458622] (2)[3955:initCamdevice][name:kd_camera_hw&]: [kd_camera_hw]PinIdx(0) PwrType(0) val(0)
D [ 235.458639] (2)[3955:initCamdevice][name:kd_camera_hw&]: [kd_camera_hw][PowerON] poweroff_rst_pdn_flag is true, currSensorName: gc5025smipiraw
D [ 235.468709] (2)[3955:initCamdevice][name:kd_camera_hw&]: [kd_camera_hw]PinIdx(1) PwrType(0) val(1) // 前摄 CAMRST 置1
D [ 235.470751] (2)[3955:initCamdevice][name:kd_camera_hw&]: [kd_camera_hw]PinIdx(1) PwrType(1) val(1) // 前摄 CAMPDN 置1
D [ 235.480881] (2)[3955:initCamdevice][name:gc5025smipi_Sensor&]: GC5025S_camera_sensor[open] GC5025S,MIPI 2LANE
E [ 235.481997] (3)[3955:initCamdevice][name:i2c&]: ERROR,510: id=2,addr: 37, transfer error // 前摄读不到id
E [ 235.482888] (3)[3955:initCamdevice][name:i2c&]: ERROR,510: id=2,addr: 37, transfer error
E [ 235.483672] (3)[3955:initCamdevice][name:i2c&]: ERROR,510: id=2,addr: 37, transfer error
E [ 235.485426] (2)[3955:initCamdevice][name:i2c&]: ERROR,510: id=2,addr: 37, transfer error
W [ 235.485669] (2)[3955:initCamdevice]: liuzhigou [gc5025s]i2c write id: 0x6e, sensor id: 0x0
D [ 235.485689] (2)[3955:initCamdevice][name:gc5025smipi_Sensor&]: GC5025S_camera_sensor[open] Read sensor id fail, write id: 0x6e, id: 0x0
D [ 235.485707] (2)[3955:initCamdevice][name:kd_camera_hw&]: [kd_camera_hw][PowerOFF]pinSetIdx:1
2. 最后jiang工发现mtk默认代码前摄为mclk2,而原理图为mclk1
修改代码:alps\vendor\mediatek\proprietary\custom\mt6735\hal\D1\imgsensor_src\cfg_setting_imgsensor.cpp
MINT32 getSensorMclkConnection(EDevId const eDevId)
{
switch (eDevId)
{
case eDevId_ImgSensor0://main
- return eMclk_1;
case eDevId_ImgSensor1://sub
- return eMclk_2;
case eDevId_ImgSensor2://3d
- return eMclk_3;
+ return eMclk_1; // 修改为所有camera均走mclk1
default:
break;
}
return -1;
}
==> ok
案例二十三 : 前摄(GC2385)开启EIS,录制的效果很暗,几乎看不清视频画面
平台 : androidO,MTK6737M
排查过程: 1. 根据mtk-online修改
vendor/mediatek/proprietary/custom/mt6735/hal/D2/camera/camera_custom_eis.cpp
bool GetEisLinkWithDfr()
{
- return true; // true : dynamic frame rate off when eis on; false : dynamic frame rate on when eis on
+ return false; // true : dynamic frame rate off when eis on; false : dynamic frame rate on when eis on
}
案例二十四 : 未能正常点亮摄像头 - 未执行读取camera sensor id的函数(mtklog)
平台 : androidO,MTK6739
排查过程: 1. 抓取mtklog,发现连读取camera sensor id的函数都未执行
2. 打印串口log,跟踪摄像头上电代码,发现由于camera sensor名配置不匹配,导致在开机过程中遍历摄像头时并未给相应的摄像头上电
3. 根据ProjectConfig.mk中配置的"ov509_mipi_raw"
修改
alps_o1_mp1/update/alps/kernel-4.4/drivers/misc/mediatek/imgsensor/inc/kd_imgsensor.h
alps_o1_mp1/update/alps/device/mediatek/common/kernel-headers/kd_imgsensor.h
#define SENSOR_DRVNAME_OV509_MIPI_RAW "ov509_mipi_raw"
4. 读ID流程:
alps/kernel-4.4/drivers/misc/mediatek/imgsensor/src/common/v1/imgsensor.c
int imgsensor_set_driver(struct IMGSENSOR_SENSOR *psensor)
{
u32 drv_idx = 0;
int ret = -EIO;
struct IMGSENSOR_SENSOR_INST *psensor_inst = &psensor->inst;
struct IMGSENSOR_INIT_FUNC_LIST *pSensorList = kdSensorList;
// kdSensorList在imgsensor_sensor_list.c和imgsensor_sensor_list.h中定义
#define TOSTRING(value) #value
#define STRINGIZE(stringizedName) TOSTRING(stringizedName)
char *psensor_list_with_end = NULL;
char *sensor_kconfig = STRINGIZE(CONFIG_CUSTOM_KERNEL_IMGSENSOR);
static int orderedSearchList[MAX_NUM_OF_SUPPORT_SENSOR] = {-1};
static bool get_search_list = true;
int i = 0;
int j = 0;
char *driver_name = NULL;
const char *pDTS_sensors = NULL;
struct device_node *of_node = of_find_compatible_node(NULL, NULL, "mediatek,camera_hw");
imgsensor_mutex_init(psensor_inst);
imgsensor_i2c_init(&psensor_inst->i2c_cfg, imgsensor_custom_config[psensor->inst.sensor_idx].i2c_dev);
imgsensor_i2c_filter_msg(&psensor_inst->i2c_cfg, true);
if (get_search_list) {
psensor_list_with_end = kmalloc(strlen(sensor_kconfig)-1, GFP_KERNEL);
}
if (psensor_list_with_end != NULL) {
for (j = 0; j < MAX_NUM_OF_SUPPORT_SENSOR; j++)
orderedSearchList[j] = -1;
memcpy(psensor_list_with_end, sensor_kconfig+1, strlen(sensor_kconfig)-2);
//读取k39tv1_bsp_1g_defconfig中CONFIG_CUSTOM_KERNEL_IMGSENSOR配置
*(psensor_list_with_end+strlen(sensor_kconfig)-2) = '\0';
of_property_read_string(of_node, "enable-sensor", &pDTS_sensors);
PK_DBG("psensor_list_with_end %s ,pDTS_sensors %s\n",
psensor_list_with_end, pDTS_sensors == NULL ? "null" : pDTS_sensors);
driver_name = strsep(&psensor_list_with_end, " \0");
//取CONFIG_CUSTOM_KERNEL_IMGSENSOR中的第一个
while (driver_name != NULL) {
for (j = 0; j < MAX_NUM_OF_SUPPORT_SENSOR; j++) {
if (pSensorList[j].init == NULL)
break;
else if (!strcmp(driver_name, pSensorList[j].name)) {
//此处会判断k39tv1_bsp_1g_defconfig中CONFIG_CUSTOM_KERNEL_IMGSENSOR配置的某个camera sensor名和kd_imgsensor.h中对应的#define SENSOR_DRVNAME_***_MIPI_RAW "camera sensor名"是否一致,如果一致才会往下执行相应摄像头的上电。
if (pDTS_sensors != NULL && !strstr(pDTS_sensors, driver_name))
continue;
orderedSearchList[i++] = j;
break;
}
}
driver_name = strsep(&psensor_list_with_end, " \0");
//接着读取k39tv1_bsp_1g_defconfig中CONFIG_CUSTOM_KERNEL_IMGSENSOR配置的下一个
}
get_search_list = false;
kfree(psensor_list_with_end);
}
…
for (i = 0; i < MAX_NUM_OF_SUPPORT_SENSOR; i++) {
/*PK_DBG("orderedSearchList[%d]=%d\n", i, orderedSearchList[i]);*/
if (orderedSearchList[i] == -1)
continue;
drv_idx = orderedSearchList[i];
if (pSensorList[drv_idx].init) {
pSensorList[drv_idx].init(&psensor->pfunc);
if (psensor->pfunc) {
/* get sensor name */
psensor_inst->psensor_name = (char *)pSensorList[drv_idx].name;
#ifdef IMGSENSOR_LEGACY_COMPAT
psensor_inst->status.arch = psensor->pfunc->arch;
#endif
if (!imgsensor_check_is_alive(psensor)) {
PK_INFO("[imgsensor_set_driver] :[%d][%d][%s]\n",
psensor->inst.sensor_idx,
drv_idx,
psensor_inst->psensor_name);
ret = drv_idx;
break;
}
} else {
PK_PR_ERR("ERROR:NULL g_pInvokeSensorFunc[%d][%d]\n",
psensor->inst.sensor_idx,
drv_idx);
}
} else {
PK_PR_ERR("ERROR:NULL sensor list[%d]\n", drv_idx);
}
}
imgsensor_i2c_filter_msg(&psensor_inst->i2c_cfg, false);
return ret;
}
alps/kernel-4.4/drivers/misc/mediatek/imgsensor/src/common/v1/imgsensor.c
imgsensor_check_is_alive(…)
{
…
imgsensor_hw_power(&pgimgsensor->hw, psensor, psensor_inst->psensor_name, IMGSENSOR_HW_POWER_STATUS_ON);
imgsensor_sensor_feature_control(psensor, SENSOR_FEATURE_CHECK_SENSOR_ID, (MUINT8 *)&sensorID, &retLen);
if (sensorID == 0 || sensorID == 0xFFFFFFFF) { /* not implement this feature ID */
PK_DBG("Fail to get sensor ID %x\n", sensorID);
err = ERROR_SENSOR_CONNECT_FAIL;
} else {
PK_DBG(" Sensor found ID = 0x%x\n", sensorID);
snprintf(mtk_ccm_name, sizeof(mtk_ccm_name), "%s CAM[%d]:%s;",
mtk_ccm_name, psensor->inst.sensor_idx, psensor_inst->psensor_name);
err = ERROR_NONE;
}
…
}
alps/kernel-4.4/drivers/misc/mediatek/imgsensor/src/common/v1/imgsensor_hw.c
imgsensor_hw_power(…)
{
…
PK_DBG("sensor_idx %d, power %d curr_sensor_name %s\n", sensor_idx, pwr_status, curr_sensor_name);
…
imgsensor_hw_power_sequence(phw,
sensor_idx,
pwr_status,
sensor_power_sequence,
curr_sensor_name);
…
}
alps/kernel-4.4/drivers/misc/mediatek/imgsensor/src/mt6739/camera_hw/imgsensor_cfg_table.c
struct IMGSENSOR_HW_POWER_SEQ sensor_power_sequence[] = {
…
#if defined(OV509_MIPI_RAW)
{
SENSOR_DRVNAME_OV509_MIPI_RAW,
{
{SensorMCLK, Vol_High, 0},
{PDN, Vol_Low, 5},
{RST, Vol_Low, 5},
{DOVDD, Vol_1800, 5},
{AVDD, Vol_2800, 5},
{DVDD, Vol_1200, 5},
{PDN, Vol_High, 5},
{RST, Vol_High, 5}
},
},
#endif
…
#if defined(GC2385SMIPI_RAW)
{
SENSOR_DRVNAME_GC2385SMIPI_RAW,
{
{SensorMCLK, Vol_High, 0},
{AVDD, Vol_2800, 10},
{DOVDD, Vol_1800, 10},
{DVDD, Vol_1200, 10},
{PDN, Vol_Low, 0},
{PDN, Vol_High, 0},
{RST, Vol_Low, 0},
{RST, Vol_High, 0}
},
},
#endif
…
}
案例检索:
案例一 : 前摄gc8024读不到ID - 后摄1335影响 - 后摄未正常工作
案例二 : 前摄ov8865读不到ID - 上电时序 - RST脚需要先高后低
案例三 : 前摄ov8865无图像 - 模组打样有问题 - 4lane(4路mipi的摄像头打样成2路 - fpc排线)
案例四 : 前摄ov8865拍照照片是花的 - 模组打样有问题
案例五 : 后摄imx258的af(ad5820)无功能 - android.mk需要配置添加编译
案例六 : 前摄ov8865的af(dw9718)无功能 - 多处需要配置 - dws、Android.mk
案例七 : 前摄(gc2385)卡顿 - 后副摄mipi干扰
案例八 : 前摄(gc2385)无功能 - 前摄座子没扣好
案例九 : 前摄(3h2)无功能 - i2c地址不对,且版本太老 - fae提供一份新的驱动
案例十 : 后摄(imx135)读不到ID - i2c地址不对 - 在驱动中i2c地址的数组中添加一个i2c地址
案例十一 : 前摄(ov509即imx190 - 驱动用ov509)读不到ID - 模组问题,用其他项目的摄像头ok - 重新打样
案例十二 : 前摄(ov509即imx190 - 驱动用ov509)读不到ID - 主板问题 - v666_1.0读到0x90,v666_1.1读到0x190
案例十三 : 编译报错 - 兼容过多摄像头(最多16个) - 增大为18个
案例十四 : 后副摄(gc0310)装上之后,后摄(ov8858)读不到id - i2c地址(0x42)相同(同一条i2c总线(总线2)) - 模组厂修改i2c地址
案例十五 : 待机电流过大(18ma) - 后副摄没有休眠 - 修改掉电时序
案例十六 : 概率性读不到ID - 降i2c速率(从300 降为 100)
案例十七 : 后摄AF(9714)对焦无功能 - 模组AF供电脚短地 - 改模组
案例十八 : 量产5%的机器后摄拍照发红 - 屏单体显示偏色
案例十九 : 兼容两个GC2235后摄(带AF和不带AF), 不带AF的对焦卡死 - 分开出软件
案例二十 : 后摄(gc8034)无法连接CCT(MTK 专用调cam参数工具) - config缺分辨率800x600
案例二十一 : 前摄2385s读不到ID -- I2C总线不对
案例二十二 : 前摄5025s 开机能读到ID, 打开读不到ID -- mclk配置不正确(实际原理图为mclk0 错配成mclk1-默认mclk1)
案例二十三 : 前摄(GC2385)开启EIS,录制的效果很暗,几乎看不清视频画面