media: sun6i-csi: subdev: Use subdev active state to store active format

The sun6i_csi_bridge structure stores the active format as a struct
v4l2_mbus_framefmt instance. Now that the V4L2 subdev core supports
managing the active state, use it to replace the manually-managed
format. This simplifies the implementation of the subdev operations by
removing the need for a custom .get_fmt() handler.

The subdev state now needs to be passed manually from the .s_stream()
operation to internal functions that need to access the format. As a
result, the sun6i_csi_bridge_format() helper function is now unused and
can be dropped.

The .init_cfg() and .set_fmt() operations also need to be updated
accordingly. As a result, .set_fmt() now correctly propagates the format
from the sink pad to the source pad.

Signed-off-by: Laurent Pinchart <>
2 files changed