1 .首先需要向厂商拿到代码
拷贝kernel层代码到mediatek/custom/common/kernel/imgsensor/
在此目录下新建gc2145_mipi_yuv/ 把代码拷贝到此目录下
拷贝hal层代码到mediatek/custom/common/hal/imgsensor/
并在此目录新建gc2145_mipi_yuv/
2 .在此文件中加入此摄像头mediatek/custom/common/kernel/imgsensor/src/kd_sensorlist.h
UINT32 GC2145MIPI_YUV_SensorInit(PSENSOR_FUNCTION_STRUCT *pfFunc); #if defined(GC2145_MIPI_YUV) {GC2145MIPI_YUV_SENSOR_ID, SENSOR_DRVNAME_GC2145_MIPI_YUV, GC2145MIPI_YUV_SensorInit}, #endif 3 . 在此文件同样加入 mediatek/custom/common/hal/imgsensor/src/sensorlist.cpp #if defined(GC2145_MIPI_YUV) YUV_INFO(GC2145MIPI_YUV_SENSOR_ID, SENSOR_DRVNAME_GC2145_MIPI_YUV, NULL), #endif 另外注意这两个文件sensor的顺序要对应4 . 在此文件也同样配置mediatek/custom/common/kernel/imgsensor/inc/kd_imgsensor.h
#define GC2145MIPI_YUV_SENSOR_ID 0x2145 #define SENSOR_DRVNAME_GC2145_MIPI_YUV "gc2145_mipi_yuv" 5. 在此文件加入上电时序mediatek/custom/keytak82_cwet_kk/kernel/camera/camera/kd_camera_hw.c if (currSensorName && (0 == strcmp(SENSOR_DRVNAME_GC2145_MIPI_YUV,currSensorName))) { PK_DBG("[CAMERA SENSOR] kdCISModulePowerOn get in---GC2035_YUV sensorIdx:%d; pinSetIdx=%d\n",SensorIdx, pinSetIdx); if(TRUE != hwPowerOn(CAMERA_POWER_VCAM_D2, VOL_1800/*VOL_2800*/,mode_name)) { PK_DBG("[CAMERA SENSOR] Fail to enable digital power\n"); //return -EIO; goto _kdCISModulePowerOn_exit_; } if(TRUE != hwPowerOn(CAMERA_POWER_VCAM_A, VOL_2800,mode_name)) { PK_DBG("[CAMERA SENSOR] Fail to enable analog power\n"); //return -EIO; goto _kdCISModulePowerOn_exit_; } if(TRUE != hwPowerOn(CAMERA_POWER_VCAM_D, VOL_1800,mode_name)) { PK_DBG("[CAMERA SENSOR] Fail to enable digital power\n"); //return -EIO; goto _kdCISModulePowerOn_exit_; } /*if(TRUE != hwPowerOn(CAMERA_POWER_VCAM_A2, VOL_2800,mode_name)) { PK_DBG("[CAMERA SENSOR] Fail to enable analog power\n"); //return -EIO; goto _kdCISModulePowerOn_exit_; }*/ //PDN/STBY pin 6 .在projectconfig。mk文件配置主副摄像头 CUSTOM_HAL_IMGSENSOR=ov5648_mipi_raw gc2145_mipi_yuv另外注意配置pin脚 一般只用配置pdn rst 就可以了