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