linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [media] au0828: disable tuner->decoder on init
@ 2016-03-10 19:57 Mauro Carvalho Chehab
  2016-03-10 21:56 ` Shuah Khan
  0 siblings, 1 reply; 3+ messages in thread
From: Mauro Carvalho Chehab @ 2016-03-10 19:57 UTC (permalink / raw)
  To: Linux Media Mailing List
  Cc: Mauro Carvalho Chehab, Mauro Carvalho Chehab, Shuah Khan,
	Hans Verkuil, Rafael Lourenço de Lima Chehab,
	Javier Martinez Canillas

As au0828 assumes that all links to ATV decoder and DTV demod
should be disabled, make sure this is the case.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
---
 drivers/media/usb/au0828/au0828-core.c | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/drivers/media/usb/au0828/au0828-core.c b/drivers/media/usb/au0828/au0828-core.c
index 5dc82e8c8670..af68663915fd 100644
--- a/drivers/media/usb/au0828/au0828-core.c
+++ b/drivers/media/usb/au0828/au0828-core.c
@@ -456,7 +456,9 @@ static int au0828_media_device_register(struct au0828_dev *dev,
 {
 #ifdef CONFIG_MEDIA_CONTROLLER
 	int ret;
-	struct media_entity *entity, *demod = NULL, *tuner = NULL;
+	struct media_entity *entity;
+	struct media_entity *demod = NULL, *tuner = NULL, *decoder = NULL;
+	struct media_link *link;
 
 	if (!dev->media_dev)
 		return 0;
@@ -490,18 +492,19 @@ static int au0828_media_device_register(struct au0828_dev *dev,
 	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_ATV_DECODER)
+			decoder = 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) {
+	/* Disable link between tuner->demod and/or tuner->decoder */
+	if (tuner) {
+		list_for_each_entry(link, &tuner->links, list) {
+			if (demod && link->sink->entity == demod)
+				media_entity_setup_link(link, 0);
+			if (decoder && link->sink->entity == decoder)
 				media_entity_setup_link(link, 0);
-			}
 		}
 	}
 
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-03-11 16:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-10 19:57 [PATCH] [media] au0828: disable tuner->decoder on init Mauro Carvalho Chehab
2016-03-10 21:56 ` Shuah Khan
2016-03-11 16:00   ` Mauro Carvalho Chehab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).