From patchwork Tue Oct 20 23:25:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 7453751 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AA19E9F36A for ; Tue, 20 Oct 2015 23:25:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C39B92078B for ; Tue, 20 Oct 2015 23:25:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D8DE8208B9 for ; Tue, 20 Oct 2015 23:25:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752267AbbJTXZ2 (ORCPT ); Tue, 20 Oct 2015 19:25:28 -0400 Received: from resqmta-po-01v.sys.comcast.net ([96.114.154.160]:59500 "EHLO resqmta-po-01v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751182AbbJTXZV (ORCPT ); Tue, 20 Oct 2015 19:25:21 -0400 Received: from resomta-po-07v.sys.comcast.net ([96.114.154.231]) by resqmta-po-01v.sys.comcast.net with comcast id XbRM1r0044zp9eg01bRM1R; Tue, 20 Oct 2015 23:25:21 +0000 Received: from mail.gonehiking.org ([73.181.52.62]) by resomta-po-07v.sys.comcast.net with comcast id XbRL1r0021LXgTt01bRLgo; Tue, 20 Oct 2015 23:25:21 +0000 Received: from lorien.internal (lorien-wl.internal [192.168.1.40]) by mail.gonehiking.org (Postfix) with ESMTP id D7B06A1622; Tue, 20 Oct 2015 17:25:19 -0600 (MDT) From: Shuah Khan To: mchehab@osg.samsung.com, tiwai@suse.de, perex@perex.cz, chehabrafael@gmail.com, hans.verkuil@cisco.com, prabhakar.csengg@gmail.com, chris.j.arges@canonical.com Cc: Shuah Khan , linux-media@vger.kernel.org, alsa-devel@alsa-project.org Subject: [PATCH MC Next Gen v2 3/3] media: au0828 create link between ALSA Mixer and decoder Date: Tue, 20 Oct 2015 17:25:16 -0600 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1445383521; bh=6bgpY4uxEJsDL45u4aYkd9S9XKUeP1YOi5vjfxJFaMs=; h=Received:Received:Received:From:To:Subject:Date:Message-Id; b=ZzlN+hvUN0q0euxSN3sBgJgUU+qxi8szHpbOPLP/oFWqGGYtFUx4L1q2Esqxr95HE z2kOQrinLZoC7A/uJt5FEWdzv20YovCC/MBAguiPAlGljUKZa14vwK7+mtSRo/7/eC GIsiNsPkGQpLgS7rGUWlBZPeWdvy6UfBBCNSKH32mPVk9t1QxaYoUwnzCNBANDmfCS G0H+/l42fGfFv2lOrLk4ymBpSgQ1HCrxhTB+FKrE864qWZbx3JFar6oP8cgLjMqEP+ W1M7uc2Gsl0iPwzc/cMIlIVCv1dEQb9dhDlAWJF0ZbS1rKGNFMa5BKB3NE++FEYjkA HiGUVLvWplD+w== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Change au0828_create_media_graph() to create pad link between MEDIA_ENT_F_AUDIO_MIXER entity and decoder's AU8522_PAD_AUDIO_OUT. With mixer entity now linked to decoder, change to link MEDIA_ENT_F_AUDIO_CAPTURE to mixer's source pad. Signed-off-by: Shuah Khan --- drivers/media/usb/au0828/au0828-core.c | 17 ++++++++++++++--- drivers/media/usb/au0828/au0828.h | 1 + 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/drivers/media/usb/au0828/au0828-core.c b/drivers/media/usb/au0828/au0828-core.c index 7af5d0d..3ef6fee 100644 --- a/drivers/media/usb/au0828/au0828-core.c +++ b/drivers/media/usb/au0828/au0828-core.c @@ -225,6 +225,7 @@ void au0828_create_media_graph(struct media_entity *new, void *notify_data) struct media_entity *entity; struct media_entity *tuner = NULL, *decoder = NULL; struct media_entity *audio_capture = NULL; + struct media_entity *mixer = NULL; int i, ret; if (!mdev) @@ -245,6 +246,9 @@ void au0828_create_media_graph(struct media_entity *new, void *notify_data) case MEDIA_ENT_F_AUDIO_CAPTURE: audio_capture = entity; break; + case MEDIA_ENT_F_AUDIO_MIXER: + mixer = entity; + break; } } @@ -309,13 +313,20 @@ void au0828_create_media_graph(struct media_entity *new, void *notify_data) } } - if (audio_capture && !dev->audio_capture_linked) { - ret = media_create_pad_link(decoder, AU8522_PAD_AUDIO_OUT, - audio_capture, 0, + if (mixer && audio_capture && !dev->audio_capture_linked) { + ret = media_create_pad_link(mixer, 1, audio_capture, 0, MEDIA_LNK_FL_ENABLED); if (ret == 0) dev->audio_capture_linked = 1; } + + if (mixer && !dev->mixer_linked) { + ret = media_create_pad_link(decoder, AU8522_PAD_AUDIO_OUT, + mixer, 0, + MEDIA_LNK_FL_ENABLED); + if (ret == 0) + dev->mixer_linked = 1; + } #endif } diff --git a/drivers/media/usb/au0828/au0828.h b/drivers/media/usb/au0828/au0828.h index 2f4d597..6dd81b2 100644 --- a/drivers/media/usb/au0828/au0828.h +++ b/drivers/media/usb/au0828/au0828.h @@ -288,6 +288,7 @@ struct au0828_dev { bool vdev_linked; bool vbi_linked; bool audio_capture_linked; + bool mixer_linked; struct media_link *active_link; struct media_entity *active_link_owner; #endif