MT6789 kernel-5.10
6789代码跟6761、62、65不一样
如何点亮一颗摄像头
例 main:ov64b40_mipi_raw
摄像头驱动路径:
1.驱动 放入驱动文件
路径:alps\kernel-5.10\drivers\misc\mediatek\imgsensor\src\common\v1_1\ov64b40_mipi_raw
1.1Makefile
路径:alps\kernel-5.10\drivers\misc\mediatek\imgsensor\src\common\v1_1\Makefile
imgsensor_isp6s-objs += $(subdrv-rpath)/ov64b40mipiraw_Sensor.o
摄像头驱动在out的路径:
alps/out_krn/target/product/mgk_64_entry_level_k510/obj/KERNEL_OBJ/kernel-5.10/drivers/misc/mediatek/imgsensor/src/common/v1_1/ov64b40mipiraw_Sensor.o
2.上电时序:
路径:alps\kernel-5.10\drivers\misc\mediatek\imgsensor\src\common\v1_1\imgsensor_pwr_seq.c
#if defined(OV64B40_MIPI_RAW)
{
SENSOR_DRVNAME_OV64B40_MIPI_RAW,
{
{PDN, Vol_Low, 0},
{RST, Vol_Low, 0},
{AVDD, Vol_2800, 0},
{AFVDD, Vol_2800, 0},
{DVDD, Vol_1200, 0},
{DOVDD, Vol_1800, 1},
{SensorMCLK, Vol_High, 1},
{PDN, Vol_High, 0},
{RST, Vol_High, 8}
},
},
#endi
3.imgsensor_sensor_list.c
路径:alps\kernel-5.10\drivers\misc\mediatek\imgsensor\src\common\v1_1\imgsensor_sensor_list.c
#if defined(OV64B40_MIPI_RAW)
{OV64B40_SENSOR_ID, SENSOR_DRVNAME_OV64B40_MIPI_RAW,OV64B40MIPISensorInit},
#endif
4.imgsensor_sensor_list.h
路径:alps\kernel-5.10\drivers\misc\mediatek\imgsensor\src\common\v1_1\imgsensor_sensor_list.h
UINT32 OV64B40MIPISensorInit(struct SENSOR_FUNCTION_STRUCT **pfFunc);
5. sensorlist.cpp
alps\vendor\mediatek\proprietary\custom\common\hal\imgsensor_src\sensorlist.cpp
#if defined(OV64B40_MIPI_RAW)
RAW_INFO_M(OV64B40_SENSOR_ID, DEFAULT_MODULE_INDEX, DEFAULT_MODULE_ID, SENSOR_DRVNAME_OV64B40_MIPI_RAW, NULL),
#endif
5.1第二个cpp lenslist.cpp 这是对焦马达
路径:alps\vendor\mediatek\proprietary\custom\mt6789\hal\lens\src\lenslist.cpp
MSDK_LENS_INIT_FUNCTION_STRUCT LensList_main[MAX_NUM_OF_SUPPORT_LENS] =
{
{OV64B40_SENSOR_ID, DUMMY_MODULE_ID, DW9800WAF_LENS_ID, "DW9800WAF", NULL},
};
6.kd_imgsensor.h 定义id
alps\kernel-5.10\drivers\misc\mediatek\imgsensor\inc\kd_imgsensor.h
#define OV64B40_SENSOR_ID 0x5664
#define SENSOR_DRVNAME_OV64B40_MIPI_RAW "ov64b40_mipi_raw"
6.1另外一个kd_imgsensor.h(跟62 65一样)
路径:alps\device\mediatek\common\kernel-headers\kd_imgsensor.h
#define OV64B40_SENSOR_ID 0x5664
#define SENSOR_DRVNAME_OV64B40_MIPI_RAW "ov64b40_mipi_raw"
7. mtkcamvars.go(这个没看明白,就是有些的是十几个,有些二十几个,数目不一样)
路径:alps\vendor\mediatek\proprietary\scripts\soong\mtkcam\mtkcamvars.go
8、配置:五个
关键字 img
8.1 CameraConfig.mk
路径:alps\device\mediatek\mt6789\CameraConfig.mk
CUSTOM_HAL_IMGSENSOR = ov50c40_mipi_raw gc32e1_mipi_raw gc05a2_mipi_raw sc200cs_mipi_raw ov64b40_mipi_raw
CUSTOM_HAL_MAIN_IMGSENSOR = ov50c40_mipi_raw ov64b40_mipi_raw
CUSTOM_KERNEL_IMGSENSOR = ov50c40_mipi_raw gc32e1_mipi_raw gc05a2_mipi_raw sc200cs_mipi_raw ov64b40_mipi_raw
CUSTOM_KERNEL_MAIN_IMGSENSOR = ov50c40_mipi_raw ov64b40_mipi_raw
8.2device-camera.mk
路径:alps\device\mediatek\mt6789\device-camera.mk
CUSTOM_HAL_IMGSENSOR = ov50c40_mipi_raw gc32e1_mipi_raw gc05a2_mipi_raw sc200cs_mipi_raw ov64b40_mipi_raw
8.3ProjectConfig.mk
路径:alps\device\mediateksample\k6789v1_64
CUSTOM_HAL_IMGSENSOR = ov50c40_mipi_raw gc32e1_mipi_raw gc05a2_mipi_raw sc200cs_mipi_raw ov64b40_mipi_raw
CUSTOM_KERNEL_IMGSENSOR = ov50c40_mipi_raw gc32e1_mipi_raw gc05a2_mipi_raw sc200cs_mipi_raw ov64b40_mipi_raw
8.4ProjectConfig_def.mk
alps\device\mediateksample\ProjectConfig_def.mk
8.5mgk_64_k510_defconfig
alps\kernel-5.10\arch\arm64\configs\mgk_64_k510_defconfig
CONFIG_CUSTOM_KERNEL_IMGSENSOR="ov50c40_mipi_raw gc32e1_mipi_raw gc05a2_mipi_raw sc200cs_mipi_raw ov64b40_mipi_raw"
9.效果文件(这个摄像头效果文件跟62 65的不一样,很多文件,一般是copy,fae改效果的话只需要合几个文件)
alps\vendor\mediatek\proprietary\custom\mt6789\hal\imgsensor\ver1\ov64b40_mipi_raw
10.属性 跟62一样两个路径
属性1
alps\vendor\mediatek\proprietary\custom\mt6789\hal\imgsensor_metadata\ov64b40_mipi_raw
属性2
alps\vendor\mediatek\proprietary\custom\common\hal\imgsensor_metadata\sensor\ov64b40_mipi_raw
这也是属性,(以前8.1版本的)可以不用配这个,咱项目就没有配ov64b40的,已经整合到10.属性那里去了
alps\vendor\mediatek\proprietary\custom\mt6789\hal\sendepfeature\ov64b40_mipi_raw
已经整合到这了:alps\vendor\mediatek\proprietary\custom\mt6789\hal\imgsensor_metadata\ov64b40_mipi_raw
11.平台的翻转:(应该还有一个,像62的一样)
alps\vendor\mediatek\proprietary\custom\mt6789\hal\imgsensor_src\cfg_setting_imgsensor.cpp
未完待续......
标签:alps,mipi,raw,6789,ov64b40,MTK,imgsensor,mediatek,摄像头 From: https://blog.csdn.net/m0_73108512/article/details/143439146