From 54d0dbac1266d2b9a6b5a87316162a068ad545bf Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 5 Feb 2016 07:02:43 -0200 Subject: [media] v4l2-mc: add a generic function to create the media graph The em28xx_v4l2_create_media_graph() is almost generic enough to be at the core, as an ancillary function. Make it even more generic, by getting rid of em28xx-specific code, relying only at the media_device, in order to discover all entities found on PC-customer's hardware and add it at the V4L2 core. Signed-off-by: Mauro Carvalho Chehab --- include/media/v4l2-mc.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'include') diff --git a/include/media/v4l2-mc.h b/include/media/v4l2-mc.h index df115195690e..aed9e9b87f82 100644 --- a/include/media/v4l2-mc.h +++ b/include/media/v4l2-mc.h @@ -14,6 +14,8 @@ * GNU General Public License for more details. */ +#include + /** * enum tuner_pad_index - tuner pad index for MEDIA_ENT_F_TUNER * @@ -89,3 +91,26 @@ enum demod_pad_index { DEMOD_PAD_VBI_OUT, DEMOD_NUM_PADS }; + +/** + * v4l2_mc_create_media_graph() - create Media Controller links at the graph. + * + * @mdev: pointer to the &media_device struct. + * + * Add links between the entities commonly found on PC customer's hardware at + * the V4L2 side: camera sensors, audio and video PLL-IF decoders, tuners, + * analog TV decoder and I/O entities (video, VBI and Software Defined Radio). + * NOTE: webcams are modelled on a very simple way: the sensor is + * connected directly to the I/O entity. All dirty details, like + * scaler and crop HW are hidden. While such mapping is enough for v4l2 + * interface centric PC-consumer's hardware, V4L2 subdev centric camera + * hardware should not use this routine, as it will not build the right graph. + */ +#ifdef CONFIG_MEDIA_CONTROLLER +int v4l2_mc_create_media_graph(struct media_device *mdev); +#else +static inline int v4l2_mc_create_media_graph(struct media_device *mdev) +{ + return 0; +} +#endif -- cgit v1.2.3