media: uvcvideo: Support devices that report an OT as an entity source
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Mon, 8 Mar 2021 10:31:28 +0000 (11:31 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 11 Jul 2021 10:53:30 +0000 (12:53 +0200)
commit8148665cb7fece4acb899f2e2dbbff7ed0720e1d
tree6756944f30078f90afff13f5af27cd60686fbb4a
parentd5737410d2ddbb63cf56e8a1b8028a8b19ec949c
media: uvcvideo: Support devices that report an OT as an entity source

commit 4ca052b4ea621d0002a5e5feace51f60ad5e6b23 upstream.

Some devices reference an output terminal as the source of extension
units. This is incorrect, as output terminals only have an input pin,
and thus can't be connected to any entity in the forward direction. The
resulting topology would cause issues when registering the media
controller graph. To avoid this problem, connect the extension unit to
the source of the output terminal instead.

While at it, and while no device has been reported to be affected by
this issue, also handle forward scans where two output terminals would
be connected together, and skip the terminals found through such an
invalid connection.

Reported-and-tested-by: John Nealy <jnealy3@yahoo.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/usb/uvc/uvc_driver.c