summaryrefslogtreecommitdiff
path: root/drivers/media/v4l2-core
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-03-02 10:11:41 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-03-03 06:23:20 -0300
commit9822f4173f84cb7c592edb5e1478b7903f69d018 (patch)
treea8851c62011b3b7933dc481d196eb8dfbf3af71e /drivers/media/v4l2-core
parentbddc418787cccb2ba92b5e601d1d9b04f4668946 (diff)
[media] au0828: use v4l2_mc_create_media_graph()
There's no reason to implement its own function to create the media graph. So, use the core one. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/v4l2-core')
-rw-r--r--drivers/media/v4l2-core/v4l2-mc.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/drivers/media/v4l2-core/v4l2-mc.c b/drivers/media/v4l2-core/v4l2-mc.c
index 643686d40551..621d2367363c 100644
--- a/drivers/media/v4l2-core/v4l2-mc.c
+++ b/drivers/media/v4l2-core/v4l2-mc.c
@@ -27,7 +27,7 @@ int v4l2_mc_create_media_graph(struct media_device *mdev)
{
struct media_entity *entity;
struct media_entity *if_vid = NULL, *if_aud = NULL;
- struct media_entity *tuner = NULL, *decoder = NULL;
+ struct media_entity *tuner = NULL, *decoder = NULL, *dtv_demod = NULL;
struct media_entity *io_v4l = NULL, *io_vbi = NULL, *io_swradio = NULL;
bool is_webcam = false;
u32 flags;
@@ -50,6 +50,9 @@ int v4l2_mc_create_media_graph(struct media_device *mdev)
case MEDIA_ENT_F_ATV_DECODER:
decoder = entity;
break;
+ case MEDIA_ENT_F_DTV_DEMOD:
+ dtv_demod = entity;
+ break;
case MEDIA_ENT_F_IO_V4L:
io_v4l = entity;
break;
@@ -183,6 +186,22 @@ int v4l2_mc_create_media_graph(struct media_device *mdev)
flags = 0;
}
+
+ /*
+ * Disable tuner to demod link to avoid disable step
+ * when tuner is requested by video or audio
+ */
+ if (tuner && dtv_demod) {
+ struct media_link *link;
+
+ list_for_each_entry(link, &dtv_demod->links, list) {
+ if (link->sink->entity == dtv_demod &&
+ link->source->entity == tuner) {
+ media_entity_setup_link(link, 0);
+ }
+ }
+ }
+
return 0;
}
EXPORT_SYMBOL_GPL(v4l2_mc_create_media_graph);