summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorShuah Khan <shuahkh@osg.samsung.com>2016-03-09 19:15:38 -0700
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-03-10 13:44:10 -0300
commit840f5b0572ea9ddaca2bf5540a171013e92c97bd (patch)
tree485eb1f256b9bcafa80f6e405969e1205f3046cf /drivers/media
parent778f2a3c1644bf446c4069477fbdf99b7a40a55a (diff)
downloadtalos-op-linux-840f5b0572ea9ddaca2bf5540a171013e92c97bd.tar.gz
talos-op-linux-840f5b0572ea9ddaca2bf5540a171013e92c97bd.zip
media: au0828 disable tuner to demod link in au0828_media_device_register()
Disable tuner to demod link in au0828_media_device_register(). This step should be done after dvb graph is created. [mchehab@osg.samsung.com: Solve conflictst to apply it upstream] 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-core.c26
-rw-r--r--drivers/media/v4l2-core/v4l2-mc.c18
2 files changed, 26 insertions, 18 deletions
diff --git a/drivers/media/usb/au0828/au0828-core.c b/drivers/media/usb/au0828/au0828-core.c
index 7fc3dba5e2b6..5dc82e8c8670 100644
--- a/drivers/media/usb/au0828/au0828-core.c
+++ b/drivers/media/usb/au0828/au0828-core.c
@@ -456,6 +456,7 @@ static int au0828_media_device_register(struct au0828_dev *dev,
{
#ifdef CONFIG_MEDIA_CONTROLLER
int ret;
+ struct media_entity *entity, *demod = NULL, *tuner = NULL;
if (!dev->media_dev)
return 0;
@@ -479,6 +480,31 @@ static int au0828_media_device_register(struct au0828_dev *dev,
*/
au0828_media_graph_notify(NULL, (void *) dev);
}
+
+ /*
+ * Find tuner and demod to disable the link between
+ * the two to avoid disable step when tuner is requested
+ * by video or audio. Note that this step can't be done
+ * until dvb graph is created during dvb register.
+ */
+ media_device_for_each_entity(entity, dev->media_dev) {
+ if (entity->function == MEDIA_ENT_F_DTV_DEMOD)
+ demod = entity;
+ else if (entity->function == MEDIA_ENT_F_TUNER)
+ tuner = entity;
+ }
+ /* Disable link between tuner and demod */
+ 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);
+ }
+ }
+ }
+
/* register entity_notify callback */
dev->entity_notify.notify_data = (void *) dev;
dev->entity_notify.notify = (void *) au0828_media_graph_notify;
diff --git a/drivers/media/v4l2-core/v4l2-mc.c b/drivers/media/v4l2-core/v4l2-mc.c
index f8b6e3be634f..2a7b79bc90fd 100644
--- a/drivers/media/v4l2-core/v4l2-mc.c
+++ b/drivers/media/v4l2-core/v4l2-mc.c
@@ -57,9 +57,6 @@ 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;
@@ -194,21 +191,6 @@ 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);
OpenPOWER on IntegriCloud