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@xxxxxxxxxxxxxxx> --- drivers/media/usb/au0828/au0828-core.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/media/usb/au0828/au0828-core.c b/drivers/media/usb/au0828/au0828-core.c index 868babe..b02a122 100644 --- a/drivers/media/usb/au0828/au0828-core.c +++ b/drivers/media/usb/au0828/au0828-core.c @@ -254,7 +254,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) @@ -268,6 +268,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; } } @@ -322,6 +325,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; } -- 2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-api" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html