blob: 0889ae6ac7d8df00500a052cfa7bd4fb8e5acdc7 [file] [log] [blame]
Luca Risolia60f78052006-02-06 16:29:35 +00001
2 ZC0301 Image Processor and Control Chip
3 Driver for Linux
4 =======================================
5
6 - Documentation -
7
8
9Index
10=====
111. Copyright
122. Disclaimer
133. License
144. Overview and features
155. Module dependencies
166. Module loading
177. Module parameters
188. Supported devices
199. Notes for V4L2 application developers
2010. Contact information
2111. Credits
22
23
241. Copyright
25============
26Copyright (C) 2006 by Luca Risolia <luca.risolia@studio.unibo.it>
27
28
292. Disclaimer
30=============
31This software is not developed or sponsored by Z-Star Microelectronics Corp.
32Trademarks are property of their respective owner.
33
34
353. License
36==========
37This program is free software; you can redistribute it and/or modify
38it under the terms of the GNU General Public License as published by
39the Free Software Foundation; either version 2 of the License, or
40(at your option) any later version.
41
42This program is distributed in the hope that it will be useful,
43but WITHOUT ANY WARRANTY; without even the implied warranty of
44MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
45GNU General Public License for more details.
46
47You should have received a copy of the GNU General Public License
48along with this program; if not, write to the Free Software
49Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
50
51
524. Overview and features
53========================
54This driver supports the video interface of the devices mounting the ZC0301
55Image Processor and Control Chip.
56
57The driver relies on the Video4Linux2 and USB core modules. It has been
58designed to run properly on SMP systems as well.
59
60The latest version of the ZC0301 driver can be found at the following URL:
61http://www.linux-projects.org/
62
63Some of the features of the driver are:
64
65- full compliance with the Video4Linux2 API (see also "Notes for V4L2
66 application developers" paragraph);
67- available mmap or read/poll methods for video streaming through isochronous
68 data transfers;
69- automatic detection of image sensor;
Luca Risolia9e47a522006-02-08 00:05:27 +000070- video format is standard JPEG;
Luca Risolia60f78052006-02-06 16:29:35 +000071- full support for the capabilities of every possible image sensors that can
72 be connected to the ZC0301 bridges, including, for istance, red, green,
73 blue and global gain adjustments and exposure control (see "Supported
74 devices" paragraph for details);
75- use of default color settings for sunlight conditions;
76- dynamic driver control thanks to various module parameters (see "Module
77 parameters" paragraph);
78- up to 64 cameras can be handled at the same time; they can be connected and
79 disconnected from the host many times without turning off the computer, if
80 the system supports hotplugging;
81
82
835. Module dependencies
84======================
85For it to work properly, the driver needs kernel support for Video4Linux and
86USB.
87
88The following options of the kernel configuration file must be enabled and
89corresponding modules must be compiled:
90
91 # Multimedia devices
92 #
93 CONFIG_VIDEO_DEV=m
94
95 # USB support
96 #
97 CONFIG_USB=m
98
99In addition, depending on the hardware being used, the modules below are
100necessary:
101
102 # USB Host Controller Drivers
103 #
104 CONFIG_USB_EHCI_HCD=m
105 CONFIG_USB_UHCI_HCD=m
106 CONFIG_USB_OHCI_HCD=m
107
108The ZC0301 controller also provides a built-in microphone interface. It is
109supported by the USB Audio driver thanks to the ALSA API:
110
111 # Sound
112 #
113 CONFIG_SOUND=y
114
115 # Advanced Linux Sound Architecture
116 #
117 CONFIG_SND=m
118
119 # USB devices
120 #
121 CONFIG_SND_USB_AUDIO=m
122
123And finally:
124
125 # USB Multimedia devices
126 #
127 CONFIG_USB_ZC0301=m
128
129
1306. Module loading
131=================
132To use the driver, it is necessary to load the "zc0301" module into memory
133after every other module required: "videodev", "usbcore" and, depending on
134the USB host controller you have, "ehci-hcd", "uhci-hcd" or "ohci-hcd".
135
136Loading can be done as shown below:
137
138 [root@localhost home]# modprobe zc0301
139
140At this point the devices should be recognized. You can invoke "dmesg" to
141analyze kernel messages and verify that the loading process has gone well:
142
143 [user@localhost home]$ dmesg
144
145
1467. Module parameters
147====================
148Module parameters are listed below:
149-------------------------------------------------------------------------------
150Name: video_nr
151Type: short array (min = 0, max = 64)
152Syntax: <-1|n[,...]>
153Description: Specify V4L2 minor mode number:
154 -1 = use next available
155 n = use minor number n
156 You can specify up to 64 cameras this way.
157 For example:
158 video_nr=-1,2,-1 would assign minor number 2 to the second
159 registered camera and use auto for the first one and for every
160 other camera.
161Default: -1
162-------------------------------------------------------------------------------
163Name: force_munmap
164Type: bool array (min = 0, max = 64)
165Syntax: <0|1[,...]>
166Description: Force the application to unmap previously mapped buffer memory
167 before calling any VIDIOC_S_CROP or VIDIOC_S_FMT ioctl's. Not
168 all the applications support this feature. This parameter is
169 specific for each detected camera.
170 0 = do not force memory unmapping
171 1 = force memory unmapping (save memory)
172Default: 0
173-------------------------------------------------------------------------------
174Name: debug
175Type: ushort
176Syntax: <n>
177Description: Debugging information level, from 0 to 3:
178 0 = none (use carefully)
179 1 = critical errors
180 2 = significant informations
181 3 = more verbose messages
182 Level 3 is useful for testing only, when only one device
183 is used at the same time. It also shows some more informations
184 about the hardware being detected. This module parameter can be
185 changed at runtime thanks to the /sys filesystem interface.
186Default: 2
187-------------------------------------------------------------------------------
188
189
1908. Supported devices
191====================
192None of the names of the companies as well as their products will be mentioned
193here. They have never collaborated with the author, so no advertising.
194
195From the point of view of a driver, what unambiguously identify a device are
196its vendor and product USB identifiers. Below is a list of known identifiers of
197devices mounting the ZC0301 Image Processor and Control Chips:
198
199Vendor ID Product ID
200--------- ----------
2010x046d 0x08ae
202
203The following image sensors are supported:
204
205Model Manufacturer
206----- ------------
207PAS202BCB PixArt Imaging, Inc.
208
209All the available control settings of each image sensor are supported through
210the V4L2 interface.
211
212
2139. Notes for V4L2 application developers
214========================================
215This driver follows the V4L2 API specifications. In particular, it enforces two
216rules:
217
218- exactly one I/O method, either "mmap" or "read", is associated with each
219file descriptor. Once it is selected, the application must close and reopen the
220device to switch to the other I/O method;
221
222- although it is not mandatory, previously mapped buffer memory should always
223be unmapped before calling any "VIDIOC_S_CROP" or "VIDIOC_S_FMT" ioctl's.
224The same number of buffers as before will be allocated again to match the size
225of the new video frames, so you have to map the buffers again before any I/O
226attempts on them.
227
Luca Risolia60f78052006-02-06 16:29:35 +0000228
22910. Contact information
230=======================
231The author may be contacted by e-mail at <luca.risolia@studio.unibo.it>.
232
233GPG/PGP encrypted e-mail's are accepted. The GPG key ID of the author is
234'FCE635A4'; the public 1024-bit key should be available at any keyserver;
235the fingerprint is: '88E8 F32F 7244 68BA 3958 5D40 99DA 5D2A FCE6 35A4'.
236
237
23811. Credits
239===========
Luca Risolia9e47a522006-02-08 00:05:27 +0000240- Informations about the chip internals needed to enable the I2C protocol have
241 been taken from the documentation of the ZC030x Video4Linux1 driver written
242 by Andrew Birkett <andy@nobugs.org>;
243- Initialization values of the ZC0301 controller connected to the PAS202BCB
244 image sensor have been taken from the SPCA5XX driver maintained by
245 Michel Xhaard <mxhaard@magic.fr>.