code:
.. SPDX-License-Identifier: GPL-2.0

EM28xx cards list
=================

.. tabularcolumns:: |p{1.4cm}|p{10.0cm}|p{1.9cm}|p{4.2cm}|

.. flat-table::
   :header-rows: 1
   :widths: 2 12 3 16
   :stub-columns: 0

   * - Card number
     - Card name
     - Empia Chip
     - USB IDs
   * - 0
     - Unknown EM2800 video grabber
     - em2800
     - eb1a:2800
   * - 1
     - Unknown EM2750/28xx video grabber
     - em2820 or em2840
     - eb1a:2710, eb1a:2820, eb1a:2821, eb1a:2860, eb1a:2861, eb1a:2862, eb1a:2863, eb1a:2870, eb1a:2881, eb1a:2883, eb1a:2868, eb1a:2875
   * - 2
     - Terratec Cinergy 250 USB
     - em2820 or em2840
     - 0ccd:0036
   * - 3
     - Pinnacle PCTV USB 2
     - em2820 or em2840
     - 2304:0208
   * - 4
     - Hauppauge WinTV USB 2
     - em2820 or em2840
     - 2040:4200, 2040:4201
   * - 5
     - MSI VOX USB 2.0
     - em2820 or em2840
     -
   * - 6
     - Terratec Cinergy 200 USB
     - em2800
     -
   * - 7
     - Leadtek Winfast USB II
     - em2800
     - 0413:6023
   * - 8
     - Kworld USB2800
     - em2800
     -
   * - 9
     - Pinnacle Dazzle DVC 90/100/101/107 / Kaiser Baas Video to DVD maker / Kworld DVD Maker 2 / Plextor ConvertX PX-AV100U
     - em2820 or em2840
     - 1b80:e302, 1b80:e304, 2304:0207, 2304:021a, 093b:a003
   * - 10
     - Hauppauge WinTV HVR 900
     - em2880
     - 2040:6500
   * - 11
     - Terratec Hybrid XS
     - em2880
     -
   * - 12
     - Kworld PVR TV 2800 RF
     - em2820 or em2840
     -
   * - 13
     - Terratec Prodigy XS
     - em2880
     -
   * - 14
     - SIIG AVTuner-PVR / Pixelview Prolink PlayTV USB 2.0
     - em2820 or em2840
     -
   * - 15
     - V-Gear PocketTV
     - em2800
     -
   * - 16
     - Hauppauge WinTV HVR 950
     - em2883
     - 2040:6513, 2040:6517, 2040:651b
   * - 17
     - Pinnacle PCTV HD Pro Stick
     - em2880
     - 2304:0227
   * - 18
     - Hauppauge WinTV HVR 900 (R2)
     - em2880
     - 2040:6502
   * - 19
     - EM2860/SAA711X Reference Design
     - em2860
     -
   * - 20
     - AMD ATI TV Wonder HD 600
     - em2880
     - 0438:b002
   * - 21
     - eMPIA Technology, Inc. GrabBeeX+ Video Encoder
     - em2800
     - eb1a:2801
   * - 22
     - EM2710/EM2750/EM2751 webcam grabber
     - em2750
     - eb1a:2750, eb1a:2751
   * - 23
     - Huaqi DLCW-130
     - em2750
     -
   * - 24
     - D-Link DUB-T210 TV Tuner
     - em2820 or em2840
     - 2001:f112
   * - 25
     - Gadmei UTV310
     - em2820 or em2840
     -
   * - 26
     - Hercules Smart TV USB 2.0
     - em2820 or em2840
     -
   * - 27
     - Pinnacle PCTV USB 2 (Philips FM1216ME)
     - em2820 or em2840
     -
   * - 28
     - Leadtek Winfast USB II Deluxe
     - em2820 or em2840
     -
   * - 29
     - EM2860/TVP5150 Reference Design
     - em2860
     - eb1a:5051
   * - 30
     - Videology 20K14XUSB USB2.0
     - em2820 or em2840
     -
   * - 31
     - Usbgear VD204v9
     - em2821
     -
   * - 32
     - Supercomp USB 2.0 TV
     - em2821
     -
   * - 33
     - Elgato Video Capture
     - em2860
     - 0fd9:0033
   * - 34
     - Terratec Cinergy A Hybrid XS
     - em2860
     - 0ccd:004f
   * - 35
     - Typhoon DVD Maker
     - em2860
     -
   * - 36
     - NetGMBH Cam
     - em2860
     -
   * - 37
     - Gadmei UTV330
     - em2860
     - eb1a:50a6
   * - 38
     - Yakumo MovieMixer
     - em2861
     -
   * - 39
     - KWorld PVRTV 300U
     - em2861
     - eb1a:e300
   * - 40
     - Plextor ConvertX PX-TV100U
     - em2861
     - 093b:a005
   * - 41
     - Kworld 350 U DVB-T
     - em2870
     - eb1a:e350
   * - 42
     - Kworld 355 U DVB-T
     - em2870
     - eb1a:e355, eb1a:e357, eb1a:e359
   * - 43
     - Terratec Cinergy T XS
     - em2870
     -
   * - 44
     - Terratec Cinergy T XS (MT2060)
     - em2870
     - 0ccd:0043
   * - 45
     - Pinnacle PCTV DVB-T
     - em2870
     -
   * - 46
     - Compro, VideoMate U3
     - em2870
     - 185b:2870
   * - 47
     - KWorld DVB-T 305U
     - em2880
     - eb1a:e305
   * - 48
     - KWorld DVB-T 310U
     - em2880
     -
   * - 49
     - MSI DigiVox A/D
     - em2880
     - eb1a:e310
   * - 50
     - MSI DigiVox A/D II
     - em2880
     - eb1a:e320
   * - 51
     - Terratec Hybrid XS Secam
     - em2880
     - 0ccd:004c
   * - 52
     - DNT DA2 Hybrid
     - em2881
     -
   * - 53
     - Pinnacle Hybrid Pro
     - em2881
     -
   * - 54
     - Kworld VS-DVB-T 323UR
     - em2882
     - eb1a:e323
   * - 55
     - Terratec Cinergy Hybrid T USB XS (em2882)
     - em2882
     - 0ccd:005e, 0ccd:0042
   * - 56
     - Pinnacle Hybrid Pro (330e)
     - em2882
     - 2304:0226
   * - 57
     - Kworld PlusTV HD Hybrid 330
     - em2883
     - eb1a:a316
   * - 58
     - Compro VideoMate ForYou/Stereo
     - em2820 or em2840
     - 185b:2041
   * - 59
     - Pinnacle PCTV HD Mini
     - em2874
     - 2304:023f
   * - 60
     - Hauppauge WinTV HVR 850
     - em2883
     - 2040:651f
   * - 61
     - Pixelview PlayTV Box 4 USB 2.0
     - em2820 or em2840
     -
   * - 62
     - Gadmei TVR200
     - em2820 or em2840
     -
   * - 63
     - Kaiomy TVnPC U2
     - em2860
     - eb1a:e303
   * - 64
     - Easy Cap Capture DC-60
     - em2860
     - 1b80:e309
   * - 65
     - IO-DATA GV-MVP/SZ
     - em2820 or em2840
     - 04bb:0515
   * - 66
     - Empire dual TV
     - em2880
     -
   * - 67
     - Terratec Grabby
     - em2860
     - 0ccd:0096, 0ccd:10AF
   * - 68
     - Terratec AV350
     - em2860
     - 0ccd:0084
   * - 69
     - KWorld ATSC 315U HDTV TV Box
     - em2882
     - eb1a:a313
   * - 70
     - Evga inDtube
     - em2882
     -
   * - 71
     - Silvercrest Webcam 1.3mpix
     - em2820 or em2840
     -
   * - 72
     - Gadmei UTV330+
     - em2861
     -
   * - 73
     - Reddo DVB-C USB TV Box
     - em2870
     -
   * - 74
     - Actionmaster/LinXcel/Digitus VC211A
     - em2800
     -
   * - 75
     - Dikom DK300
     - em2882
     -
   * - 76
     - KWorld PlusTV 340U or UB435-Q (ATSC)
     - em2870
     - 1b80:a340
   * - 77
     - EM2874 Leadership ISDBT
     - em2874
     -
   * - 78
     - PCTV nanoStick T2 290e
     - em28174
     - 2013:024f
   * - 79
     - Terratec Cinergy H5
     - em2884
     - eb1a:2885, 0ccd:10a2, 0ccd:10ad, 0ccd:10b6
   * - 80
     - PCTV DVB-S2 Stick (460e)
     - em28174
     - 2013:024c
   * - 81
     - Hauppauge WinTV HVR 930C
     - em2884
     - 2040:1605
   * - 82
     - Terratec Cinergy HTC Stick
     - em2884
     - 0ccd:00b2
   * - 83
     - Honestech Vidbox NW03
     - em2860
     - eb1a:5006
   * - 84
     - MaxMedia UB425-TC
     - em2874
     - 1b80:e425
   * - 85
     - PCTV QuatroStick (510e)
     - em2884
     - 2304:0242
   * - 86
     - PCTV QuatroStick nano (520e)
     - em2884
     - 2013:0251
   * - 87
     - Terratec Cinergy HTC USB XS
     - em2884
     - 0ccd:008e, 0ccd:00ac
   * - 88
     - C3 Tech Digital Duo HDTV/SDTV USB
     - em2884
     - 1b80:e755
   * - 89
     - Delock 61959
     - em2874
     - 1b80:e1cc
   * - 90
     - KWorld USB ATSC TV Stick UB435-Q V2
     - em2874
     - 1b80:e346
   * - 91
     - SpeedLink Vicious And Devine Laplace webcam
     - em2765
     - 1ae7:9003, 1ae7:9004
   * - 92
     - PCTV DVB-S2 Stick (461e)
     - em28178
     - 2013:0258
   * - 93
     - KWorld USB ATSC TV Stick UB435-Q V3
     - em2874
     - 1b80:e34c
   * - 94
     - PCTV tripleStick (292e)
     - em28178
     - 2013:025f, 2013:0264, 2040:0264, 2040:8264, 2040:8268
   * - 95
     - Leadtek VC100
     - em2861
     - 0413:6f07
   * - 96
     - Terratec Cinergy T2 Stick HD
     - em28178
     - eb1a:8179
   * - 97
     - Elgato EyeTV Hybrid 2008 INT
     - em2884
     - 0fd9:0018
   * - 98
     - PLEX PX-BCUD
     - em28178
     - 3275:0085
   * - 99
     - Hauppauge WinTV-dualHD DVB
     - em28174
     - 2040:0265, 2040:8265
   * - 100
     - Hauppauge WinTV-dualHD 01595 ATSC/QAM
     - em28174
     - 2040:026d, 2040:826d
   * - 101
     - Terratec Cinergy H6 rev. 2
     - em2884
     - 0ccd:10b2
   * - 102
     - :ZOLID HYBRID TV STICK
     - em2882
     -
   * - 103
     - Magix USB Videowandler-2
     - em2861
     - 1b80:e349
   * - 104
     - PCTV DVB-S2 Stick (461e v2)
     - em28178
     - 2013:0461, 2013:0259
   * - 105
     - MyGica iGrabber
     - em2860
     - 1f4d:1abe


code:
.. SPDX-License-Identifier: GPL-2.0

FAQ
===

.. note::

     1. With Digital TV, a single physical channel may have different
	contents inside it. The specs call each one as a *service*.
	This is what a TV user would call "channel". So, in order to
	avoid confusion, we're calling *transponders* as the physical
	channel on this FAQ, and *services* for the logical channel.
     2. The LinuxTV community maintains some Wiki pages with contain
        a lot of information related to the media subsystem. If you
        don't find an answer for your needs here, it is likely that
        you'll be able to get something useful there. It is hosted
	at:

	https://www.linuxtv.org/wiki/

Some very frequently asked questions about Linux Digital TV support

1. The signal seems to die a few seconds after tuning.

	It's not a bug, it's a feature. Because the frontends have
	significant power requirements (and hence get very hot), they
	are powered down if they are unused (i.e. if the frontend device
	is closed). The ``dvb-core`` module parameter ``dvb_shutdown_timeout``
	allow you to change the timeout (default 5 seconds). Setting the
	timeout to 0 disables the timeout feature.

2. How can I watch TV?

	Together with the Linux Kernel, the Digital TV developers support
	some simple utilities which are mainly intended for testing
	and to demonstrate how the DVB API works. This is called DVB v5
	tools and are grouped together with the ``v4l-utils`` git repository:

	    https://git.linuxtv.org/v4l-utils.git/

	You can find more information at the LinuxTV wiki:

	    https://www.linuxtv.org/wiki/index.php/DVBv5_Tools

	The first step is to get a list of services that are transmitted.

	This is done by using several existing tools. You can use
	for example the ``dvbv5-scan`` tool. You can find more information
	about it at:

	    https://www.linuxtv.org/wiki/index.php/Dvbv5-scan

	There are some other applications like ``w_scan`` [#]_ that do a
	blind scan, trying hard to find all possible channels, but
	those consumes a large amount of time to run.

	.. [#] https://www.linuxtv.org/wiki/index.php/W_scan

	Also, some applications like ``kaffeine`` have their own code
	to scan for services. So, you don't need to use an external
	application to obtain such list.

	Most of such tools need a file containing a list of channel
	transponders available on your area. So, LinuxTV developers
	maintain tables of Digital TV channel transponders, receiving
	patches from the community to keep them updated.

	This list is hosted at:

	    https://git.linuxtv.org/dtv-scan-tables.git

	And packaged on several distributions.

	Kaffeine has some blind scan support for some terrestrial standards.
	It also relies on DTV scan tables, although it contains a copy
	of it internally (and, if requested by the user, it will download
	newer versions of it).

	If you are lucky you can just use one of the supplied channel
	transponders. If not, you may need to seek for such info at
	the Internet and create a new file. There are several sites with
	contains physical channel lists. For cable and satellite, usually
	knowing how to tune into a single channel is enough for the
	scanning tool to identify the other channels. On some places,
	this could also work for terrestrial transmissions.

	Once you have a transponders list, you need to generate a services
	list with a tool like ``dvbv5-scan``.

	Almost all modern Digital TV cards don't have built-in hardware
	MPEG-decoders. So, it is up to the application to get a MPEG-TS
	stream provided by the board, split it into audio, video and other
	data and decode.

3. Which Digital TV applications exist?

	Several media player applications are capable of tuning into
	digital TV channels, including Kaffeine, Vlc, mplayer and MythTV.

	Kaffeine aims to be very user-friendly, and it is maintained
	by one of the Kernel driver developers.

	A comprehensive list of those and other apps can be found at:

	    https://www.linuxtv.org/wiki/index.php/TV_Related_Software

	Some of the most popular ones are linked below:

	https://kde.org/applications/multimedia/org.kde.kaffeine
		KDE media player, focused on Digital TV support

	https://www.linuxtv.org/vdrwiki/index.php/Main_Page
		Klaus Schmidinger's Video Disk Recorder

	https://linuxtv.org/downloads and https://git.linuxtv.org/
		Digital TV and other media-related applications and
		Kernel drivers. The ``v4l-utils`` package there contains
		several swiss knife tools for using with Digital TV.

	http://sourceforge.net/projects/dvbtools/
		Dave Chapman's dvbtools package, including
		dvbstream and dvbtune

	http://www.dbox2.info/
		LinuxDVB on the dBox2

	http://www.tuxbox.org/
		the TuxBox CVS many interesting DVB applications and the dBox2
		DVB source

	http://www.nenie.org/misc/mpsys/
		MPSYS: a MPEG2 system library and tools

	https://www.videolan.org/vlc/index.pt.html
		Vlc

	http://mplayerhq.hu/
		MPlayer

	http://xine.sourceforge.net/ and http://xinehq.de/
		Xine

	http://www.mythtv.org/
		MythTV - analog TV and digital TV PVR

	http://dvbsnoop.sourceforge.net/
		DVB sniffer program to monitor, analyze, debug, dump
		or view dvb/mpeg/dsm-cc/mhp stream information (TS,
		PES, SECTION)

4. Can't get a signal tuned correctly

	That could be due to a lot of problems. On my personal experience,
	usually TV cards need stronger signals than TV sets, and are more
	sensitive to noise. So, perhaps you just need a better antenna or
	cabling. Yet, it could also be some hardware or driver issue.

	For example, if you are using a Technotrend/Hauppauge DVB-C card
	*without* analog module, you might have to use module parameter
	adac=-1 (dvb-ttpci.o).

	Please see the FAQ page at linuxtv.org, as it could contain some
	valuable information:

	    https://www.linuxtv.org/wiki/index.php/FAQ_%26_Troubleshooting

	If that doesn't work, check at the linux-media ML archives, to
	see if someone else had a similar problem with your hardware
	and/or digital TV service provider:

	    https://lore.kernel.org/linux-media/

	If none of this works, you can try sending an e-mail to the
	linux-media ML and see if someone else could shed some light.
	The e-mail is linux-media AT vger.kernel.org.

5. The dvb_net device doesn't give me any packets at all

	Run ``tcpdump`` on the ``dvb0_0`` interface. This sets the interface
	into promiscuous mode so it accepts any packets from the PID
	you have configured with the ``dvbnet`` utility. Check if there
	are any packets with the IP addr and MAC addr you have
	configured with ``ifconfig`` or with ``ip addr``.

	If ``tcpdump`` doesn't give you any output, check the statistics
	which ``ifconfig`` or ``netstat -ni`` outputs. (Note: If the MAC
	address is wrong, ``dvb_net`` won't get any input; thus you have to
	run ``tcpdump`` before checking the statistics.) If there are no
	packets at all then maybe the PID is wrong. If there are error packets,
	then either the PID is wrong or the stream does not conform to
	the MPE standard (EN 301 192, http://www.etsi.org/). You can
	use e.g. ``dvbsnoop`` for debugging.

6. The ``dvb_net`` device doesn't give me any multicast packets

	Check your routes if they include the multicast address range.
	Additionally make sure that "source validation by reversed path
	lookup" is disabled::

	  $ "echo 0 > /proc/sys/net/ipv4/conf/dvb0/rp_filter"

7. What are all those modules that need to be loaded?

	In order to make it more flexible and support different hardware
	combinations, the media subsystem is written on a modular way.

	So, besides the Digital TV hardware module for the main chipset,
	it also needs to load a frontend driver, plus the Digital TV
	core. If the board also has remote controller, it will also
	need the remote controller core and the remote controller tables.
	The same happens if the board has support for analog TV: the
	core support for video4linux need to be loaded.

	The actual module names are Linux-kernel version specific, as,
	from time to time, things change, in order to make the media
	support more flexible.

repo_name: angery/linux


code:
.. SPDX-License-Identifier: GPL-2.0

.. include:: <isonum.txt>

The Samsung S5P/Exynos4 FIMC driver
===================================

Copyright |copy| 2012 - 2013 Samsung Electronics Co., Ltd.

The FIMC (Fully Interactive Mobile Camera) device available in Samsung
SoC Application Processors is an integrated camera host interface, color
space converter, image resizer and rotator.  It's also capable of capturing
data from LCD controller (FIMD) through the SoC internal writeback data
path.  There are multiple FIMC instances in the SoCs (up to 4), having
slightly different capabilities, like pixel alignment constraints, rotator
availability, LCD writeback support, etc. The driver is located at
drivers/media/platform/samsung/exynos4-is directory.

Supported SoCs
--------------

S5PC100 (mem-to-mem only), S5PV210, Exynos4210

Supported features
------------------

- camera parallel interface capture (ITU-R.BT601/565);
- camera serial interface capture (MIPI-CSI2);
- memory-to-memory processing (color space conversion, scaling, mirror
  and rotation);
- dynamic pipeline re-configuration at runtime (re-attachment of any FIMC
  instance to any parallel video input or any MIPI-CSI front-end);
- runtime PM and system wide suspend/resume

Not currently supported
-----------------------

- LCD writeback input
- per frame clock gating (mem-to-mem)

User space interfaces
---------------------

Media device interface
~~~~~~~~~~~~~~~~~~~~~~

The driver supports Media Controller API as defined at :ref:`media_controller`.
The media device driver name is "Samsung S5P FIMC".

The purpose of this interface is to allow changing assignment of FIMC instances
to the SoC peripheral camera input at runtime and optionally to control internal
connections of the MIPI-CSIS device(s) to the FIMC entities.

The media device interface allows to configure the SoC for capturing image
data from the sensor through more than one FIMC instance (e.g. for simultaneous
viewfinder and still capture setup).

Reconfiguration is done by enabling/disabling media links created by the driver
during initialization. The internal device topology can be easily discovered
through media entity and links enumeration.

Memory-to-memory video node
~~~~~~~~~~~~~~~~~~~~~~~~~~~

V4L2 memory-to-memory interface at /dev/video? device node.  This is standalone
video device, it has no media pads. However please note the mem-to-mem and
capture video node operation on same FIMC instance is not allowed.  The driver
detects such cases but the applications should prevent them to avoid an
undefined behaviour.

Capture video node
~~~~~~~~~~~~~~~~~~

The driver supports V4L2 Video Capture Interface as defined at
:ref:`devices`.

At the capture and mem-to-mem video nodes only the multi-planar API is
supported. For more details see: :ref:`planar-apis`.

Camera capture subdevs
~~~~~~~~~~~~~~~~~~~~~~

Each FIMC instance exports a sub-device node (/dev/v4l-subdev?), a sub-device
node is also created per each available and enabled at the platform level
MIPI-CSI receiver device (currently up to two).

sysfs
~~~~~

In order to enable more precise camera pipeline control through the sub-device
API the driver creates a sysfs entry associated with "s5p-fimc-md" platform
device. The entry path is: /sys/platform/devices/s5p-fimc-md/subdev_conf_mode.

In typical use case there could be a following capture pipeline configuration:
sensor subdev -> mipi-csi subdev -> fimc subdev -> video node

When we configure these devices through sub-device API at user space, the
configuration flow must be from left to right, and the video node is
configured as last one.

When we don't use sub-device user space API the whole configuration of all
devices belonging to the pipeline is done at the video node driver.
The sysfs entry allows to instruct the capture node driver not to configure
the sub-devices (format, crop), to avoid resetting the subdevs' configuration
when the last configuration steps at the video node is performed.

For full sub-device control support (subdevs configured at user space before
starting streaming):

.. code-block:: none

	# echo "sub-dev" > /sys/platform/devices/s5p-fimc-md/subdev_conf_mode

For V4L2 video node control only (subdevs configured internally by the host
driver):

.. code-block:: none

	# echo "vid-dev" > /sys/platform/devices/s5p-fimc-md/subdev_conf_mode

This is a default option.

5. Device mapping to video and subdev device nodes
--------------------------------------------------

There are associated two video device nodes with each device instance in
hardware - video capture and mem-to-mem and additionally a subdev node for
more precise FIMC capture subsystem control. In addition a separate v4l2
sub-device node is created per each MIPI-CSIS device.

How to find out which /dev/video? or /dev/v4l-subdev? is assigned to which
device?

You can either grep through the kernel log to find relevant information, i.e.

.. code-block:: none

	# dmesg | grep -i fimc

(note that udev, if present, might still have rearranged the video nodes),

or retrieve the information from /dev/media? with help of the media-ctl tool:

.. code-block:: none

	# media-ctl -p

7. Build
--------

If the driver is built as a loadable kernel module (CONFIG_VIDEO_SAMSUNG_S5P_FIMC=m)
two modules are created (in addition to the core v4l2 modules): s5p-fimc.ko and
optional s5p-csis.ko (MIPI-CSI receiver subdev).


code:
.. SPDX-License-Identifier: GPL-2.0

The gspca cards list
====================

The modules for the gspca webcam drivers are:

- gspca_main: main driver
- gspca\_\ *driver*: subdriver module with *driver* as follows

=========	=========	===================================================================
*driver*	vend:prod	Device
=========	=========	===================================================================
spca501         0000:0000	MystFromOri Unknown Camera
spca508         0130:0130	Clone Digital Webcam 11043
se401           03e8:0004	Endpoints/AoxSE401
zc3xx           03f0:1b07	HP Premium Starter Cam
m5602           0402:5602	ALi Video Camera Controller
spca501         040a:0002	Kodak DVC-325
spca500         040a:0300	Kodak EZ200
zc3xx           041e:041e	Creative WebCam Live!
ov519           041e:4003	Video Blaster WebCam Go Plus
stv0680         041e:4007	Go Mini
spca500         041e:400a	Creative PC-CAM 300
sunplus         041e:400b	Creative PC-CAM 600
sunplus         041e:4012	PC-Cam350
sunplus         041e:4013	Creative Pccam750
zc3xx           041e:4017	Creative Webcam Mobile PD1090
spca508         041e:4018	Creative Webcam Vista (PD1100)
spca561         041e:401a	Creative Webcam Vista (PD1100)
zc3xx           041e:401c	Creative NX
spca505         041e:401d	Creative Webcam NX ULTRA
zc3xx           041e:401e	Creative Nx Pro
zc3xx           041e:401f	Creative Webcam Notebook PD1171
zc3xx           041e:4022	Webcam NX Pro
pac207          041e:4028	Creative Webcam Vista Plus
zc3xx           041e:4029	Creative WebCam Vista Pro
zc3xx           041e:4034	Creative Instant P0620
zc3xx           041e:4035	Creative Instant P0620D
zc3xx           041e:4036	Creative Live !
sq930x          041e:4038	Creative Joy-IT
zc3xx           041e:403a	Creative Nx Pro 2
spca561         041e:403b	Creative Webcam Vista (VF0010)
sq930x          041e:403c	Creative Live! Ultra
sq930x          041e:403d	Creative Live! Ultra for Notebooks
sq930x          041e:4041	Creative Live! Motion
zc3xx           041e:4051	Creative Live!Cam Notebook Pro (VF0250)
ov519           041e:4052	Creative Live! VISTA IM
zc3xx           041e:4053	Creative Live!Cam Video IM
vc032x          041e:405b	Creative Live! Cam Notebook Ultra (VC0130)
ov519           041e:405f	Creative Live! VISTA VF0330
ov519           041e:4060	Creative Live! VISTA VF0350
ov519           041e:4061	Creative Live! VISTA VF0400
ov519           041e:4064	Creative Live! VISTA VF0420
ov519           041e:4067	Creative Live! Cam Video IM (VF0350)
ov519           041e:4068	Creative Live! VISTA VF0470
sn9c2028        0458:7003	GeniusVideocam Live v2
spca561         0458:7004	Genius VideoCAM Express V2
sn9c2028        0458:7005	Genius Smart 300, version 2
sunplus         0458:7006	Genius Dsc 1.3 Smart
zc3xx           0458:7007	Genius VideoCam V2
zc3xx           0458:700c	Genius VideoCam V3
zc3xx           0458:700f	Genius VideoCam Web V2
sonixj          0458:7025	Genius Eye 311Q
sn9c20x         0458:7029	Genius Look 320s
sonixj          0458:702e	Genius Slim 310 NB
sn9c20x         0458:7045	Genius Look 1320 V2
sn9c20x         0458:704a	Genius Slim 1320
sn9c20x         0458:704c	Genius i-Look 1321
sn9c20x         045e:00f4	LifeCam VX-6000 (SN9C20x + OV9650)
sonixj          045e:00f5	MicroSoft VX3000
sonixj          045e:00f7	MicroSoft VX1000
ov519           045e:028c	Micro$oft xbox cam
kinect          045e:02ae	Xbox NUI Camera
kinect          045e:02bf	Kinect for Windows NUI Camera
spca561         0461:0815	Micro Innovations IC200 Webcam
sunplus         0461:0821	Fujifilm MV-1
zc3xx           0461:0a00	MicroInnovation WebCam320
stv06xx         046D:08F0	QuickCamMessenger
stv06xx         046D:08F5	QuickCamCommunicate
stv06xx         046D:08F6	QuickCamMessenger (new)
stv06xx         046d:0840	QuickCamExpress
stv06xx         046d:0850	LEGOcam / QuickCam Web
stv06xx         046d:0870	DexxaWebCam USB
spca500         046d:0890	Logitech QuickCam traveler
vc032x          046d:0892	Logitech Orbicam
vc032x          046d:0896	Logitech Orbicam
vc032x          046d:0897	Logitech QuickCam for Dell notebooks
zc3xx           046d:089d	Logitech QuickCam E2500
zc3xx           046d:08a0	Logitech QC IM
zc3xx           046d:08a1	Logitech QC IM 0x08A1 +sound
zc3xx           046d:08a2	Labtec Webcam Pro
zc3xx           046d:08a3	Logitech QC Chat
zc3xx           046d:08a6	Logitech QCim
zc3xx           046d:08a7	Logitech QuickCam Image
zc3xx           046d:08a9	Logitech Notebook Deluxe
zc3xx           046d:08aa	Labtec Webcam Notebook
zc3xx           046d:08ac	Logitech QuickCam Cool
zc3xx           046d:08ad	Logitech QCCommunicate STX
zc3xx           046d:08ae	Logitech QuickCam for Notebooks
zc3xx           046d:08af	Logitech QuickCam Cool
zc3xx           046d:08b9	Logitech QuickCam Express
zc3xx           046d:08d7	Logitech QCam STX
zc3xx           046d:08d8	Logitech Notebook Deluxe
zc3xx           046d:08d9	Logitech QuickCam IM/Connect
zc3xx           046d:08da	Logitech QuickCam Messenger
zc3xx           046d:08dd	Logitech QuickCam for Notebooks
spca500         046d:0900	Logitech Inc. ClickSmart 310
spca500         046d:0901	Logitech Inc. ClickSmart 510
sunplus         046d:0905	Logitech ClickSmart 820
tv8532          046d:0920	Logitech QuickCam Express
tv8532          046d:0921	Labtec Webcam
spca561         046d:0928	Logitech QC Express Etch2
spca561         046d:0929	Labtec Webcam Elch2
spca561         046d:092a	Logitech QC for Notebook
spca561         046d:092b	Labtec Webcam Plus
spca561         046d:092c	Logitech QC chat Elch2
spca561         046d:092d	Logitech QC Elch2
spca561         046d:092e	Logitech QC Elch2
spca561         046d:092f	Logitech QuickCam Express Plus
sunplus         046d:0960	Logitech ClickSmart 420
nw80x           046d:d001	Logitech QuickCam Pro (dark focus ring)
se401           0471:030b	PhilipsPCVC665K
sunplus         0471:0322	Philips DMVC1300K
zc3xx           0471:0325	Philips SPC 200 NC
zc3xx           0471:0326	Philips SPC 300 NC
sonixj          0471:0327	Philips SPC 600 NC
sonixj          0471:0328	Philips SPC 700 NC
zc3xx           0471:032d	Philips SPC 210 NC
zc3xx           0471:032e	Philips SPC 315 NC
sonixj          0471:0330	Philips SPC 710 NC
se401           047d:5001	Kensington67014
se401           047d:5002	Kensington6701(5/7)
se401           047d:5003	Kensington67016
spca501         0497:c001	Smile International
sunplus         04a5:3003	Benq DC 1300
sunplus         04a5:3008	Benq DC 1500
sunplus         04a5:300a	Benq DC 3410
spca500         04a5:300c	Benq DC 1016
benq            04a5:3035	Benq DC E300
vicam           04c1:009d	HomeConnect Webcam [vicam]
konica          04c8:0720	IntelYC 76
finepix         04cb:0104	Fujifilm FinePix 4800
finepix         04cb:0109	Fujifilm FinePix A202
finepix         04cb:010b	Fujifilm FinePix A203
finepix         04cb:010f	Fujifilm FinePix A204
finepix         04cb:0111	Fujifilm FinePix A205
finepix         04cb:0113	Fujifilm FinePix A210
finepix         04cb:0115	Fujifilm FinePix A303
finepix         04cb:0117	Fujifilm FinePix A310
finepix         04cb:0119	Fujifilm FinePix F401
finepix         04cb:011b	Fujifilm FinePix F402
finepix         04cb:011d	Fujifilm FinePix F410
finepix         04cb:0121	Fujifilm FinePix F601
finepix         04cb:0123	Fujifilm FinePix F700
finepix         04cb:0125	Fujifilm FinePix M603
finepix         04cb:0127	Fujifilm FinePix S300
finepix         04cb:0129	Fujifilm FinePix S304
finepix         04cb:012b	Fujifilm FinePix S500
finepix         04cb:012d	Fujifilm FinePix S602
finepix         04cb:012f	Fujifilm FinePix S700
finepix         04cb:0131	Fujifilm FinePix unknown model
finepix         04cb:013b	Fujifilm FinePix unknown model
finepix         04cb:013d	Fujifilm FinePix unknown model
finepix         04cb:013f	Fujifilm FinePix F420
sunplus         04f1:1001	JVC GC A50
spca561         04fc:0561	Flexcam 100
spca1528        04fc:1528	Sunplus MD80 clone
sunplus         04fc:500c	Sunplus CA500C
sunplus         04fc:504a	Aiptek Mini PenCam 1.3
sunplus         04fc:504b	Maxell MaxPocket LE 1.3
sunplus         04fc:5330	Digitrex 2110
sunplus         04fc:5360	Sunplus Generic
spca500         04fc:7333	PalmPixDC85
sunplus         04fc:ffff	Pure DigitalDakota
nw80x           0502:d001	DVC V6
spca501         0506:00df	3Com HomeConnect Lite
sunplus         052b:1507	Megapixel 5 Pretec DC-1007
sunplus         052b:1513	Megapix V4
sunplus         052b:1803	MegaImage VI
nw80x           052b:d001	EZCam Pro p35u
tv8532          0545:808b	Veo Stingray
tv8532          0545:8333	Veo Stingray
sunplus         0546:3155	Polaroid PDC3070
sunplus         0546:3191	Polaroid Ion 80
sunplus         0546:3273	Polaroid PDC2030
touptek         0547:6801	TTUCMOS08000KPB, AS MU800
dtcs033         0547:7303	Anchor Chips, Inc
ov519           054c:0154	Sonny toy4
ov519           054c:0155	Sonny toy5
cpia1           0553:0002	CPIA CPiA (version1) based cameras
stv0680         0553:0202	STV0680 Camera
zc3xx           055f:c005	Mustek Wcam300A
spca500         055f:c200	Mustek Gsmart 300
sunplus         055f:c211	Kowa Bs888e Microcamera
spca500         055f:c220	Gsmart Mini
sunplus         055f:c230	Mustek Digicam 330K
sunplus         055f:c232	Mustek MDC3500
sunplus         055f:c360	Mustek DV4000 Mpeg4
sunplus         055f:c420	Mustek gSmart Mini 2
sunplus         055f:c430	Mustek Gsmart LCD 2
sunplus         055f:c440	Mustek DV 3000
sunplus         055f:c520	Mustek gSmart Mini 3
sunplus         055f:c530	Mustek Gsmart LCD 3
sunplus         055f:c540	Gsmart D30
sunplus         055f:c630	Mustek MDC4000
sunplus         055f:c650	Mustek MDC5500Z
nw80x           055f:d001	Mustek Wcam 300 mini
zc3xx           055f:d003	Mustek WCam300A
zc3xx           055f:d004	Mustek WCam300 AN
conex           0572:0041	Creative Notebook cx11646
ov519           05a9:0511	Video Blaster WebCam 3/WebCam Plus, D-Link USB Digital Video Camera
ov519           05a9:0518	Creative WebCam
ov519           05a9:0519	OV519 Microphone
ov519           05a9:0530	OmniVision
ov534_9         05a9:1550	OmniVision VEHO Filmscanner
ov519           05a9:2800	OmniVision SuperCAM
ov519           05a9:4519	Webcam Classic
ov534_9         05a9:8065	OmniVision test kit ov538+ov9712
ov519           05a9:8519	OmniVision
ov519           05a9:a511	D-Link USB Digital Video Camera
ov519           05a9:a518	D-Link DSB-C310 Webcam
sunplus         05da:1018	Digital Dream Enigma 1.3
stk014          05e1:0893	Syntek DV4000
gl860           05e3:0503	Genesys Logic PC Camera
gl860           05e3:f191	Genesys Logic PC Camera
vicam           0602:1001	ViCam Webcam
spca561         060b:a001	Maxell Compact Pc PM3
zc3xx           0698:2003	CTX M730V built in
topro           06a2:0003	TP6800 PC Camera, CmoX CX0342 webcam
topro           06a2:6810	Creative Qmax
nw80x           06a5:0000	Typhoon Webcam 100 USB
nw80x           06a5:d001	Divio based webcams
nw80x           06a5:d800	Divio Chicony TwinkleCam, Trust SpaceCam
spca500         06bd:0404	Agfa CL20
spca500         06be:0800	Optimedia
nw80x           06be:d001	EZCam Pro p35u
sunplus         06d6:0031	Trust 610 LCD PowerC@m Zoom
sunplus         06d6:0041	Aashima Technology B.V.
spca506         06e1:a190	ADS Instant VCD
ov534           06f8:3002	Hercules Blog Webcam
ov534_9         06f8:3003	Hercules Dualpix HD Weblog
sonixj          06f8:3004	Hercules Classic Silver
sonixj          06f8:3008	Hercules Deluxe Optical Glass
pac7302         06f8:3009	Hercules Classic Link
pac7302         06f8:301b	Hercules Link
nw80x           0728:d001	AVerMedia Camguard
spca508         0733:0110	ViewQuest VQ110
spca501         0733:0401	Intel Create and Share
spca501         0733:0402	ViewQuest M318B
spca505         0733:0430	Intel PC Camera Pro
sunplus         0733:1311	Digital Dream Epsilon 1.3
sunplus         0733:1314	Mercury 2.1MEG Deluxe Classic Cam
sunplus         0733:2211	Jenoptik jdc 21 LCD
sunplus         0733:2221	Mercury Digital Pro 3.1p
sunplus         0733:3261	Concord 3045 spca536a
sunplus         0733:3281	Cyberpix S550V
spca506         0734:043b	3DeMon USB Capture aka
cpia1           0813:0001	QX3 camera
ov519           0813:0002	Dual Mode USB Camera Plus
spca500         084d:0003	D-Link DSC-350
spca500         08ca:0103	Aiptek PocketDV
sunplus         08ca:0104	Aiptek PocketDVII 1.3
sunplus         08ca:0106	Aiptek Pocket DV3100+
mr97310a        08ca:0110	Trust Spyc@m 100
mr97310a        08ca:0111	Aiptek PenCam VGA+
sunplus         08ca:2008	Aiptek Mini PenCam 2 M
sunplus         08ca:2010	Aiptek PocketCam 3M
sunplus         08ca:2016	Aiptek PocketCam 2 Mega
sunplus         08ca:2018	Aiptek Pencam SD 2M
sunplus         08ca:2020	Aiptek Slim 3000F
sunplus         08ca:2022	Aiptek Slim 3200
sunplus         08ca:2024	Aiptek DV3500 Mpeg4
sunplus         08ca:2028	Aiptek PocketCam4M
sunplus         08ca:2040	Aiptek PocketDV4100M
sunplus         08ca:2042	Aiptek PocketDV5100
sunplus         08ca:2050	Medion MD 41437
sunplus         08ca:2060	Aiptek PocketDV5300
tv8532          0923:010f	ICM532 cams
mr97310a        093a:010e	All known CIF cams with this ID
mr97310a        093a:010f	All known VGA cams with this ID
mars            093a:050f	Mars-Semi Pc-Camera
pac207          093a:2460	Qtec Webcam 100
pac207          093a:2461	HP Webcam
pac207          093a:2463	Philips SPC 220 NC
pac207          093a:2464	Labtec Webcam 1200
pac207          093a:2468	Webcam WB-1400T
pac207          093a:2470	Genius GF112
pac207          093a:2471	Genius VideoCam ge111
pac207          093a:2472	Genius VideoCam ge110
pac207          093a:2474	Genius iLook 111
pac207          093a:2476	Genius e-Messenger 112
pac7311         093a:2600	PAC7311 Typhoon
pac7311         093a:2601	Philips SPC 610 NC
pac7311         093a:2603	Philips SPC 500 NC
pac7311         093a:2608	Trust WB-3300p
pac7311         093a:260e	Gigaware VGA PC Camera, Trust WB-3350p, SIGMA cam 2350
pac7311         093a:260f	SnakeCam
pac7302         093a:2620	Apollo AC-905
pac7302         093a:2621	PAC731x
pac7302         093a:2622	Genius Eye 312
pac7302         093a:2623	Pixart Imaging, Inc.
pac7302         093a:2624	PAC7302
pac7302         093a:2625	Genius iSlim 310
pac7302         093a:2626	Labtec 2200
pac7302         093a:2627	Genius FaceCam 300
pac7302         093a:2628	Genius iLook 300
pac7302         093a:2629	Genius iSlim 300
pac7302         093a:262a	Webcam 300k
pac7302         093a:262c	Philips SPC 230 NC
jl2005bcd       0979:0227	Various brands, 19 known cameras supported
jeilinj         0979:0270	Sakar 57379
jeilinj         0979:0280	Sportscam DV15, Sakar 57379
zc3xx           0ac8:0301	Web Camera
zc3xx           0ac8:0302	Z-star Vimicro zc0302
vc032x          0ac8:0321	Vimicro generic vc0321
vc032x          0ac8:0323	Vimicro Vc0323
vc032x          0ac8:0328	A4Tech PK-130MG
zc3xx           0ac8:301b	Z-Star zc301b
zc3xx           0ac8:303b	Vimicro 0x303b
zc3xx           0ac8:305b	Z-star Vimicro zc0305b
zc3xx           0ac8:307b	PC Camera (ZS0211)
vc032x          0ac8:c001	Sony embedded vimicro
vc032x          0ac8:c002	Sony embedded vimicro
vc032x          0ac8:c301	Samsung Q1 Ultra Premium
spca508         0af9:0010	Hama USB Sightcam 100
spca508         0af9:0011	Hama USB Sightcam 100
ov519           0b62:0059	iBOT2 Webcam
sonixb          0c45:6001	Genius VideoCAM NB
sonixb          0c45:6005	Microdia Sweex Mini Webcam
sonixb          0c45:6007	Sonix sn9c101 + Tas5110D
sonixb          0c45:6009	spcaCam@120
sonixb          0c45:600d	spcaCam@120
sonixb          0c45:6011	Microdia PC Camera (SN9C102)
sonixb          0c45:6019	Generic Sonix OV7630
sonixb          0c45:6024	Generic Sonix Tas5130c
sonixb          0c45:6025	Xcam Shanga
sonixb          0c45:6027	GeniusEye 310
sonixb          0c45:6028	Sonix Btc Pc380
sonixb          0c45:6029	spcaCam@150
sonixb          0c45:602a	Meade ETX-105EC Camera
sonixb          0c45:602c	Generic Sonix OV7630
sonixb          0c45:602d	LIC-200 LG
sonixb          0c45:602e	Genius VideoCam Messenger
sonixj          0c45:6040	Speed NVC 350K
sonixj          0c45:607c	Sonix sn9c102p Hv7131R
sonixb          0c45:6083	VideoCAM Look
sonixb          0c45:608c	VideoCAM Look
sonixb          0c45:608f	PC Camera (SN9C103 + OV7630)
sonixb          0c45:60a8	VideoCAM Look
sonixb          0c45:60aa	VideoCAM Look
sonixb          0c45:60af	VideoCAM Look
sonixb          0c45:60b0	Genius VideoCam Look
sonixj          0c45:60c0	Sangha Sn535
sonixj          0c45:60ce	USB-PC-Camera-168 (TALK-5067)
sonixj          0c45:60ec	SN9C105+MO4000
sonixj          0c45:60fb	Surfer NoName
sonixj          0c45:60fc	LG-LIC300
sonixj          0c45:60fe	Microdia Audio
sonixj          0c45:6100	PC Camera (SN9C128)
sonixj          0c45:6102	PC Camera (SN9C128)
sonixj          0c45:610a	PC Camera (SN9C128)
sonixj          0c45:610b	PC Camera (SN9C128)
sonixj          0c45:610c	PC Camera (SN9C128)
sonixj          0c45:610e	PC Camera (SN9C128)
sonixj          0c45:6128	Microdia/Sonix SNP325
sonixj          0c45:612a	Avant Camera
sonixj          0c45:612b	Speed-Link REFLECT2
sonixj          0c45:612c	Typhoon Rasy Cam 1.3MPix
sonixj          0c45:612e	PC Camera (SN9C110)
sonixj          0c45:6130	Sonix Pccam
sonixj          0c45:6138	Sn9c120 Mo4000
sonixj          0c45:613a	Microdia Sonix PC Camera
sonixj          0c45:613b	Surfer SN-206
sonixj          0c45:613c	Sonix Pccam168
sonixj          0c45:613e	PC Camera (SN9C120)
sonixj          0c45:6142	Hama PC-Webcam AC-150
sonixj          0c45:6143	Sonix Pccam168
sonixj          0c45:6148	Digitus DA-70811/ZSMC USB PC Camera ZS211/Microdia
sonixj          0c45:614a	Frontech E-Ccam (JIL-2225)
sn9c20x         0c45:6240	PC Camera (SN9C201 + MT9M001)
sn9c20x         0c45:6242	PC Camera (SN9C201 + MT9M111)
sn9c20x         0c45:6248	PC Camera (SN9C201 + OV9655)
sn9c20x         0c45:624c	PC Camera (SN9C201 + MT9M112)
sn9c20x         0c45:624e	PC Camera (SN9C201 + SOI968)
sn9c20x         0c45:624f	PC Camera (SN9C201 + OV9650)
sn9c20x         0c45:6251	PC Camera (SN9C201 + OV9650)
sn9c20x         0c45:6253	PC Camera (SN9C201 + OV9650)
sn9c20x         0c45:6260	PC Camera (SN9C201 + OV7670)
sn9c20x         0c45:6270	PC Camera (SN9C201 + MT9V011/MT9V111/MT9V112)
sn9c20x         0c45:627b	PC Camera (SN9C201 + OV7660)
sn9c20x         0c45:627c	PC Camera (SN9C201 + HV7131R)
sn9c20x         0c45:627f	PC Camera (SN9C201 + OV9650)
sn9c20x         0c45:6280	PC Camera (SN9C202 + MT9M001)
sn9c20x         0c45:6282	PC Camera (SN9C202 + MT9M111)
sn9c20x         0c45:6288	PC Camera (SN9C202 + OV9655)
sn9c20x         0c45:628c	PC Camera (SN9C201 + MT9M112)
sn9c20x         0c45:628e	PC Camera (SN9C202 + SOI968)
sn9c20x         0c45:628f	PC Camera (SN9C202 + OV9650)
sn9c20x         0c45:62a0	PC Camera (SN9C202 + OV7670)
sn9c20x         0c45:62b0	PC Camera (SN9C202 + MT9V011/MT9V111/MT9V112)
sn9c20x         0c45:62b3	PC Camera (SN9C202 + OV9655)
sn9c20x         0c45:62bb	PC Camera (SN9C202 + OV7660)
sn9c20x         0c45:62bc	PC Camera (SN9C202 + HV7131R)
sn9c2028        0c45:8001	Wild Planet Digital Spy Camera
sn9c2028        0c45:8003	Sakar #11199, #6637x, #67480 keychain cams
sn9c2028        0c45:8008	Mini-Shotz ms-350
sn9c2028        0c45:800a	Vivitar Vivicam 3350B
sunplus         0d64:0303	Sunplus FashionCam DXG
ov519           0e96:c001	TRUST 380 USB2 SPACEC@M
etoms           102c:6151	Qcam Sangha CIF
etoms           102c:6251	Qcam xxxxxx VGA
ov519           1046:9967	W9967CF/W9968CF WebCam IC, Video Blaster WebCam Go
zc3xx           10fd:0128	Typhoon Webshot II USB 300k 0x0128
spca561         10fd:7e50	FlyCam Usb 100
zc3xx           10fd:804d	Typhoon Webshot II Webcam [zc0301]
zc3xx           10fd:8050	Typhoon Webshot II USB 300k
ov534           1415:2000	Sony HD Eye for PS3 (SLEH 00201)
pac207          145f:013a	Trust WB-1300N
pac7302         145f:013c	Trust
sn9c20x         145f:013d	Trust WB-3600R
vc032x          15b8:6001	HP 2.0 Megapixel
vc032x          15b8:6002	HP 2.0 Megapixel rz406aa
stk1135         174f:6a31	ASUSlaptop, MT9M112 sensor
spca501         1776:501c	Arowana 300K CMOS Camera
t613            17a1:0128	TASCORP JPEG Webcam, NGS Cyclops
vc032x          17ef:4802	Lenovo Vc0323+MI1310_SOC
pac7302         1ae7:2001	SpeedLinkSnappy Mic SL-6825-SBK
pac207          2001:f115	D-Link DSB-C120
sq905c          2770:9050	Disney pix micro (CIF)
sq905c          2770:9051	Lego Bionicle
sq905c          2770:9052	Disney pix micro 2 (VGA)
sq905c          2770:905c	All 11 known cameras with this ID
sq905           2770:9120	All 24 known cameras with this ID
sq905c          2770:913d	All 4 known cameras with this ID
sq930x          2770:930b	Sweex Motion Tracking / I-Tec iCam Tracer
sq930x          2770:930c	Trust WB-3500T / NSG Robbie 2.0
spca500         2899:012c	Toptro Industrial
ov519           8020:ef04	ov519
spca508         8086:0110	Intel Easy PC Camera
spca500         8086:0630	Intel Pocket PC Camera
spca506         99fa:8988	Grandtec V.cap
sn9c20x         a168:0610	Dino-Lite Digital Microscope (SN9C201 + HV7131R)
sn9c20x         a168:0611	Dino-Lite Digital Microscope (SN9C201 + HV7131R)
sn9c20x         a168:0613	Dino-Lite Digital Microscope (SN9C201 + HV7131R)
sn9c20x         a168:0614	Dino-Lite Digital Microscope (SN9C201 + MT9M111)
sn9c20x         a168:0615	Dino-Lite Digital Microscope (SN9C201 + MT9M111)
sn9c20x         a168:0617	Dino-Lite Digital Microscope (SN9C201 + MT9M111)
sn9c20x         a168:0618	Dino-Lite Digital Microscope (SN9C201 + HV7131R)
spca561         abcd:cdee	Petcam
=========	=========	===================================================================


code:
.. SPDX-License-Identifier: GPL-2.0

I²C drivers
===========

The I²C (Inter-Integrated Circuit) bus is a three-wires bus used internally
at the media cards for communication between different chips. While the bus
is not visible to the Linux Kernel, drivers need to send and receive
commands via the bus. The Linux Kernel driver abstraction has support to
implement different drivers for each component inside an I²C bus, as if
the bus were visible to the main system board.

One of the problems with I²C devices is that sometimes the same device may
work with different I²C hardware. This is common, for example, on devices
that comes with a tuner for North America market, and another one for
Europe. Some drivers have a ``tuner=`` modprobe parameter to allow using a
different tuner number in order to address such issue.

The current supported of I²C drivers (not including staging drivers) are
listed below.

Audio decoders, processors and mixers
-------------------------------------

============  ==========================================================
Driver        Name
============  ==========================================================
cs3308        Cirrus Logic CS3308 audio ADC
cs5345        Cirrus Logic CS5345 audio ADC
cs53l32a      Cirrus Logic CS53L32A audio ADC
msp3400       Micronas MSP34xx audio decoders
sony-btf-mpx  Sony BTF's internal MPX
tda1997x      NXP TDA1997x HDMI receiver
tda7432       Philips TDA7432 audio processor
tda9840       Philips TDA9840 audio processor
tea6415c      Philips TEA6415C audio processor
tea6420       Philips TEA6420 audio processor
tlv320aic23b  Texas Instruments TLV320AIC23B audio codec
tvaudio       Simple audio decoder chips
uda1342       Philips UDA1342 audio codec
vp27smpx      Panasonic VP27's internal MPX
wm8739        Wolfson Microelectronics WM8739 stereo audio ADC
wm8775        Wolfson Microelectronics WM8775 audio ADC with input mixer
============  ==========================================================

Audio/Video compression chips
-----------------------------

============  ==========================================================
Driver        Name
============  ==========================================================
saa6752hs     Philips SAA6752HS MPEG-2 Audio/Video Encoder
============  ==========================================================

Camera sensor devices
---------------------

============  ==========================================================
Driver        Name
============  ==========================================================
ccs           MIPI CCS compliant camera sensors (also SMIA++ and SMIA)
et8ek8        ET8EK8 camera sensor
hi556         Hynix Hi-556 sensor
hi846         Hynix Hi-846 sensor
imx208        Sony IMX208 sensor
imx214        Sony IMX214 sensor
imx219        Sony IMX219 sensor
imx258        Sony IMX258 sensor
imx274        Sony IMX274 sensor
imx290        Sony IMX290 sensor
imx319        Sony IMX319 sensor
imx334        Sony IMX334 sensor
imx355        Sony IMX355 sensor
imx412        Sony IMX412 sensor
m5mols        Fujitsu M-5MOLS 8MP sensor
mt9m001       mt9m001
mt9m032       MT9M032 camera sensor
mt9m111       mt9m111, mt9m112 and mt9m131
mt9p031       Aptina MT9P031
mt9t001       Aptina MT9T001
mt9t112       Aptina MT9T111/MT9T112
mt9v011       Micron mt9v011 sensor
mt9v032       Micron MT9V032 sensor
mt9v111       Aptina MT9V111 sensor
noon010pc30   Siliconfile NOON010PC30 sensor
ov13858       OmniVision OV13858 sensor
ov13b10       OmniVision OV13B10 sensor
ov2640        OmniVision OV2640 sensor
ov2659        OmniVision OV2659 sensor
ov2680        OmniVision OV2680 sensor
ov2685        OmniVision OV2685 sensor
ov5640        OmniVision OV5640 sensor
ov5645        OmniVision OV5645 sensor
ov5647        OmniVision OV5647 sensor
ov5670        OmniVision OV5670 sensor
ov5675        OmniVision OV5675 sensor
ov5695        OmniVision OV5695 sensor
ov6650        OmniVision OV6650 sensor
ov7251        OmniVision OV7251 sensor
ov7640        OmniVision OV7640 sensor
ov7670        OmniVision OV7670 sensor
ov772x        OmniVision OV772x sensor
ov7740        OmniVision OV7740 sensor
ov8856        OmniVision OV8856 sensor
ov9640        OmniVision OV9640 sensor
ov9650        OmniVision OV9650/OV9652 sensor
rj54n1cb0c    Sharp RJ54N1CB0C sensor
s5c73m3       Samsung S5C73M3 sensor
s5k4ecgx      Samsung S5K4ECGX sensor
s5k5baf       Samsung S5K5BAF sensor
s5k6a3        Samsung S5K6A3 sensor
s5k6aa        Samsung S5K6AAFX sensor
sr030pc30     Siliconfile SR030PC30 sensor
vs6624        ST VS6624 sensor
============  ==========================================================

Flash devices
-------------

============  ==========================================================
Driver        Name
============  ==========================================================
adp1653       ADP1653 flash
lm3560        LM3560 dual flash driver
lm3646        LM3646 dual flash driver
============  ==========================================================

IR I2C driver
-------------

============  ==========================================================
Driver        Name
============  ==========================================================
ir-kbd-i2c    I2C module for IR
============  ==========================================================

Lens drivers
------------

============  ==========================================================
Driver        Name
============  ==========================================================
ad5820        AD5820 lens voice coil
ak7375        AK7375 lens voice coil
dw9714        DW9714 lens voice coil
dw9768        DW9768 lens voice coil
dw9807-vcm    DW9807 lens voice coil
============  ==========================================================

Miscellaneous helper chips
--------------------------

============  ==========================================================
Driver        Name
============  ==========================================================
video-i2c     I2C transport video
m52790        Mitsubishi M52790 A/V switch
st-mipid02    STMicroelectronics MIPID02 CSI-2 to PARALLEL bridge
ths7303       THS7303/53 Video Amplifier
============  ==========================================================

RDS decoders
------------

============  ==========================================================
Driver        Name
============  ==========================================================
saa6588       SAA6588 Radio Chip RDS decoder
============  ==========================================================

SDR tuner chips
---------------

============  ==========================================================
Driver        Name
============  ==========================================================
max2175       Maxim 2175 RF to Bits tuner
============  ==========================================================

Video and audio decoders
------------------------

============  ==========================================================
Driver        Name
============  ==========================================================
cx25840       Conexant CX2584x audio/video decoders
saa717x       Philips SAA7171/3/4 audio/video decoders
============  ==========================================================

Video decoders
--------------

============  ==========================================================
Driver        Name
============  ==========================================================
adv7180       Analog Devices ADV7180 decoder
adv7183       Analog Devices ADV7183 decoder
adv748x       Analog Devices ADV748x decoder
adv7604       Analog Devices ADV7604 decoder
adv7842       Analog Devices ADV7842 decoder
bt819         BT819A VideoStream decoder
bt856         BT856 VideoStream decoder
bt866         BT866 VideoStream decoder
ks0127        KS0127 video decoder
ml86v7667     OKI ML86V7667 video decoder
saa7110       Philips SAA7110 video decoder
saa7115       Philips SAA7111/3/4/5 video decoders
tc358743      Toshiba TC358743 decoder
tvp514x       Texas Instruments TVP514x video decoder
tvp5150       Texas Instruments TVP5150 video decoder
tvp7002       Texas Instruments TVP7002 video decoder
tw2804        Techwell TW2804 multiple video decoder
tw9903        Techwell TW9903 video decoder
tw9906        Techwell TW9906 video decoder
tw9910        Techwell TW9910 video decoder
vpx3220       vpx3220a, vpx3216b & vpx3214c video decoders
============  ==========================================================

Video encoders
--------------

============  ==========================================================
Driver        Name
============  ==========================================================
ad9389b       Analog Devices AD9389B encoder
adv7170       Analog Devices ADV7170 video encoder
adv7175       Analog Devices ADV7175 video encoder
adv7343       ADV7343 video encoder
adv7393       ADV7393 video encoder
adv7511-v4l2  Analog Devices ADV7511 encoder
ak881x        AK8813/AK8814 video encoders
saa7127       Philips SAA7127/9 digital video encoders
saa7185       Philips SAA7185 video encoder
ths8200       Texas Instruments THS8200 video encoder
============  ==========================================================

Video improvement chips
-----------------------

============  ==========================================================
Driver        Name
============  ==========================================================
upd64031a     NEC Electronics uPD64031A Ghost Reduction
upd64083      NEC Electronics uPD64083 3-Dimensional Y/C separation
============  ==========================================================

Tuner drivers
-------------

============  ==================================================
Driver        Name
============  ==================================================
e4000         Elonics E4000 silicon tuner
fc0011        Fitipower FC0011 silicon tuner
fc0012        Fitipower FC0012 silicon tuner
fc0013        Fitipower FC0013 silicon tuner
fc2580        FCI FC2580 silicon tuner
it913x        ITE Tech IT913x silicon tuner
m88rs6000t    Montage M88RS6000 internal tuner
max2165       Maxim MAX2165 silicon tuner
mc44s803      Freescale MC44S803 Low Power CMOS Broadband tuners
msi001        Mirics MSi001
mt2060        Microtune MT2060 silicon IF tuner
mt2063        Microtune MT2063 silicon IF tuner
mt20xx        Microtune 2032 / 2050 tuners
mt2131        Microtune MT2131 silicon tuner
mt2266        Microtune MT2266 silicon tuner
mxl301rf      MaxLinear MxL301RF tuner
mxl5005s      MaxLinear MSL5005S silicon tuner
mxl5007t      MaxLinear MxL5007T silicon tuner
qm1d1b0004    Sharp QM1D1B0004 tuner
qm1d1c0042    Sharp QM1D1C0042 tuner
qt1010        Quantek QT1010 silicon tuner
r820t         Rafael Micro R820T silicon tuner
si2157        Silicon Labs Si2157 silicon tuner
tuner-types   Simple tuner support
tda18212      NXP TDA18212 silicon tuner
tda18218      NXP TDA18218 silicon tuner
tda18250      NXP TDA18250 silicon tuner
tda18271      NXP TDA18271 silicon tuner
tda827x       Philips TDA827X silicon tuner
tda8290       TDA 8290/8295 + 8275(a)/18271 tuner combo
tda9887       TDA 9885/6/7 analog IF demodulator
tea5761       TEA 5761 radio tuner
tea5767       TEA 5767 radio tuner
tua9001       Infineon TUA9001 silicon tuner
xc2028        XCeive xc2028/xc3028 tuners
xc4000        Xceive XC4000 silicon tuner
xc5000        Xceive XC5000 silicon tuner
============  ==================================================

.. toctree::
	:maxdepth: 1

	tuner-cardlist
	frontend-cardlist


code:
.. SPDX-License-Identifier: GPL-2.0

i.MX Video Capture Driver
=========================

Introduction
------------

The Freescale i.MX5/6 contains an Image Processing Unit (IPU), which
handles the flow of image frames to and from capture devices and
display devices.

For image capture, the IPU contains the following internal subunits:

- Image DMA Controller (IDMAC)
- Camera Serial Interface (CSI)
- Image Converter (IC)
- Sensor Multi-FIFO Controller (SMFC)
- Image Rotator (IRT)
- Video De-Interlacing or Combining Block (VDIC)

The IDMAC is the DMA controller for transfer of image frames to and from
memory. Various dedicated DMA channels exist for both video capture and
display paths. During transfer, the IDMAC is also capable of vertical
image flip, 8x8 block transfer (see IRT description), pixel component
re-ordering (for example UYVY to YUYV) within the same colorspace, and
packed <--> planar conversion. The IDMAC can also perform a simple
de-interlacing by interweaving even and odd lines during transfer
(without motion compensation which requires the VDIC).

The CSI is the backend capture unit that interfaces directly with
camera sensors over Parallel, BT.656/1120, and MIPI CSI-2 buses.

The IC handles color-space conversion, resizing (downscaling and
upscaling), horizontal flip, and 90/270 degree rotation operations.

There are three independent "tasks" within the IC that can carry out
conversions concurrently: pre-process encoding, pre-process viewfinder,
and post-processing. Within each task, conversions are split into three
sections: downsizing section, main section (upsizing, flip, colorspace
conversion, and graphics plane combining), and rotation section.

The IPU time-shares the IC task operations. The time-slice granularity
is one burst of eight pixels in the downsizing section, one image line
in the main processing section, one image frame in the rotation section.

The SMFC is composed of four independent FIFOs that each can transfer
captured frames from sensors directly to memory concurrently via four
IDMAC channels.

The IRT carries out 90 and 270 degree image rotation operations. The
rotation operation is carried out on 8x8 pixel blocks at a time. This
operation is supported by the IDMAC which handles the 8x8 block transfer
along with block reordering, in coordination with vertical flip.

The VDIC handles the conversion of interlaced video to progressive, with
support for different motion compensation modes (low, medium, and high
motion). The deinterlaced output frames from the VDIC can be sent to the
IC pre-process viewfinder task for further conversions. The VDIC also
contains a Combiner that combines two image planes, with alpha blending
and color keying.

In addition to the IPU internal subunits, there are also two units
outside the IPU that are also involved in video capture on i.MX:

- MIPI CSI-2 Receiver for camera sensors with the MIPI CSI-2 bus
  interface. This is a Synopsys DesignWare core.
- Two video multiplexers for selecting among multiple sensor inputs
  to send to a CSI.

For more info, refer to the latest versions of the i.MX5/6 reference
manuals [#f1]_ and [#f2]_.

Features
--------

Some of the features of this driver include:

- Many different pipelines can be configured via media controller API,
  that correspond to the hardware video capture pipelines supported in
  the i.MX.

- Supports parallel, BT.565, and MIPI CSI-2 interfaces.

- Concurrent independent streams, by configuring pipelines to multiple
  video capture interfaces using independent entities.

- Scaling, color-space conversion, horizontal and vertical flip, and
  image rotation via IC task subdevs.

- Many pixel formats supported (RGB, packed and planar YUV, partial
  planar YUV).

- The VDIC subdev supports motion compensated de-interlacing, with three
  motion compensation modes: low, medium, and high motion. Pipelines are
  defined that allow sending frames to the VDIC subdev directly from the
  CSI. There is also support in the future for sending frames to the
  VDIC from memory buffers via a output/mem2mem devices.

- Includes a Frame Interval Monitor (FIM) that can correct vertical sync
  problems with the ADV718x video decoders.

Topology
--------

The following shows the media topologies for the i.MX6Q SabreSD and
i.MX6Q SabreAuto. Refer to these diagrams in the entity descriptions
in the next section.

The i.MX5/6 topologies can differ upstream from the IPUv3 CSI video
multiplexers, but the internal IPUv3 topology downstream from there
is common to all i.MX5/6 platforms. For example, the SabreSD, with the
MIPI CSI-2 OV5640 sensor, requires the i.MX6 MIPI CSI-2 receiver. But
the SabreAuto has only the ADV7180 decoder on a parallel bt.656 bus, and
therefore does not require the MIPI CSI-2 receiver, so it is missing in
its graph.

.. _imx6q_topology_graph:

.. kernel-figure:: imx6q-sabresd.dot
    :alt:   Diagram of the i.MX6Q SabreSD media pipeline topology
    :align: center

    Media pipeline graph on i.MX6Q SabreSD

.. kernel-figure:: imx6q-sabreauto.dot
    :alt:   Diagram of the i.MX6Q SabreAuto media pipeline topology
    :align: center

    Media pipeline graph on i.MX6Q SabreAuto

Entities
--------

imx6-mipi-csi2
--------------

This is the MIPI CSI-2 receiver entity. It has one sink pad to receive
the MIPI CSI-2 stream (usually from a MIPI CSI-2 camera sensor). It has
four source pads, corresponding to the four MIPI CSI-2 demuxed virtual
channel outputs. Multiple source pads can be enabled to independently
stream from multiple virtual channels.

This entity actually consists of two sub-blocks. One is the MIPI CSI-2
core. This is a Synopsys Designware MIPI CSI-2 core. The other sub-block
is a "CSI-2 to IPU gasket". The gasket acts as a demultiplexer of the
four virtual channels streams, providing four separate parallel buses
containing each virtual channel that are routed to CSIs or video
multiplexers as described below.

On i.MX6 solo/dual-lite, all four virtual channel buses are routed to
two video multiplexers. Both CSI0 and CSI1 can receive any virtual
channel, as selected by the video multiplexers.

On i.MX6 Quad, virtual channel 0 is routed to IPU1-CSI0 (after selected
by a video mux), virtual channels 1 and 2 are hard-wired to IPU1-CSI1
and IPU2-CSI0, respectively, and virtual channel 3 is routed to
IPU2-CSI1 (again selected by a video mux).

ipuX_csiY_mux
-------------

These are the video multiplexers. They have two or more sink pads to
select from either camera sensors with a parallel interface, or from
MIPI CSI-2 virtual channels from imx6-mipi-csi2 entity. They have a
single source pad that routes to a CSI (ipuX_csiY entities).

On i.MX6 solo/dual-lite, there are two video mux entities. One sits
in front of IPU1-CSI0 to select between a parallel sensor and any of
the four MIPI CSI-2 virtual channels (a total of five sink pads). The
other mux sits in front of IPU1-CSI1, and again has five sink pads to
select between a parallel sensor and any of the four MIPI CSI-2 virtual
channels.

On i.MX6 Quad, there are two video mux entities. One sits in front of
IPU1-CSI0 to select between a parallel sensor and MIPI CSI-2 virtual
channel 0 (two sink pads). The other mux sits in front of IPU2-CSI1 to
select between a parallel sensor and MIPI CSI-2 virtual channel 3 (two
sink pads).

ipuX_csiY
---------

These are the CSI entities. They have a single sink pad receiving from
either a video mux or from a MIPI CSI-2 virtual channel as described
above.

This entity has two source pads. The first source pad can link directly
to the ipuX_vdic entity or the ipuX_ic_prp entity, using hardware links
that require no IDMAC memory buffer transfer.

When the direct source pad is routed to the ipuX_ic_prp entity, frames
from the CSI can be processed by one or both of the IC pre-processing
tasks.

When the direct source pad is routed to the ipuX_vdic entity, the VDIC
will carry out motion-compensated de-interlace using "high motion" mode
(see description of ipuX_vdic entity).

The second source pad sends video frames directly to memory buffers
via the SMFC and an IDMAC channel, bypassing IC pre-processing. This
source pad is routed to a capture device node, with a node name of the
format "ipuX_csiY capture".

Note that since the IDMAC source pad makes use of an IDMAC channel,
pixel reordering within the same colorspace can be carried out by the
IDMAC channel. For example, if the CSI sink pad is receiving in UYVY
order, the capture device linked to the IDMAC source pad can capture
in YUYV order. Also, if the CSI sink pad is receiving a packed YUV
format, the capture device can capture a planar YUV format such as
YUV420.

The IDMAC channel at the IDMAC source pad also supports simple
interweave without motion compensation, which is activated if the source
pad's field type is sequential top-bottom or bottom-top, and the
requested capture interface field type is set to interlaced (t-b, b-t,
or unqualified interlaced). The capture interface will enforce the same
field order as the source pad field order (interlaced-bt if source pad
is seq-bt, interlaced-tb if source pad is seq-tb).

For events produced by ipuX_csiY, see ref:`imx_api_ipuX_csiY`.

Cropping in ipuX_csiY
---------------------

The CSI supports cropping the incoming raw sensor frames. This is
implemented in the ipuX_csiY entities at the sink pad, using the
crop selection subdev API.

The CSI also supports fixed divide-by-two downscaling independently in
width and height. This is implemented in the ipuX_csiY entities at
the sink pad, using the compose selection subdev API.

The output rectangle at the ipuX_csiY source pad is the same as
the compose rectangle at the sink pad. So the source pad rectangle
cannot be negotiated, it must be set using the compose selection
API at sink pad (if /2 downscale is desired, otherwise source pad
rectangle is equal to incoming rectangle).

To give an example of crop and /2 downscale, this will crop a
1280x960 input frame to 640x480, and then /2 downscale in both
dimensions to 320x240 (assumes ipu1_csi0 is linked to ipu1_csi0_mux):

.. code-block:: none

   media-ctl -V "'ipu1_csi0_mux':2[fmt:UYVY2X8/1280x960]"
   media-ctl -V "'ipu1_csi0':0[crop:(0,0)/640x480]"
   media-ctl -V "'ipu1_csi0':0[compose:(0,0)/320x240]"

Frame Skipping in ipuX_csiY
---------------------------

The CSI supports frame rate decimation, via frame skipping. Frame
rate decimation is specified by setting the frame intervals at
sink and source pads. The ipuX_csiY entity then applies the best
frame skip setting to the CSI to achieve the desired frame rate
at the source pad.

The following example reduces an assumed incoming 60 Hz frame
rate by half at the IDMAC output source pad:

.. code-block:: none

   media-ctl -V "'ipu1_csi0':0[fmt:UYVY2X8/640x480@1/60]"
   media-ctl -V "'ipu1_csi0':2[fmt:UYVY2X8/640x480@1/30]"

Frame Interval Monitor in ipuX_csiY
-----------------------------------

See ref:`imx_api_FIM`.

ipuX_vdic
---------

The VDIC carries out motion compensated de-interlacing, with three
motion compensation modes: low, medium, and high motion. The mode is
specified with the menu control V4L2_CID_DEINTERLACING_MODE. The VDIC
has two sink pads and a single source pad.

The direct sink pad receives from an ipuX_csiY direct pad. With this
link the VDIC can only operate in high motion mode.

When the IDMAC sink pad is activated, it receives from an output
or mem2mem device node. With this pipeline, the VDIC can also operate
in low and medium modes, because these modes require receiving
frames from memory buffers. Note that an output or mem2mem device
is not implemented yet, so this sink pad currently has no links.

The source pad routes to the IC pre-processing entity ipuX_ic_prp.

ipuX_ic_prp
-----------

This is the IC pre-processing entity. It acts as a router, routing
data from its sink pad to one or both of its source pads.

This entity has a single sink pad. The sink pad can receive from the
ipuX_csiY direct pad, or from ipuX_vdic.

This entity has two source pads. One source pad routes to the
pre-process encode task entity (ipuX_ic_prpenc), the other to the
pre-process viewfinder task entity (ipuX_ic_prpvf). Both source pads
can be activated at the same time if the sink pad is receiving from
ipuX_csiY. Only the source pad to the pre-process viewfinder task entity
can be activated if the sink pad is receiving from ipuX_vdic (frames
from the VDIC can only be processed by the pre-process viewfinder task).

ipuX_ic_prpenc
--------------

This is the IC pre-processing encode entity. It has a single sink
pad from ipuX_ic_prp, and a single source pad. The source pad is
routed to a capture device node, with a node name of the format
"ipuX_ic_prpenc capture".

This entity performs the IC pre-process encode task operations:
color-space conversion, resizing (downscaling and upscaling),
horizontal and vertical flip, and 90/270 degree rotation. Flip
and rotation are provided via standard V4L2 controls.

Like the ipuX_csiY IDMAC source, this entity also supports simple
de-interlace without motion compensation, and pixel reordering.

ipuX_ic_prpvf
-------------

This is the IC pre-processing viewfinder entity. It has a single sink
pad from ipuX_ic_prp, and a single source pad. The source pad is routed
to a capture device node, with a node name of the format
"ipuX_ic_prpvf capture".

This entity is identical in operation to ipuX_ic_prpenc, with the same
resizing and CSC operations and flip/rotation controls. It will receive
and process de-interlaced frames from the ipuX_vdic if ipuX_ic_prp is
receiving from ipuX_vdic.

Like the ipuX_csiY IDMAC source, this entity supports simple
interweaving without motion compensation. However, note that if the
ipuX_vdic is included in the pipeline (ipuX_ic_prp is receiving from
ipuX_vdic), it's not possible to use interweave in ipuX_ic_prpvf,
since the ipuX_vdic has already carried out de-interlacing (with
motion compensation) and therefore the field type output from
ipuX_vdic can only be none (progressive).

Capture Pipelines
-----------------

The following describe the various use-cases supported by the pipelines.

The links shown do not include the backend sensor, video mux, or mipi
csi-2 receiver links. This depends on the type of sensor interface
(parallel or mipi csi-2). So these pipelines begin with:

sensor -> ipuX_csiY_mux -> ...

for parallel sensors, or:

sensor -> imx6-mipi-csi2 -> (ipuX_csiY_mux) -> ...

for mipi csi-2 sensors. The imx6-mipi-csi2 receiver may need to route
to the video mux (ipuX_csiY_mux) before sending to the CSI, depending
on the mipi csi-2 virtual channel, hence ipuX_csiY_mux is shown in
parenthesis.

Unprocessed Video Capture:
--------------------------

Send frames directly from sensor to camera device interface node, with
no conversions, via ipuX_csiY IDMAC source pad:

-> ipuX_csiY:2 -> ipuX_csiY capture

IC Direct Conversions:
----------------------

This pipeline uses the preprocess encode entity to route frames directly
from the CSI to the IC, to carry out scaling up to 1024x1024 resolution,
CSC, flipping, and image rotation:

-> ipuX_csiY:1 -> 0:ipuX_ic_prp:1 -> 0:ipuX_ic_prpenc:1 -> ipuX_ic_prpenc capture

Motion Compensated De-interlace:
--------------------------------

This pipeline routes frames from the CSI direct pad to the VDIC entity to
support motion-compensated de-interlacing (high motion mode only),
scaling up to 1024x1024, CSC, flip, and rotation:

-> ipuX_csiY:1 -> 0:ipuX_vdic:2 -> 0:ipuX_ic_prp:2 -> 0:ipuX_ic_prpvf:1 -> ipuX_ic_prpvf capture

Usage Notes
-----------

To aid in configuration and for backward compatibility with V4L2
applications that access controls only from video device nodes, the
capture device interfaces inherit controls from the active entities
in the current pipeline, so controls can be accessed either directly
from the subdev or from the active capture device interface. For
example, the FIM controls are available either from the ipuX_csiY
subdevs or from the active capture device.

The following are specific usage notes for the Sabre* reference
boards:

i.MX6Q SabreLite with OV5642 and OV5640
---------------------------------------

This platform requires the OmniVision OV5642 module with a parallel
camera interface, and the OV5640 module with a MIPI CSI-2
interface. Both modules are available from Boundary Devices:

- https://boundarydevices.com/product/nit6x_5mp
- https://boundarydevices.com/product/nit6x_5mp_mipi

Note that if only one camera module is available, the other sensor
node can be disabled in the device tree.

The OV5642 module is connected to the parallel bus input on the i.MX
internal video mux to IPU1 CSI0. It's i2c bus connects to i2c bus 2.

The MIPI CSI-2 OV5640 module is connected to the i.MX internal MIPI CSI-2
receiver, and the four virtual channel outputs from the receiver are
routed as follows: vc0 to the IPU1 CSI0 mux, vc1 directly to IPU1 CSI1,
vc2 directly to IPU2 CSI0, and vc3 to the IPU2 CSI1 mux. The OV5640 is
also connected to i2c bus 2 on the SabreLite, therefore the OV5642 and
OV5640 must not share the same i2c slave address.

The following basic example configures unprocessed video capture
pipelines for both sensors. The OV5642 is routed to ipu1_csi0, and
the OV5640, transmitting on MIPI CSI-2 virtual channel 1 (which is
imx6-mipi-csi2 pad 2), is routed to ipu1_csi1. Both sensors are
configured to output 640x480, and the OV5642 outputs YUYV2X8, the
OV5640 UYVY2X8:

.. code-block:: none

   # Setup links for OV5642
   media-ctl -l "'ov5642 1-0042':0 -> 'ipu1_csi0_mux':1[1]"
   media-ctl -l "'ipu1_csi0_mux':2 -> 'ipu1_csi0':0[1]"
   media-ctl -l "'ipu1_csi0':2 -> 'ipu1_csi0 capture':0[1]"
   # Setup links for OV5640
   media-ctl -l "'ov5640 1-0040':0 -> 'imx6-mipi-csi2':0[1]"
   media-ctl -l "'imx6-mipi-csi2':2 -> 'ipu1_csi1':0[1]"
   media-ctl -l "'ipu1_csi1':2 -> 'ipu1_csi1 capture':0[1]"
   # Configure pads for OV5642 pipeline
   media-ctl -V "'ov5642 1-0042':0 [fmt:YUYV2X8/640x480 field:none]"
   media-ctl -V "'ipu1_csi0_mux':2 [fmt:YUYV2X8/640x480 field:none]"
   media-ctl -V "'ipu1_csi0':2 [fmt:AYUV32/640x480 field:none]"
   # Configure pads for OV5640 pipeline
   media-ctl -V "'ov5640 1-0040':0 [fmt:UYVY2X8/640x480 field:none]"
   media-ctl -V "'imx6-mipi-csi2':2 [fmt:UYVY2X8/640x480 field:none]"
   media-ctl -V "'ipu1_csi1':2 [fmt:AYUV32/640x480 field:none]"

Streaming can then begin independently on the capture device nodes
"ipu1_csi0 capture" and "ipu1_csi1 capture". The v4l2-ctl tool can
be used to select any supported YUV pixelformat on the capture device
nodes, including planar.

i.MX6Q SabreAuto with ADV7180 decoder
-------------------------------------

On the i.MX6Q SabreAuto, an on-board ADV7180 SD decoder is connected to the
parallel bus input on the internal video mux to IPU1 CSI0.

The following example configures a pipeline to capture from the ADV7180
video decoder, assuming NTSC 720x480 input signals, using simple
interweave (unconverted and without motion compensation). The adv7180
must output sequential or alternating fields (field type 'seq-bt' for
NTSC, or 'alternate'):

.. code-block:: none

   # Setup links
   media-ctl -l "'adv7180 3-0021':0 -> 'ipu1_csi0_mux':1[1]"
   media-ctl -l "'ipu1_csi0_mux':2 -> 'ipu1_csi0':0[1]"
   media-ctl -l "'ipu1_csi0':2 -> 'ipu1_csi0 capture':0[1]"
   # Configure pads
   media-ctl -V "'adv7180 3-0021':0 [fmt:UYVY2X8/720x480 field:seq-bt]"
   media-ctl -V "'ipu1_csi0_mux':2 [fmt:UYVY2X8/720x480]"
   media-ctl -V "'ipu1_csi0':2 [fmt:AYUV32/720x480]"
   # Configure "ipu1_csi0 capture" interface (assumed at /dev/video4)
   v4l2-ctl -d4 --set-fmt-video=field=interlaced_bt

Streaming can then begin on /dev/video4. The v4l2-ctl tool can also be
used to select any supported YUV pixelformat on /dev/video4.

This example configures a pipeline to capture from the ADV7180
video decoder, assuming PAL 720x576 input signals, with Motion
Compensated de-interlacing. The adv7180 must output sequential or
alternating fields (field type 'seq-tb' for PAL, or 'alternate').

.. code-block:: none

   # Setup links
   media-ctl -l "'adv7180 3-0021':0 -> 'ipu1_csi0_mux':1[1]"
   media-ctl -l "'ipu1_csi0_mux':2 -> 'ipu1_csi0':0[1]"
   media-ctl -l "'ipu1_csi0':1 -> 'ipu1_vdic':0[1]"
   media-ctl -l "'ipu1_vdic':2 -> 'ipu1_ic_prp':0[1]"
   media-ctl -l "'ipu1_ic_prp':2 -> 'ipu1_ic_prpvf':0[1]"
   media-ctl -l "'ipu1_ic_prpvf':1 -> 'ipu1_ic_prpvf capture':0[1]"
   # Configure pads
   media-ctl -V "'adv7180 3-0021':0 [fmt:UYVY2X8/720x576 field:seq-tb]"
   media-ctl -V "'ipu1_csi0_mux':2 [fmt:UYVY2X8/720x576]"
   media-ctl -V "'ipu1_csi0':1 [fmt:AYUV32/720x576]"
   media-ctl -V "'ipu1_vdic':2 [fmt:AYUV32/720x576 field:none]"
   media-ctl -V "'ipu1_ic_prp':2 [fmt:AYUV32/720x576 field:none]"
   media-ctl -V "'ipu1_ic_prpvf':1 [fmt:AYUV32/720x576 field:none]"
   # Configure "ipu1_ic_prpvf capture" interface (assumed at /dev/video2)
   v4l2-ctl -d2 --set-fmt-video=field=none

Streaming can then begin on /dev/video2. The v4l2-ctl tool can also be
used to select any supported YUV pixelformat on /dev/video2.

This platform accepts Composite Video analog inputs to the ADV7180 on
Ain1 (connector J42).

i.MX6DL SabreAuto with ADV7180 decoder
--------------------------------------

On the i.MX6DL SabreAuto, an on-board ADV7180 SD decoder is connected to the
parallel bus input on the internal video mux to IPU1 CSI0.

The following example configures a pipeline to capture from the ADV7180
video decoder, assuming NTSC 720x480 input signals, using simple
interweave (unconverted and without motion compensation). The adv7180
must output sequential or alternating fields (field type 'seq-bt' for
NTSC, or 'alternate'):

.. code-block:: none

   # Setup links
   media-ctl -l "'adv7180 4-0021':0 -> 'ipu1_csi0_mux':4[1]"
   media-ctl -l "'ipu1_csi0_mux':5 -> 'ipu1_csi0':0[1]"
   media-ctl -l "'ipu1_csi0':2 -> 'ipu1_csi0 capture':0[1]"
   # Configure pads
   media-ctl -V "'adv7180 4-0021':0 [fmt:UYVY2X8/720x480 field:seq-bt]"
   media-ctl -V "'ipu1_csi0_mux':5 [fmt:UYVY2X8/720x480]"
   media-ctl -V "'ipu1_csi0':2 [fmt:AYUV32/720x480]"
   # Configure "ipu1_csi0 capture" interface (assumed at /dev/video0)
   v4l2-ctl -d0 --set-fmt-video=field=interlaced_bt

Streaming can then begin on /dev/video0. The v4l2-ctl tool can also be
used to select any supported YUV pixelformat on /dev/video0.

This example configures a pipeline to capture from the ADV7180
video decoder, assuming PAL 720x576 input signals, with Motion
Compensated de-interlacing. The adv7180 must output sequential or
alternating fields (field type 'seq-tb' for PAL, or 'alternate').

.. code-block:: none

   # Setup links
   media-ctl -l "'adv7180 4-0021':0 -> 'ipu1_csi0_mux':4[1]"
   media-ctl -l "'ipu1_csi0_mux':5 -> 'ipu1_csi0':0[1]"
   media-ctl -l "'ipu1_csi0':1 -> 'ipu1_vdic':0[1]"
   media-ctl -l "'ipu1_vdic':2 -> 'ipu1_ic_prp':0[1]"
   media-ctl -l "'ipu1_ic_prp':2 -> 'ipu1_ic_prpvf':0[1]"
   media-ctl -l "'ipu1_ic_prpvf':1 -> 'ipu1_ic_prpvf capture':0[1]"
   # Configure pads
   media-ctl -V "'adv7180 4-0021':0 [fmt:UYVY2X8/720x576 field:seq-tb]"
   media-ctl -V "'ipu1_csi0_mux':5 [fmt:UYVY2X8/720x576]"
   media-ctl -V "'ipu1_csi0':1 [fmt:AYUV32/720x576]"
   media-ctl -V "'ipu1_vdic':2 [fmt:AYUV32/720x576 field:none]"
   media-ctl -V "'ipu1_ic_prp':2 [fmt:AYUV32/720x576 field:none]"
   media-ctl -V "'ipu1_ic_prpvf':1 [fmt:AYUV32/720x576 field:none]"
   # Configure "ipu1_ic_prpvf capture" interface (assumed at /dev/video2)
   v4l2-ctl -d2 --set-fmt-video=field=none

Streaming can then begin on /dev/video2. The v4l2-ctl tool can also be
used to select any supported YUV pixelformat on /dev/video2.

This platform accepts Composite Video analog inputs to the ADV7180 on
Ain1 (connector J42).

i.MX6Q SabreSD with MIPI CSI-2 OV5640
-------------------------------------

Similarly to i.MX6Q SabreLite, the i.MX6Q SabreSD supports a parallel
interface OV5642 module on IPU1 CSI0, and a MIPI CSI-2 OV5640
module. The OV5642 connects to i2c bus 1 and the OV5640 to i2c bus 2.

The device tree for SabreSD includes OF graphs for both the parallel
OV5642 and the MIPI CSI-2 OV5640, but as of this writing only the MIPI
CSI-2 OV5640 has been tested, so the OV5642 node is currently disabled.
The OV5640 module connects to MIPI connector J5. The NXP part number
for the OV5640 module that connects to the SabreSD board is H120729.

The following example configures unprocessed video capture pipeline to
capture from the OV5640, transmitting on MIPI CSI-2 virtual channel 0:

.. code-block:: none

   # Setup links
   media-ctl -l "'ov5640 1-003c':0 -> 'imx6-mipi-csi2':0[1]"
   media-ctl -l "'imx6-mipi-csi2':1 -> 'ipu1_csi0_mux':0[1]"
   media-ctl -l "'ipu1_csi0_mux':2 -> 'ipu1_csi0':0[1]"
   media-ctl -l "'ipu1_csi0':2 -> 'ipu1_csi0 capture':0[1]"
   # Configure pads
   media-ctl -V "'ov5640 1-003c':0 [fmt:UYVY2X8/640x480]"
   media-ctl -V "'imx6-mipi-csi2':1 [fmt:UYVY2X8/640x480]"
   media-ctl -V "'ipu1_csi0_mux':0 [fmt:UYVY2X8/640x480]"
   media-ctl -V "'ipu1_csi0':0 [fmt:AYUV32/640x480]"

Streaming can then begin on "ipu1_csi0 capture" node. The v4l2-ctl
tool can be used to select any supported pixelformat on the capture
device node.

To determine what is the /dev/video node correspondent to
"ipu1_csi0 capture":

.. code-block:: none

   media-ctl -e "ipu1_csi0 capture"
   /dev/video0

/dev/video0 is the streaming element in this case.

Starting the streaming via v4l2-ctl:

.. code-block:: none

   v4l2-ctl --stream-mmap -d /dev/video0

Starting the streaming via Gstreamer and sending the content to the display:

.. code-block:: none

   gst-launch-1.0 v4l2src device=/dev/video0 ! kmssink

The following example configures a direct conversion pipeline to capture
from the OV5640, transmitting on MIPI CSI-2 virtual channel 0. It also
shows colorspace conversion and scaling at IC output.

.. code-block:: none

   # Setup links
   media-ctl -l "'ov5640 1-003c':0 -> 'imx6-mipi-csi2':0[1]"
   media-ctl -l "'imx6-mipi-csi2':1 -> 'ipu1_csi0_mux':0[1]"
   media-ctl -l "'ipu1_csi0_mux':2 -> 'ipu1_csi0':0[1]"
   media-ctl -l "'ipu1_csi0':1 -> 'ipu1_ic_prp':0[1]"
   media-ctl -l "'ipu1_ic_prp':1 -> 'ipu1_ic_prpenc':0[1]"
   media-ctl -l "'ipu1_ic_prpenc':1 -> 'ipu1_ic_prpenc capture':0[1]"
   # Configure pads
   media-ctl -V "'ov5640 1-003c':0 [fmt:UYVY2X8/640x480]"
   media-ctl -V "'imx6-mipi-csi2':1 [fmt:UYVY2X8/640x480]"
   media-ctl -V "'ipu1_csi0_mux':2 [fmt:UYVY2X8/640x480]"
   media-ctl -V "'ipu1_csi0':1 [fmt:AYUV32/640x480]"
   media-ctl -V "'ipu1_ic_prp':1 [fmt:AYUV32/640x480]"
   media-ctl -V "'ipu1_ic_prpenc':1 [fmt:ARGB8888_1X32/800x600]"
   # Set a format at the capture interface
   v4l2-ctl -d /dev/video1 --set-fmt-video=pixelformat=RGB3

Streaming can then begin on "ipu1_ic_prpenc capture" node.

To determine what is the /dev/video node correspondent to
"ipu1_ic_prpenc capture":

.. code-block:: none

   media-ctl -e "ipu1_ic_prpenc capture"
   /dev/video1

/dev/video1 is the streaming element in this case.

Starting the streaming via v4l2-ctl:

.. code-block:: none

   v4l2-ctl --stream-mmap -d /dev/video1

Starting the streaming via Gstreamer and sending the content to the display:

.. code-block:: none

   gst-launch-1.0 v4l2src device=/dev/video1 ! kmssink

Known Issues
------------

1. When using 90 or 270 degree rotation control at capture resolutions
   near the IC resizer limit of 1024x1024, and combined with planar
   pixel formats (YUV420, YUV422p), frame capture will often fail with
   no end-of-frame interrupts from the IDMAC channel. To work around
   this, use lower resolution and/or packed formats (YUYV, RGB3, etc.)
   when 90 or 270 rotations are needed.

File list
---------

drivers/staging/media/imx/
include/media/imx.h
include/linux/imx-media.h

References
----------

.. [#f1] http://www.nxp.com/assets/documents/data/en/reference-manuals/IMX6DQRM.pdf
.. [#f2] http://www.nxp.com/assets/documents/data/en/reference-manuals/IMX6SDLRM.pdf

Authors
-------

- Steve Longerbeam <steve_longerbeam@mentor.com>
- Philipp Zabel <kernel@pengutronix.de>
- Russell King <linux@armlinux.org.uk>

Copyright (C) 2012-2017 Mentor Graphics Inc.


code:
digraph board {
	rankdir=TB
	n00000001 [label="{{<port0> 0} | ipu1_csi0\n/dev/v4l-subdev0 | {<port1> 1 | <port2> 2}}", shape=Mrecord, style=filled, fillcolor=green]
	n00000001:port2 -> n00000005 [style=dashed]
	n00000001:port1 -> n0000000f:port0 [style=dashed]
	n00000001:port1 -> n0000000b:port0 [style=dashed]
	n00000005 [label="ipu1_csi0 capture\n/dev/video0", shape=box, style=filled, fillcolor=yellow]
	n0000000b [label="{{<port0> 0 | <port1> 1} | ipu1_vdic\n/dev/v4l-subdev1 | {<port2> 2}}", shape=Mrecord, style=filled, fillcolor=green]
	n0000000b:port2 -> n0000000f:port0 [style=dashed]
	n0000000f [label="{{<port0> 0} | ipu1_ic_prp\n/dev/v4l-subdev2 | {<port1> 1 | <port2> 2}}", shape=Mrecord, style=filled, fillcolor=green]
	n0000000f:port1 -> n00000013:port0 [style=dashed]
	n0000000f:port2 -> n0000001c:port0 [style=dashed]
	n00000013 [label="{{<port0> 0} | ipu1_ic_prpenc\n/dev/v4l-subdev3 | {<port1> 1}}", shape=Mrecord, style=filled, fillcolor=green]
	n00000013:port1 -> n00000016 [style=dashed]
	n00000016 [label="ipu1_ic_prpenc capture\n/dev/video1", shape=box, style=filled, fillcolor=yellow]
	n0000001c [label="{{<port0> 0} | ipu1_ic_prpvf\n/dev/v4l-subdev4 | {<port1> 1}}", shape=Mrecord, style=filled, fillcolor=green]
	n0000001c:port1 -> n0000001f [style=dashed]
	n0000001f [label="ipu1_ic_prpvf capture\n/dev/video2", shape=box, style=filled, fillcolor=yellow]
	n0000002f [label="{{<port0> 0} | ipu1_csi1\n/dev/v4l-subdev5 | {<port1> 1 | <port2> 2}}", shape=Mrecord, style=filled, fillcolor=green]
	n0000002f:port2 -> n00000033 [style=dashed]
	n0000002f:port1 -> n0000000f:port0 [style=dashed]
	n0000002f:port1 -> n0000000b:port0 [style=dashed]
	n00000033 [label="ipu1_csi1 capture\n/dev/video3", shape=box, style=filled, fillcolor=yellow]
	n0000003d [label="{{<port0> 0} | ipu2_csi0\n/dev/v4l-subdev6 | {<port1> 1 | <port2> 2}}", shape=Mrecord, style=filled, fillcolor=green]
	n0000003d:port2 -> n00000041 [style=dashed]
	n0000003d:port1 -> n0000004b:port0 [style=dashed]
	n0000003d:port1 -> n00000047:port0 [style=dashed]
	n00000041 [label="ipu2_csi0 capture\n/dev/video4", shape=box, style=filled, fillcolor=yellow]
	n00000047 [label="{{<port0> 0 | <port1> 1} | ipu2_vdic\n/dev/v4l-subdev7 | {<port2> 2}}", shape=Mrecord, style=filled, fillcolor=green]
	n00000047:port2 -> n0000004b:port0 [style=dashed]
	n0000004b [label="{{<port0> 0} | ipu2_ic_prp\n/dev/v4l-subdev8 | {<port1> 1 | <port2> 2}}", shape=Mrecord, style=filled, fillcolor=green]
	n0000004b:port1 -> n0000004f:port0 [style=dashed]
	n0000004b:port2 -> n00000058:port0 [style=dashed]
	n0000004f [label="{{<port0> 0} | ipu2_ic_prpenc\n/dev/v4l-subdev9 | {<port1> 1}}", shape=Mrecord, style=filled, fillcolor=green]
	n0000004f:port1 -> n00000052 [style=dashed]
	n00000052 [label="ipu2_ic_prpenc capture\n/dev/video5", shape=box, style=filled, fillcolor=yellow]
	n00000058 [label="{{<port0> 0} | ipu2_ic_prpvf\n/dev/v4l-subdev10 | {<port1> 1}}", shape=Mrecord, style=filled, fillcolor=green]
	n00000058:port1 -> n0000005b [style=dashed]
	n0000005b [label="ipu2_ic_prpvf capture\n/dev/video6", shape=box, style=filled, fillcolor=yellow]
	n0000006b [label="{{<port0> 0} | ipu2_csi1\n/dev/v4l-subdev11 | {<port1> 1 | <port2> 2}}", shape=Mrecord, style=filled, fillcolor=green]
	n0000006b:port2 -> n0000006f [style=dashed]
	n0000006b:port1 -> n0000004b:port0 [style=dashed]
	n0000006b:port1 -> n00000047:port0 [style=dashed]
	n0000006f [label="ipu2_csi1 capture\n/dev/video7", shape=box, style=filled, fillcolor=yellow]
	n00000079 [label="{{<port0> 0 | <port1> 1} | ipu1_csi0_mux\n/dev/v4l-subdev12 | {<port2> 2}}", shape=Mrecord, style=filled, fillcolor=green]
	n00000079:port2 -> n00000001:port0 [style=dashed]
	n0000007d [label="{{<port0> 0 | <port1> 1} | ipu2_csi1_mux\n/dev/v4l-subdev13 | {<port2> 2}}", shape=Mrecord, style=filled, fillcolor=green]
	n0000007d:port2 -> n0000006b:port0 [style=dashed]
	n00000081 [label="{{} | adv7180 3-0021\n/dev/v4l-subdev14 | {<port0> 0}}", shape=Mrecord, style=filled, fillcolor=green]
	n00000081:port0 -> n00000079:port1 [style=dashed]
}


code:
digraph board {
	rankdir=TB
	n00000001 [label="{{<port0> 0} | ipu1_csi0\n/dev/v4l-subdev0 | {<port1> 1 | <port2> 2}}", shape=Mrecord, style=filled, fillcolor=green]
	n00000001:port2 -> n00000005 [style=dashed]
	n00000001:port1 -> n0000000f:port0 [style=dashed]
	n00000001:port1 -> n0000000b:port0 [style=dashed]
	n00000005 [label="ipu1_csi0 capture\n/dev/video0", shape=box, style=filled, fillcolor=yellow]
	n0000000b [label="{{<port0> 0 | <port1> 1} | ipu1_vdic\n/dev/v4l-subdev1 | {<port2> 2}}", shape=Mrecord, style=filled, fillcolor=green]
	n0000000b:port2 -> n0000000f:port0 [style=dashed]
	n0000000f [label="{{<port0> 0} | ipu1_ic_prp\n/dev/v4l-subdev2 | {<port1> 1 | <port2> 2}}", shape=Mrecord, style=filled, fillcolor=green]
	n0000000f:port1 -> n00000013:port0 [style=dashed]
	n0000000f:port2 -> n0000001c:port0 [style=dashed]
	n00000013 [label="{{<port0> 0} | ipu1_ic_prpenc\n/dev/v4l-subdev3 | {<port1> 1}}", shape=Mrecord, style=filled, fillcolor=green]
	n00000013:port1 -> n00000016 [style=dashed]
	n00000016 [label="ipu1_ic_prpenc capture\n/dev/video1", shape=box, style=filled, fillcolor=yellow]
	n0000001c [label="{{<port0> 0} | ipu1_ic_prpvf\n/dev/v4l-subdev4 | {<port1> 1}}", shape=Mrecord, style=filled, fillcolor=green]
	n0000001c:port1 -> n0000001f [style=dashed]
	n0000001f [label="ipu1_ic_prpvf capture\n/dev/video2", shape=box, style=filled, fillcolor=yellow]
	n0000002f [label="{{<port0> 0} | ipu1_csi1\n/dev/v4l-subdev5 | {<port1> 1 | <port2> 2}}", shape=Mrecord, style=filled, fillcolor=green]
	n0000002f:port2 -> n00000033 [style=dashed]
	n0000002f:port1 -> n0000000f:port0 [style=dashed]
	n0000002f:port1 -> n0000000b:port0 [style=dashed]
	n00000033 [label="ipu1_csi1 capture\n/dev/video3", shape=box, style=filled, fillcolor=yellow]
	n0000003d [label="{{<port0> 0} | ipu2_csi0\n/dev/v4l-subdev6 | {<port1> 1 | <port2> 2}}", shape=Mrecord, style=filled, fillcolor=green]
	n0000003d:port2 -> n00000041 [style=dashed]
	n0000003d:port1 -> n0000004b:port0 [style=dashed]
	n0000003d:port1 -> n00000047:port0 [style=dashed]
	n00000041 [label="ipu2_csi0 capture\n/dev/video4", shape=box, style=filled, fillcolor=yellow]
	n00000047 [label="{{<port0> 0 | <port1> 1} | ipu2_vdic\n/dev/v4l-subdev7 | {<port2> 2}}", shape=Mrecord, style=filled, fillcolor=green]
	n00000047:port2 -> n0000004b:port0 [style=dashed]
	n0000004b [label="{{<port0> 0} | ipu2_ic_prp\n/dev/v4l-subdev8 | {<port1> 1 | <port2> 2}}", shape=Mrecord, style=filled, fillcolor=green]
	n0000004b:port1 -> n0000004f:port0 [style=dashed]
	n0000004b:port2 -> n00000058:port0 [style=dashed]
	n0000004f [label="{{<port0> 0} | ipu2_ic_prpenc\n/dev/v4l-subdev9 | {<port1> 1}}", shape=Mrecord, style=filled, fillcolor=green]
	n0000004f:port1 -> n00000052 [style=dashed]
	n00000052 [label="ipu2_ic_prpenc capture\n/dev/video5", shape=box, style=filled, fillcolor=yellow]
	n00000058 [label="{{<port0> 0} | ipu2_ic_prpvf\n/dev/v4l-subdev10 | {<port1> 1}}", shape=Mrecord, style=filled, fillcolor=green]
	n00000058:port1 -> n0000005b [style=dashed]
	n0000005b [label="ipu2_ic_prpvf capture\n/dev/video6", shape=box, style=filled, fillcolor=yellow]
	n0000006b [label="{{<port0> 0} | ipu2_csi1\n/dev/v4l-subdev11 | {<port1> 1 | <port2> 2}}", shape=Mrecord, style=filled, fillcolor=green]
	n0000006b:port2 -> n0000006f [style=dashed]
	n0000006b:port1 -> n0000004b:port0 [style=dashed]
	n0000006b:port1 -> n00000047:port0 [style=dashed]
	n0000006f [label="ipu2_csi1 capture\n/dev/video7", shape=box, style=filled, fillcolor=yellow]
	n00000079 [label="{{<port0> 0} | imx6-mipi-csi2\n/dev/v4l-subdev12 | {<port1> 1 | <port2> 2 | <port3> 3 | <port4> 4}}", shape=Mrecord, style=filled, fillcolor=green]
	n00000079:port2 -> n0000002f:port0 [style=dashed]
	n00000079:port3 -> n0000003d:port0 [style=dashed]
	n00000079:port1 -> n0000007f:port0 [style=dashed]
	n00000079:port4 -> n00000083:port0 [style=dashed]
	n0000007f [label="{{<port0> 0 | <port1> 1} | ipu1_csi0_mux\n/dev/v4l-subdev13 | {<port2> 2}}", shape=Mrecord, style=filled, fillcolor=green]
	n0000007f:port2 -> n00000001:port0 [style=dashed]
	n00000083 [label="{{<port0> 0 | <port1> 1} | ipu2_csi1_mux\n/dev/v4l-subdev14 | {<port2> 2}}", shape=Mrecord, style=filled, fillcolor=green]
	n00000083:port2 -> n0000006b:port0 [style=dashed]
	n00000087 [label="{{} | ov5640 1-003c\n/dev/v4l-subdev15 | {<port0> 0}}", shape=Mrecord, style=filled, fillcolor=green]
	n00000087:port0 -> n00000079:port0 [style=dashed]
}


code:
.. SPDX-License-Identifier: GPL-2.0

i.MX7 Video Capture Driver
==========================

Introduction
------------

The i.MX7 contrary to the i.MX5/6 family does not contain an Image Processing
Unit (IPU); because of that the capabilities to perform operations or
manipulation of the capture frames are less feature rich.

For image capture the i.MX7 has three units:
- CMOS Sensor Interface (CSI)
- Video Multiplexer
- MIPI CSI-2 Receiver

.. code-block:: none

   MIPI Camera Input ---> MIPI CSI-2 --- > |\
                                           | \
                                           |  \
                                           | M |
                                           | U | ------>  CSI ---> Capture
                                           | X |
                                           |  /
   Parallel Camera Input ----------------> | /
                                           |/

For additional information, please refer to the latest versions of the i.MX7
reference manual [#f1]_.

Entities
--------

imx-mipi-csi2
--------------

This is the MIPI CSI-2 receiver entity. It has one sink pad to receive the pixel
data from MIPI CSI-2 camera sensor. It has one source pad, corresponding to the
virtual channel 0. This module is compliant to previous version of Samsung
D-phy, and supports two D-PHY Rx Data lanes.

csi-mux
-------

This is the video multiplexer. It has two sink pads to select from either camera
sensor with a parallel interface or from MIPI CSI-2 virtual channel 0.  It has
a single source pad that routes to the CSI.

csi
---

The CSI enables the chip to connect directly to external CMOS image sensor. CSI
can interface directly with Parallel and MIPI CSI-2 buses. It has 256 x 64 FIFO
to store received image pixel data and embedded DMA controllers to transfer data
from the FIFO through AHB bus.

This entity has one sink pad that receives from the csi-mux entity and a single
source pad that routes video frames directly to memory buffers. This pad is
routed to a capture device node.

Usage Notes
-----------

To aid in configuration and for backward compatibility with V4L2 applications
that access controls only from video device nodes, the capture device interfaces
inherit controls from the active entities in the current pipeline, so controls
can be accessed either directly from the subdev or from the active capture
device interface. For example, the sensor controls are available either from the
sensor subdevs or from the active capture device.

Warp7 with OV2680
-----------------

On this platform an OV2680 MIPI CSI-2 module is connected to the internal MIPI
CSI-2 receiver. The following example configures a video capture pipeline with
an output of 800x600, and BGGR 10 bit bayer format:

.. code-block:: none

   # Setup links
   media-ctl -l "'ov2680 1-0036':0 -> 'imx7-mipi-csis.0':0[1]"
   media-ctl -l "'imx7-mipi-csis.0':1 -> 'csi-mux':1[1]"
   media-ctl -l "'csi-mux':2 -> 'csi':0[1]"
   media-ctl -l "'csi':1 -> 'csi capture':0[1]"

   # Configure pads for pipeline
   media-ctl -V "'ov2680 1-0036':0 [fmt:SBGGR10_1X10/800x600 field:none]"
   media-ctl -V "'csi-mux':1 [fmt:SBGGR10_1X10/800x600 field:none]"
   media-ctl -V "'csi-mux':2 [fmt:SBGGR10_1X10/800x600 field:none]"
   media-ctl -V "'imx7-mipi-csis.0':0 [fmt:SBGGR10_1X10/800x600 field:none]"
   media-ctl -V "'csi':0 [fmt:SBGGR10_1X10/800x600 field:none]"

After this streaming can start. The v4l2-ctl tool can be used to select any of
the resolutions supported by the sensor.

.. code-block:: none

	# media-ctl -p
	Media controller API version 5.2.0

	Media device information
	------------------------
	driver          imx7-csi
	model           imx-media
	serial
	bus info
	hw revision     0x0
	driver version  5.2.0

	Device topology
	- entity 1: csi (2 pads, 2 links)
	            type V4L2 subdev subtype Unknown flags 0
	            device node name /dev/v4l-subdev0
	        pad0: Sink
	                [fmt:SBGGR10_1X10/800x600 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range]
	                <- "csi-mux":2 [ENABLED]
	        pad1: Source
	                [fmt:SBGGR10_1X10/800x600 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range]
	                -> "csi capture":0 [ENABLED]

	- entity 4: csi capture (1 pad, 1 link)
	            type Node subtype V4L flags 0
	            device node name /dev/video0
	        pad0: Sink
	                <- "csi":1 [ENABLED]

	- entity 10: csi-mux (3 pads, 2 links)
	             type V4L2 subdev subtype Unknown flags 0
	             device node name /dev/v4l-subdev1
	        pad0: Sink
	                [fmt:Y8_1X8/1x1 field:none]
	        pad1: Sink
	               [fmt:SBGGR10_1X10/800x600 field:none]
	                <- "imx7-mipi-csis.0":1 [ENABLED]
	        pad2: Source
	                [fmt:SBGGR10_1X10/800x600 field:none]
	                -> "csi":0 [ENABLED]

	- entity 14: imx7-mipi-csis.0 (2 pads, 2 links)
	             type V4L2 subdev subtype Unknown flags 0
	             device node name /dev/v4l-subdev2
	        pad0: Sink
	                [fmt:SBGGR10_1X10/800x600 field:none]
	                <- "ov2680 1-0036":0 [ENABLED]
	        pad1: Source
	                [fmt:SBGGR10_1X10/800x600 field:none]
	                -> "csi-mux":1 [ENABLED]

	- entity 17: ov2680 1-0036 (1 pad, 1 link)
	             type V4L2 subdev subtype Sensor flags 0
	             device node name /dev/v4l-subdev3
	        pad0: Source
	                [fmt:SBGGR10_1X10/800x600@1/30 field:none colorspace:srgb]
	                -> "imx7-mipi-csis.0":0 [ENABLED]

i.MX6ULL-EVK with OV5640
------------------------

On this platform a parallel OV5640 sensor is connected to the CSI port.
The following example configures a video capture pipeline with an output
of 640x480 and UYVY8_2X8 format:

.. code-block:: none

   # Setup links
   media-ctl -l "'ov5640 1-003c':0 -> 'csi':0[1]"
   media-ctl -l "'csi':1 -> 'csi capture':0[1]"

   # Configure pads for pipeline
   media-ctl -v -V "'ov5640 1-003c':0 [fmt:UYVY8_2X8/640x480 field:none]"

After this streaming can start:

.. code-block:: none

   gst-launch-1.0 -v v4l2src device=/dev/video1 ! video/x-raw,format=UYVY,width=640,height=480 ! v4l2convert ! fbdevsink

.. code-block:: none

	# media-ctl -p
	Media controller API version 5.14.0

	Media device information
	------------------------
	driver          imx7-csi
	model           imx-media
	serial
	bus info
	hw revision     0x0
	driver version  5.14.0

	Device topology
	- entity 1: csi (2 pads, 2 links)
	            type V4L2 subdev subtype Unknown flags 0
	            device node name /dev/v4l-subdev0
	        pad0: Sink
	                [fmt:UYVY8_2X8/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range]
	                <- "ov5640 1-003c":0 [ENABLED,IMMUTABLE]
	        pad1: Source
	                [fmt:UYVY8_2X8/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range]
	                -> "csi capture":0 [ENABLED,IMMUTABLE]

	- entity 4: csi capture (1 pad, 1 link)
	            type Node subtype V4L flags 0
	            device node name /dev/video1
	        pad0: Sink
	                <- "csi":1 [ENABLED,IMMUTABLE]

	- entity 10: ov5640 1-003c (1 pad, 1 link)
	             type V4L2 subdev subtype Sensor flags 0
	             device node name /dev/v4l-subdev1
	        pad0: Source
	                [fmt:UYVY8_2X8/640x480@1/30 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range]
	                -> "csi":0 [ENABLED,IMMUTABLE]

References
----------

.. [#f1] https://www.nxp.com/docs/en/reference-manual/IMX7SRM.pdf