blob: f406f5e800464dcd11315459575ad5fb141a752f [file] [log] [blame]
Luca Risolia60f78052006-02-06 16:29:35 +00001
Luca Risolia02301852006-04-24 11:28:23 -03002 ZC0301 and ZC0301P Image Processor and Control Chip
3 Driver for Linux
4 ===================================================
Luca Risolia60f78052006-02-06 16:29:35 +00005
Luca Risolia02301852006-04-24 11:28:23 -03006 - Documentation -
Luca Risolia60f78052006-02-06 16:29:35 +00007
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========================
Luca Risolia02301852006-04-24 11:28:23 -030054This driver supports the video interface of the devices mounting the ZC0301 or
55ZC0301P Image Processors and Control Chips.
Luca Risolia60f78052006-02-06 16:29:35 +000056
57The driver relies on the Video4Linux2 and USB core modules. It has been
58designed to run properly on SMP systems as well.
59
Luca Risolia02301852006-04-24 11:28:23 -030060The latest version of the ZC0301[P] driver can be found at the following URL:
Luca Risolia60f78052006-02-06 16:29:35 +000061http://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- dynamic driver control thanks to various module parameters (see "Module
72 parameters" paragraph);
73- up to 64 cameras can be handled at the same time; they can be connected and
74 disconnected from the host many times without turning off the computer, if
75 the system supports hotplugging;
76
77
785. Module dependencies
79======================
80For it to work properly, the driver needs kernel support for Video4Linux and
81USB.
82
83The following options of the kernel configuration file must be enabled and
84corresponding modules must be compiled:
85
86 # Multimedia devices
87 #
88 CONFIG_VIDEO_DEV=m
89
90 # USB support
91 #
92 CONFIG_USB=m
93
94In addition, depending on the hardware being used, the modules below are
95necessary:
96
97 # USB Host Controller Drivers
98 #
99 CONFIG_USB_EHCI_HCD=m
100 CONFIG_USB_UHCI_HCD=m
101 CONFIG_USB_OHCI_HCD=m
102
103The ZC0301 controller also provides a built-in microphone interface. It is
104supported by the USB Audio driver thanks to the ALSA API:
105
106 # Sound
107 #
108 CONFIG_SOUND=y
109
110 # Advanced Linux Sound Architecture
111 #
112 CONFIG_SND=m
113
114 # USB devices
115 #
116 CONFIG_SND_USB_AUDIO=m
117
118And finally:
119
Luca Risolia02301852006-04-24 11:28:23 -0300120 # V4L USB devices
Luca Risolia60f78052006-02-06 16:29:35 +0000121 #
122 CONFIG_USB_ZC0301=m
123
124
1256. Module loading
126=================
127To use the driver, it is necessary to load the "zc0301" module into memory
128after every other module required: "videodev", "usbcore" and, depending on
129the USB host controller you have, "ehci-hcd", "uhci-hcd" or "ohci-hcd".
130
131Loading can be done as shown below:
132
133 [root@localhost home]# modprobe zc0301
134
135At this point the devices should be recognized. You can invoke "dmesg" to
136analyze kernel messages and verify that the loading process has gone well:
137
138 [user@localhost home]$ dmesg
139
140
1417. Module parameters
142====================
143Module parameters are listed below:
144-------------------------------------------------------------------------------
145Name: video_nr
146Type: short array (min = 0, max = 64)
147Syntax: <-1|n[,...]>
148Description: Specify V4L2 minor mode number:
Luca Risolia02301852006-04-24 11:28:23 -0300149 -1 = use next available
150 n = use minor number n
151 You can specify up to 64 cameras this way.
152 For example:
153 video_nr=-1,2,-1 would assign minor number 2 to the second
154 registered camera and use auto for the first one and for every
155 other camera.
Luca Risolia60f78052006-02-06 16:29:35 +0000156Default: -1
157-------------------------------------------------------------------------------
158Name: force_munmap
159Type: bool array (min = 0, max = 64)
160Syntax: <0|1[,...]>
161Description: Force the application to unmap previously mapped buffer memory
Luca Risolia02301852006-04-24 11:28:23 -0300162 before calling any VIDIOC_S_CROP or VIDIOC_S_FMT ioctl's. Not
163 all the applications support this feature. This parameter is
164 specific for each detected camera.
165 0 = do not force memory unmapping
166 1 = force memory unmapping (save memory)
Luca Risolia60f78052006-02-06 16:29:35 +0000167Default: 0
168-------------------------------------------------------------------------------
Luca Risoliaa8474232006-02-25 06:57:49 +0000169Name: frame_timeout
170Type: uint array (min = 0, max = 64)
171Syntax: <n[,...]>
172Description: Timeout for a video frame in seconds. This parameter is
Luca Risolia02301852006-04-24 11:28:23 -0300173 specific for each detected camera. This parameter can be
174 changed at runtime thanks to the /sys filesystem interface.
Luca Risoliaa8474232006-02-25 06:57:49 +0000175Default: 2
176-------------------------------------------------------------------------------
Luca Risolia60f78052006-02-06 16:29:35 +0000177Name: debug
178Type: ushort
179Syntax: <n>
180Description: Debugging information level, from 0 to 3:
Luca Risolia02301852006-04-24 11:28:23 -0300181 0 = none (use carefully)
182 1 = critical errors
183 2 = significant informations
184 3 = more verbose messages
185 Level 3 is useful for testing only, when only one device
186 is used at the same time. It also shows some more informations
187 about the hardware being detected. This module parameter can be
188 changed at runtime thanks to the /sys filesystem interface.
Luca Risolia60f78052006-02-06 16:29:35 +0000189Default: 2
190-------------------------------------------------------------------------------
191
192
1938. Supported devices
194====================
195None of the names of the companies as well as their products will be mentioned
196here. They have never collaborated with the author, so no advertising.
197
198From the point of view of a driver, what unambiguously identify a device are
199its vendor and product USB identifiers. Below is a list of known identifiers of
200devices mounting the ZC0301 Image Processor and Control Chips:
201
202Vendor ID Product ID
203--------- ----------
Luca Risolia6e0755a2006-03-03 09:58:39 +00002040x041e 0x4017
2050x041e 0x401c
2060x041e 0x401e
Luca Risolia02301852006-04-24 11:28:23 -03002070x041e 0x401f
2080x041e 0x4022
Luca Risolia6e0755a2006-03-03 09:58:39 +00002090x041e 0x4034
2100x041e 0x4035
Luca Risolia02301852006-04-24 11:28:23 -03002110x041e 0x4036
2120x041e 0x403a
2130x0458 0x7007
2140x0458 0x700C
2150x0458 0x700f
2160x046d 0x08ae
2170x055f 0xd003
2180x055f 0xd004
Luca Risolia60f78052006-02-06 16:29:35 +00002190x046d 0x08ae
Luca Risoliaa8474232006-02-25 06:57:49 +00002200x0ac8 0x0301
Luca Risolia02301852006-04-24 11:28:23 -03002210x0ac8 0x301b
2220x0ac8 0x303b
2230x10fd 0x0128
Luca Risolia6e0755a2006-03-03 09:58:39 +00002240x10fd 0x8050
Luca Risolia02301852006-04-24 11:28:23 -03002250x10fd 0x804e
Luca Risolia60f78052006-02-06 16:29:35 +0000226
Luca Risoliaa8474232006-02-25 06:57:49 +0000227The list above does not imply that all those devices work with this driver: up
228until now only the ones that mount the following image sensors are supported;
229kernel messages will always tell you whether this is the case:
Luca Risolia60f78052006-02-06 16:29:35 +0000230
231Model Manufacturer
232----- ------------
233PAS202BCB PixArt Imaging, Inc.
Luca Risolia02301852006-04-24 11:28:23 -0300234PB-0330 Photobit Corporation
Luca Risolia60f78052006-02-06 16:29:35 +0000235
Luca Risolia60f78052006-02-06 16:29:35 +0000236
2379. Notes for V4L2 application developers
238========================================
239This driver follows the V4L2 API specifications. In particular, it enforces two
240rules:
241
242- exactly one I/O method, either "mmap" or "read", is associated with each
243file descriptor. Once it is selected, the application must close and reopen the
244device to switch to the other I/O method;
245
246- although it is not mandatory, previously mapped buffer memory should always
247be unmapped before calling any "VIDIOC_S_CROP" or "VIDIOC_S_FMT" ioctl's.
248The same number of buffers as before will be allocated again to match the size
249of the new video frames, so you have to map the buffers again before any I/O
250attempts on them.
251
Luca Risolia60f78052006-02-06 16:29:35 +0000252
25310. Contact information
254=======================
255The author may be contacted by e-mail at <luca.risolia@studio.unibo.it>.
256
257GPG/PGP encrypted e-mail's are accepted. The GPG key ID of the author is
258'FCE635A4'; the public 1024-bit key should be available at any keyserver;
259the fingerprint is: '88E8 F32F 7244 68BA 3958 5D40 99DA 5D2A FCE6 35A4'.
260
261
26211. Credits
263===========
Luca Risolia9e47a522006-02-08 00:05:27 +0000264- Informations about the chip internals needed to enable the I2C protocol have
265 been taken from the documentation of the ZC030x Video4Linux1 driver written
266 by Andrew Birkett <andy@nobugs.org>;
Luca Risoliaa8474232006-02-25 06:57:49 +0000267- The initialization values of the ZC0301 controller connected to the PAS202BCB
Luca Risolia02301852006-04-24 11:28:23 -0300268 and PB-0330 image sensors have been taken from the SPCA5XX driver maintained
269 by Michel Xhaard <mxhaard@magic.fr>;
270- Stanislav Lechev donated one camera.