我今天要添加一个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
对应的,我参考了下面这个脚本配置其它摄像头模块的程序完成了上面的配置:
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