media: rp1: csi2: Fix csi2_pad_set_fmt()
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Fri, 29 Sep 2023 13:25:10 +0000 (16:25 +0300)
committerDom Cobley <popcornmix@gmail.com>
Mon, 19 Feb 2024 11:35:21 +0000 (11:35 +0000)
commit694be24716afaebcb9b536e6e1490b525baa2648
tree704dc7d90084b52e53a300fdbe0108d2fdb09834
parentd07f604e4060e3a0dd056faf4b59167166cfe766
media: rp1: csi2: Fix csi2_pad_set_fmt()

The CSI-2 subdev's set_fmt currently allows setting the source and sink
pad formats quite freely. This is not right, as the CSI-2 block can only
do one of the following when processing the stream: 1) pass through as
is, 2) expand to 16-bits, 3) compress.

The csi2_pad_set_fmt() should take this into account, and only allow
changing the source side mbus code, compared to the sink side format.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
drivers/media/platform/raspberrypi/rp1_cfe/csi2.c