A.kernel层
1.配置底层驱动文件
文件位置:kernel/drivers/misc/mediatek/imagesensor/src
配置驱动文件xxxmipi_sensor.c;
注意配置的参数:pclk,linelength,framelength,grabwindow_width,grabwindow_height,max_framerate;
init 寄存器配置, preview寄存器配置。
2.添加sensor
文件位置:kernel/drivers/misc/mediatek/imagesensor/src
文件名:kd_sensorlist.h
UINT32 IMX258_MIPI_RAW_SensorInit(PSENSOR_FUNCTION_STRUCT *pfFunc);
...
#if defined(IMX258_MIPI_RAW)
{IMX258_SENSOR_ID, SENSOR_DRVNAME_IMX258_MIPI_RAW, IMX258_MIPI_RAW_SensorInit},
#endif
3.上电文件
文件位置:kernel/drivers/misc/mediatek/imagesensor/src/camera_hw/
文件名:kd_camera_hw.c
else if (currSensorName &&
(0 == strcmp(SENSOR_DRVNAME_OV5648_MIPI_RAW, currSensorName)))
4.sensor chip ID
文件位置:kernel/drivers/misc/mediatek/imagesensor/inc
文件名:kd_imgsensor.h
#define IMX362_SENSOR_ID 0x0362
...
#define SENSOR_DRVNAME_IMX362_MIPI_RAW "imx362mipiraw"
4.在工程中加入模组
文件位置:kernel/arch/arm/config
文件名:工程名_defconfig
CONFIG_CUSTOM_KERNEL_IMGSENSOR="gc5025mipi_raw_p35 sp5506_mipi_raw_p35 sp250amipi_raw_p35 gc2385mipi_raw_p35 ov5648_mipi_raw"
B.device
1.工程配置文件添加模组
文件位置:device/flycom/工程名/
文件名:ProjectConfig.mk
#kernel层
CUSTOM_KERNEL_IMGSENSOR = sp5506_mipi_raw_p35 sp250amipi_raw_p35 gc5025mipi_raw_p35 gc2385mipi_raw_p35 ov5648_mipi_raw
#主摄
CUSTOM_KERNEL_MAIN_IMGSENSOR = sp5506_mipi_raw_p35 gc5025mipi_raw_p35 ov5648_mipi_raw
#副摄
CUSTOM_KERNEL_SUB_IMGSENSOR = sp250amipi_raw_p35 gc2385mipi_raw_p35
#HAL层
CUSTOM_HAL_IMGSENSOR = sp5506_mipi_raw_p35 sp250amipi_raw_p35 gc5025mipi_raw_p35 gc2385mipi_raw_p35 ov5648_mipi_raw
CUSTOM_HAL_MAIN_IMGSENSOR = sp5506_mipi_raw_p35 gc5025mipi_raw_p35 ov5648_mipi_raw
CUSTOM_HAL_SUB_IMGSENSOR = sp250amipi_raw_p35 gc2385mipi_raw_p35
C.Vendor层
1.效果参数文件
文件位置:vendor/mediatek/proprietary/custom/开发板型号/hal/imgsensor/
文件名:xxxmipi_raw
2.尺寸设置文件
文件位置:vendor/mediatek/proprietary/custom/工程名/hal/
3.添加sensor
文件位置:vendor/mediatek/proprietary/custom/开发板型号/hal/imgsensor_src/
文件名:sensorlist.cpp
#if defined(SP5506_MIPI_RAW_P35)
RAW_INFO(SP5506_SENSOR_ID, SENSOR_DRVNAME_SP5506_MIPI_P35, NULL),
#endif
4.为模组添加马达
文件位置:vendor/mediatek/proprietary/custom/开发板型号/hal/lens/src/
文件名:lenslist.cpp
#if defined(DW9714AF)
{S5K3L8_SENSOR_ID, DW9714AF_LENS_ID, "DW9714AF", pDW9714AF_getDefaultData},
{OV5648MIPI_SENSOR_ID, DW9714AF_LENS_ID, "DW9714AF", pDW9714AF_getDefaultData},
#endif