media: rkisp1: isp: Disallow multiple active sources
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Tue, 14 Jun 2022 19:11:11 +0000 (20:11 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Sun, 17 Jul 2022 11:29:53 +0000 (12:29 +0100)
commit8b52ec2d1896223d620c27688024168194d7482b
tree4e7659aa0d5cf9935f268ca5ffab0a2554bd0104
parent222c04550e2f6a145927ba2178e95777fe66d4d3
media: rkisp1: isp: Disallow multiple active sources

The ISP supports multiple source subdevs, but can only capture from a
single one at a time. The source is selected through link setup. The
driver finds the active source in its .s_stream() handler using the
media_entity_remote_pad() function. This fails to reject invalid
configurations with multiple active sources. Fix it by using the
media_pad_remote_pad_unique() helper instead, and inline
rkisp1_isp_get_source() in rkisp1_isp_s_stream() as the function is
small and has a single caller.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c