zc0301.txt 8.1 KB

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