最近调试一款摄像头,prob时sensor id能正确读到,但是进入camera时会出现写camera sensor init失败,
<3>[ 66.087427] msm_cci_irq:854 MASTER_1 error 40000
<3>[ 66.091294] msm_cci_irq:854 MASTER_1 error 20000
<3>[ 66.095799] msm_cci_validate_queue failed rc -22
<3>[ 66.100526] msm_cci_data_queue: failed 250
<3>[ 66.104840] msm_camera_cci_i2c_write_table: line 200 rc = -22
<3>[ 66.113033] msm_sensor_config:1292 ov5648_oty5f03 cfgtype = 6
根据经验,只要id读取正常,一般说明iic通信没有问题,查阅datasheet发现
error 40000 : This bit asserts when Queue#0 of I2C Master #1 overflows
error 20000 :This bit asserts when Queue#0 of I2C Master #1 underflows
初步可以认证是发送iic 初始化队列出现异常,或者iic写初始化过程中出现异常,如没有收到nack,但是master又一直再发送init参数给iic queue。
所以先从发送队列开始检查,发现发送主初始化参数前会先发送2个寄存器的写操作,如下
static struct msm_camera_i2c_reg_array init_reg_array0[] = {
{0x0100, 0x00},
{0x0103, 0x01},
};
并没有出现iic写失败,
但是写主初始化就会异常,主初始化队列如下:
static struct msm_camera_i2c_reg_array init_reg_array1[] = {
0x3001, 0x00, // D[7:0] set to input
0x3002, 0x00, // D[11:8] set to input
0x3011, 0x02, // Drive strength 2x
0x3017, 0x05, // AM05
0x3018, 0x4c, // MIPI 2 lane
0x301c, 0xd2, // AM05
0x3022, 0x00,
0x3034, 0x1a, // 10-bit mode
0x3035, 0x21, // PLL
0x3036, 0x7f, // PLL
0x3037, 0x03, // PLL
0x3038, 0x00, // PLL
0x3039, 0x00, // PLL
0x303a, 0x00, // PLLS
0x303b, 0x19, // PLLS
0x303c, 0x11, // PLLS
0x303d, 0x30, // PLLS
0x3105, 0x11,
0x3106, 0x05, // PLL
0x3304,