]> www.infradead.org Git - users/jedix/linux-maple.git/commit
media: rcar-csi2: Use the subdev active state
authorJacopo Mondi <jacopo.mondi@ideasonboard.com>
Mon, 17 Jun 2024 16:11:27 +0000 (18:11 +0200)
committerLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Wed, 19 Jun 2024 16:42:57 +0000 (19:42 +0300)
commita399b36ec83b2b1390f15d493fbd0db2ff467985
treec3d2ebea392000275e2d9eca0fda453989c75d74
parentf6d64d0d2897ed4e85ac00afe43e45c8b8fc0c44
media: rcar-csi2: Use the subdev active state

Create the subdevice state with v4l2_subdev_init_finalize() and
implement the init_state() operation to guarantee the state is initialized.

Store the current image format in the subdev active state and remove it
from the driver private structure.

To guarantee the same image format is applied to all source pads,
propagate the format from the sink pad to the sources, disallowing
changing format on a source pad.

To support both gen3 and gen4, which feature a different number of
source pads, introduce an helper function to return the correct number
of pads.

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