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: 7453781 Return-Path: X-Original-To: patchwork-alsa-devel@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 B90A39F36A for ; Tue, 20 Oct 2015 23:27:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D309A20881 for ; Tue, 20 Oct 2015 23:27:01 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 9727A206B8 for ; Tue, 20 Oct 2015 23:27:00 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 94794266959; Wed, 21 Oct 2015 01:26:59 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, NO_DNS_FOR_FROM,RCVD_IN_DNSWL_LOW,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 7612C266859; Wed, 21 Oct 2015 01:25:38 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id BA637266644; Wed, 21 Oct 2015 01:25:35 +0200 (CEST) Received: from resqmta-po-05v.sys.comcast.net (resqmta-po-05v.sys.comcast.net [96.114.154.164]) by alsa0.perex.cz (Postfix) with ESMTP id 5A9912604F8 for ; Wed, 21 Oct 2015 01:25:22 +0200 (CEST) Received: from resomta-po-07v.sys.comcast.net ([96.114.154.231]) by resqmta-po-05v.sys.comcast.net with comcast id XbRM1r0034zp9eg01bRMZS; 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 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=Nd2b9x+VkDDBOvq/V8QSVkBLMRFec19XoyhDlsOrnSAJ9dCApm4Ew/wrccqt7rUnA T65wyxdzCxZwo6ezvMbS0FRIZs29S8oocQGv16k+54IGzBl2gFgWybREyQrydJq8ZG eBGJSNBfdzHx1DwVotkAQmtZ7HrO4EijaU+LkjXi/Sz0ttiPULBwJJGj1yJGXbc2Oo dkd1EWv7gl+I93PfaBpzMzu9g8ZgcdKpvJjypYYM3gd3MKd5E3BA+0D8Z7VLOQNXED zQKJvCJBYoQ600QWbEdo20nDrICzPYv1/gX9eGKWSms4izrdlI2mDuBckhGQ9LftzD WKo+M9CEZyTHQ== Cc: alsa-devel@alsa-project.org, Shuah Khan , linux-media@vger.kernel.org Subject: [alsa-devel] [PATCH MC Next Gen v2 3/3] media: au0828 create link between ALSA Mixer and decoder X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.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