Arm-Linux摄像头驱动程序的移植
转载,原帖位
置:http://doc.xuehai.net/blog/static/762350652010333285148/ Arm-Linux摄像头驱动程序的移植
Arm开发板上摄像头的移植有两种方法:第一,将驱动程序添加到内核,通过编译内核,烧写到板子上;第二种,通过动态加载摄像头驱动模块的方法进行硬件的驱动。作者首先在PC的linux系统进行摄像驱动程序的移植,保证驱动程序版本正确,然后将驱动程序编译成模块,通过文件系统挂载到板子,然后进行加载,进而创建摄像头设备节点。下面将具体介绍摄像头动态加载的过程。 移植过程所使用的摄像头型号ZC301P,arm板上的内核版本为2.6.9,开发板为pxa270,所采用的驱动程序包为spca5xx-20060501.tar.gz。 第一步,使用命令解压文件: tar zxvf spca5xx-20060501.tar.gz 进入spca5xx-20060501 : cd spca5xx-20060501 第二步,修改Makefile文件:VERSION = 00.60.00
Makefile的内容如下,注释掉的为蓝色,红色表示修改过的内容:
CC =arm-linux-gcc
LD =arm-linux-ld
CVSVERSION = "$Experimental work Michel Xhaard && Reza Jelveh 03/02/2004" DEFINES =
###
# The following flags enable experimental features.
# By default, these are enabled for development versions of the driver, and
# disabled for release versions.
# Optional: Enable driver debugging
DEFINES += -DSPCA50X_ENABLE_DEBUG
# Optional: Enable direct register read/write for PAC207 development #DEFINES += -DSPCA5XX_ENABLE_REGISTERPLAY
###
# The following flags enable features that aren't yet implemented, and # therefore are disabled by default.
# Optional: Enable compression
DEFINES += -DSPCA50X_ENABLE_COMPRESSION
###
# Rest of Makefile follows here. You probably won't need to touch this. # Setup defines
DEFINES += -DCONFIG_USB_SPCA5XX_MODULE=1 -DMODULE -D__KERNEL__ DEFINES += -DVID_HARDWARE_SPCA5XX=0xFF
-DSPCA5XX_VERSION=\"$(VERSION)\"
ifneq ($(shell uname -r | cut -d. -f1,2), 2.4)
ifneq ($(KERNELRELEASE),) # We were called by kbuild
CFLAGS += $(DEFINES)