关于GPL329A添加摄像头驱动需要更改的配置脚本

时间:2024-05-28 23:37:14

我今天要添加一个ov2685的驱动进Digogo这部机子,当然要让它开机自动启动,就要想办法让它的.ko在启动文件系统的时候要自动被装载,这样上层打开摄像头才能加载摄像头驱动。

我找到源码工程对应添加该驱动的脚本,位于源码工程的:/vtech/lib/_Run_Once :174行,我需要添加以下脚本代码:

#yangyx  add  2016.4.22
	elif [ "$SENSOR_TYPE" == ov2685 ]; then
		insmod /lib/modules/2.6.32.94/kernel/arch/arm/mach-gpl32900/csi/csi1_ctrl_module.ko sensor=5 config=$CMOSSENSOR_CONFIG_OPT
		insmod /lib/modules/2.6.32.94/kernel/arch/arm/mach-gpl32900/mipi/gp_mipi_module.ko sensor=sensor_ov2685_mipi
		insmod /lib/modules/common/ov_2685_mipi.ko frequency=$CMOS_MAINPOWERSUPPLY_FREQ

可以看到的是,这个过程中使用了linux内核2.6版本的内核对这个驱动进行装载,驱动本身已经编译成功,生成的.ko模块文件位于以上的三个文件夹,对应的我们找到之后添加相应的脚本把它驱动起来。

对应的,我参考了下面这个脚本配置其它摄像头模块的程序完成了上面的配置:

insmod /lib/modules/2.6.32.94/kernel/arch/arm/mach-gpl32900/sensor_mgr/sensor_mgr_module.ko
	if [ "$SENSOR_TYPE" == ss6aa ]; then
		insmod /lib/modules/2.6.32.94/kernel/arch/arm/mach-gpl32900/csi/gp_csi1_module.ko sensor=0 config=$CMOSSENSOR_CONFIG_OPT
		insmod /lib/modules/2.6.32.94/kernel/arch/arm/mach-gpl32900/mipi/gp_mipi_module.ko sensor=sensor_6AA_mipi
		insmod /lib/modules/common/ss_6AA_mipi.ko config=$ULensConfig
	elif [ "$SENSOR_TYPE" == ov2675 ]; then
		insmod /lib/modules/2.6.32.94/kernel/arch/arm/mach-gpl32900/csi/gp_csi1_module.ko sensor=1 config=$CMOSSENSOR_CONFIG_OPT
		insmod /lib/modules/2.6.32.94/kernel/arch/arm/mach-gpl32900/mipi/gp_mipi_module.ko sensor=sensor_ov2675_mipi
		insmod /lib/modules/common/ov_2675_mipi.ko config=$ULensConfig
	elif [ "$SENSOR_TYPE" == hi256 ]; then
		insmod /lib/modules/2.6.32.94/kernel/arch/arm/mach-gpl32900/csi/gp_csi1_module.ko sensor=2 config=$CMOSSENSOR_CONFIG_OPT
		insmod /lib/modules/2.6.32.94/kernel/arch/arm/mach-gpl32900/mipi/gp_mipi_module.ko sensor=sensor_hi256_mipi
		insmod /lib/modules/common/hi_256_mipi.ko frequency=$CMOS_MAINPOWERSUPPLY_FREQ
	elif [ "$SENSOR_TYPE" == hi258 ]; then
		insmod /lib/modules/2.6.32.94/kernel/arch/arm/mach-gpl32900/csi/gp_csi1_module.ko sensor=4 config=$CMOSSENSOR_CONFIG_OPT
		insmod /lib/modules/2.6.32.94/kernel/arch/arm/mach-gpl32900/mipi/gp_mipi_module.ko sensor=sensor_hi258_mipi
		insmod /lib/modules/common/hi_258_mipi.ko frequency=$CMOS_MAINPOWERSUPPLY_FREQ