]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commit
media: staging/imx: remove static media link arrays
authorSteve Longerbeam <slongerbeam@gmail.com>
Fri, 15 Dec 2017 01:04:40 +0000 (20:04 -0500)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Fri, 15 Dec 2017 19:03:20 +0000 (14:03 -0500)
commit621b08eabcddb7a4ed6076dc91324c607be7e6b4
treec13c35ba62cdeeac355c0036703296f74a83ab4a
parentbf3cfaa712e5c396f5fe3b2b2a2ca5dd901de23d
media: staging/imx: remove static media link arrays

Remove the static list of media links that were formed at probe time.
These links can instead be created after all registered async subdevices
have been bound in imx_media_probe_complete().

The media links between subdevices that exist in the device tree, can
be created post-async completion by using v4l2_fwnode_parse_link() for
each endpoint node of that subdevice. Note this approach assumes
device-tree ports are equivalent to media pads (pad index equals
port id), and that device-tree endpoints are equivalent to media
links between pads.

Because links are no longer parsed by imx_media_of_parse(), its sole
function is now only to add subdevices that it encounters by walking
the OF graph to the async list, so the function has been renamed
imx_media_add_of_subdevs().

Similarly, the media links between the IPU-internal subdevice pads (the
CSI source pads, and all pads between the vdic, ic-prp, ic-prpenc, and
ic-prpvf subdevices), can be created post-async completion by looping
through the subdevice's media pads and using the const internal_subdev
table.

Because links are no longer parsed by imx_media_add_internal_subdevs(),
this function no longer needs an array of CSI subdevs to form links
from.

In summary, the following functions, which were used to form a list
of media links at probe time, are removed:

imx_media_add_pad_link()
add_internal_links()
of_add_pad_link()

replaced by these functions, called at probe time, which only populate
the async subdev list:

imx_media_add_of_subdevs()
imx_media_add_internal_subdevs()

and these functions, called at async completion, which create the
media links:

imx_media_create_of_links()
imx_media_create_csi_of_links()
imx_media_create_internal_links()

Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/staging/media/imx/imx-media-dev.c
drivers/staging/media/imx/imx-media-internal-sd.c
drivers/staging/media/imx/imx-media-of.c
drivers/staging/media/imx/imx-media.h