summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorShuah Khan <shuahkh@osg.samsung.com>2016-02-11 21:41:33 -0200
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-02-27 09:11:46 -0300
commitb176965176abe4ef560c2e9c14332031bcf37254 (patch)
treeb8dc5e6fde72a314a05dddb886b66772b5c206b1 /drivers/media
parent2926d7f445965a9900a554af9f33a2b721b6afce (diff)
[media] media: au0828 disable tuner to demod link
Change au0828_create_media_graph() to find and disable tuner and demod link. This helps avoid an additional disable step when tuner is requested by video or audio. Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/usb/au0828/au0828-video.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/media/usb/au0828/au0828-video.c b/drivers/media/usb/au0828/au0828-video.c
index 2eb291bb376a..5c51e3766d47 100644
--- a/drivers/media/usb/au0828/au0828-video.c
+++ b/drivers/media/usb/au0828/au0828-video.c
@@ -657,7 +657,7 @@ static int au0828_create_media_graph(struct au0828_dev *dev)
#ifdef CONFIG_MEDIA_CONTROLLER
struct media_device *mdev = dev->media_dev;
struct media_entity *entity;
- struct media_entity *tuner = NULL, *decoder = NULL;
+ struct media_entity *tuner = NULL, *decoder = NULL, *demod = NULL;
int i, ret;
if (!mdev)
@@ -671,6 +671,9 @@ static int au0828_create_media_graph(struct au0828_dev *dev)
case MEDIA_ENT_F_ATV_DECODER:
decoder = entity;
break;
+ case MEDIA_ENT_F_DTV_DEMOD:
+ demod = entity;
+ break;
}
}
@@ -725,6 +728,21 @@ static int au0828_create_media_graph(struct au0828_dev *dev)
break;
}
}
+
+ /*
+ * Disable tuner to demod link to avoid disable step
+ * when tuner is requested by video or audio
+ */
+ if (tuner && demod) {
+ struct media_link *link;
+
+ list_for_each_entry(link, &demod->links, list) {
+ if (link->sink->entity == demod &&
+ link->source->entity == tuner) {
+ media_entity_setup_link(link, 0);
+ }
+ }
+ }
#endif
return 0;
}