^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) .. SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) The cafe_ccic driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) ====================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) Author: Jonathan Corbet <corbet@lwn.net>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) Introduction
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) ------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) "cafe_ccic" is a driver for the Marvell 88ALP01 "cafe" CMOS camera
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) controller. This is the controller found in first-generation OLPC systems,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) and this driver was written with support from the OLPC project.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) Current status: the core driver works. It can generate data in YUV422,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) RGB565, and RGB444 formats. (Anybody looking at the code will see RGB32 as
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) well, but that is a debugging aid which will be removed shortly). VGA and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) QVGA modes work; CIF is there but the colors remain funky. Only the OV7670
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) sensor is known to work with this controller at this time.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) To try it out: either of these commands will work:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) .. code-block:: none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) $ mplayer tv:// -tv driver=v4l2:width=640:height=480 -nosound
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) $ mplayer tv:// -tv driver=v4l2:width=640:height=480:outfmt=bgr16 -nosound
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) The "xawtv" utility also works; gqcam does not, for unknown reasons.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) Load time options
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) -----------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) There are a few load-time options, most of which can be changed after
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) loading via sysfs as well:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) - alloc_bufs_at_load: Normally, the driver will not allocate any DMA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) buffers until the time comes to transfer data. If this option is set,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) then worst-case-sized buffers will be allocated at module load time.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) This option nails down the memory for the life of the module, but
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) perhaps decreases the chances of an allocation failure later on.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) - dma_buf_size: The size of DMA buffers to allocate. Note that this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) option is only consulted for load-time allocation; when buffers are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) allocated at run time, they will be sized appropriately for the current
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) camera settings.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) - n_dma_bufs: The controller can cycle through either two or three DMA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) buffers. Normally, the driver tries to use three buffers; on faster
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) systems, however, it will work well with only two.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) - min_buffers: The minimum number of streaming I/O buffers that the driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) will consent to work with. Default is one, but, on slower systems,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) better behavior with mplayer can be achieved by setting to a higher
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) value (like six).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) - max_buffers: The maximum number of streaming I/O buffers; default is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) ten. That number was carefully picked out of a hat and should not be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) assumed to actually mean much of anything.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) - flip: If this boolean parameter is set, the sensor will be instructed to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) invert the video image. Whether it makes sense is determined by how
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) your particular camera is mounted.