]> www.infradead.org Git - users/jedix/linux-maple.git/commit
media: adv748x-csi2: Validate the image format
authorJacopo Mondi <jacopo.mondi@ideasonboard.com>
Mon, 17 Jun 2024 16:11:30 +0000 (18:11 +0200)
committerLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Wed, 19 Jun 2024 16:43:03 +0000 (19:43 +0300)
commit61893eccf6f2f097ed66e162253a5038fd42e43f
treed7eff0c92b9543c96313ef6e2d4d9e6a9120b05e
parent990ef913e48f186a0b3c6bdf3dbcf779582ac7b5
media: adv748x-csi2: Validate the image format

The adv748x-csi2 driver configures the CSI-2 transmitter to
automatically infer the image stream format from the connected
frontend (HDMI or AFE).

Setting a new format on the subdevice hence does not actually control
the CSI-2 output format, but it's only there for the purpose of
pipeline validation.

However, there is currently no validation that the supplied media bus
code is valid and supported by the device.

With the introduction of enum_mbus_codes a list of supported format is
now available, use it to validate that the supplied format is correct
and use the default UYVY8 one if that's not the case.

Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://lore.kernel.org/r/20240617161135.130719-8-jacopo.mondi@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
drivers/media/i2c/adv748x/adv748x-csi2.c