【问题】
全志A133 Android 10 使用前后置都为相同的摄像头时,会出现i2c注册失败的问题,从而导致摄像头调试失败,具体log见下所述:
- [ 4.472993] [c2590_mipi_r]PWR_ON!
- [ 4.531231] [c2590_mipi_r]sensor_init
- [ 4.532734] [c2590_mipi_r]V4L2_IDENT_SENSOR = 0x202
- [ 4.532738] [c2590_mipi_r]sensor_init ok !
- [ 4.532742] [c2590_mipi_r]PWR_OFF!
- [ 4.541169] i2c i2c-2: Failed to register i2c client c2590_mipi_f at 0x36 (-16)
运行中会出现:
- [ 20.851147] [c2590_mipi_r]PWR_ON!
- [ 20.910241] [c2590_mipi_r]sensor_init
- [ 20.911581] [c2590_mipi_r]V4L2_IDENT_SENSOR = 0x202
- [ 20.911586] [c2590_mipi_r]sensor_init ok !
- [ 20.912813] [c2590_mipi_r]PWR_OFF!
- [ 20.925117] [VIN_ERR]there is no valid sensor
【解决方法】
1. 在 kernel/linux-4.9/drivers/media/platform/sunxi-vin/modules/sensor/camera.h 中增加:
- #define CONFIG_SAME_I2C
2. 在所有的驱动文件中的probe函数中增加:
- #ifdef CONFIG_SAME_I2C
- info->sensor_i2c_addr = (0x6c >> 1);
- #endif
以上我踩的坑,记录一下!