Port the gspca camera driver to fs2410
[Compiling environment] Ubuntu 8.10 + VMware + Windows XP
[Target machine] fs2410
[Cross compiler] arm-softfloat-Linux-GNU-gcc
1. Ensure that the USB and cs8900a of the target board work properly.
2. Download the camera driver gspcav1-20071224.tar.gz from the network
.
3. In linux-2.6.22.6/Drivers/USB/
Create media
Copy gspcav1-20071224.tar.gz to media and decompress it.
4. Modify the kconfig and makefile files in the USB directory.
4.1 Add source "Drivers/USB/Media/kconfig" to kconfig"
4.2 Add obj-$ (config_usb_spca5xx) + = media/to makefile/
5. Create the kconfig and makefile files in the drivers/USB/media directory.
5.1 Vim kconfig
Comment "USB multimedia devices"
Depends on USB
Config usb_spca5xx
Tristate "USB spca5xx Sunplus/vimcro/sonix JPEG cameras"
Depends on USB & video_dev
--- Help ---
<File: Documentation/video4linux/api.html>
5.2 Vim makefile
OBJ-$ (config_usb_spca5xx) + = gspcav1-20071224/
6. Modify makefile under Drivers/USB/Media/spcav1-20071224/directory:
Add the following content under gspca-objs: = gspca_core.o Decoder/gspcadecoder. O:
OBJ-$ (config_usb_spca5xx) + = gspca. o
Modify kernel_version = linux-2.6.22.6
Modify kerneldir: = absolute address of the directory where the linux-2.6.22.6 is located (My is/hd2/linux-2.6.22.6-pure/linux-2.6.22.6/
)
Modify module_installdir = $ (kerneldir)/Drivers/USB/Media/
Modify module_installdir2 =$ (kerneldir)/Drivers/Media/Video/
Add cc = arm-softfloat-Linux-GNU-gcc
7. Make menuconfig to configure the kernel
7.1 multimedia devices --->
<*> Video for Linux
(Video-related options, but others are optional)
7.2 --- USB multimedia devices
<*> USB spca5xx Sunplus/vimcro/sonix JPEG cameras
8. Make
8.1 if errors related to gspca-version occur:
Modify the gspcav1-20071224/gspca_core.c
// Static const char gspca_version [] = gspca_version;
Change to static const char gspca_version [] = "00.60.00 ";
Add a macro definition # define vid_hardware_gspca 0xff
8.2 If the undefined reference to "_ this_module" error occurs:
<*> USB spca5xx Sunplus/vimcro/sonix JPEG cameras
Change to <m> USB spca5xx Sunplus/vimcro/sonix JPEG cameras
(I encountered this error! Why can't I directly compile it into the kernel? If you have solved the problem, please let me know
: Boat_man@163.com
)
9. After successful make
, In gspcav1-20071224
Gspca. Ko is generated under the Directory
, Copy it to the root directory of the host NFS service (for example, my/soure/rootfs ).
10. Start the target board
, Insmod gspca. Ko
Insert a scpca-compatible camera:
USB 1-1: new full speed USB device using s3c2410-ohci and address 2
USB 1-1: configuration #1 chosen from 1 choice
Drivers/USB/Media/gspcav1-20071224/gspca_core.c: USB gspca camera found. (zc3xx)
Drivers/USB/Media/gspcav1-20071224/gspca_core.c: [spca5xx_probe: 4275] Camera type JPEG
Drivers/USB/Media/gspcav1-20071224/vimicro/zc3xx. h: [zc3xx_config: 679] Find sensor mi0360.chip revision 8001
Drivers/USB/Media/gspcav1-20071224/gspca_core.c: [spca5xx_getcapability: 1249] maxw 640 maxh 480 minw 160 Minh 120
This indicates that the camera driver is successfully installed!