media: bcm2835-unicam: Fix one-to-many mapping for YUYV formats
authorDave Stevenson <dave.stevenson@raspberrypi.org>
Wed, 16 Oct 2019 17:53:06 +0000 (18:53 +0100)
committerPhil Elwell <pelwell@users.noreply.github.com>
Thu, 17 Oct 2019 10:42:51 +0000 (11:42 +0100)
commit00c1db80b0b29a329f602be5f322c4928ccee8ae
tree40245d1f9c4cad0546e49b308d30ba0072e372e8
parente866645dfd8c20c19d835556160b5446d3d4cf52
media: bcm2835-unicam: Fix one-to-many mapping for YUYV formats

V4L2 format V4L2_PIX_FMT_YUYV maps to both MEDIA_BUS_FMT_YUYV8_2X8
and MEDIA_BUS_FMT_YUYV8_1X16. The change to not cache the active
formats also meant that we only ever found the first variant of
the mediabus format when trying to setup the device.

Flag the formats that have other representations, and ensure
that the format conversion checks whether the found format
matches one supported by the sensor before returning it.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
drivers/media/platform/bcm2835/bcm2835-unicam.c