From patchwork Tue Nov 10 20:40:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 7592191 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E19B5BF90C for ; Tue, 10 Nov 2015 20:47:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F2242205E4 for ; Tue, 10 Nov 2015 20:47:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 59EF220605 for ; Tue, 10 Nov 2015 20:47:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751807AbbKJUrE (ORCPT ); Tue, 10 Nov 2015 15:47:04 -0500 Received: from resqmta-po-11v.sys.comcast.net ([96.114.154.170]:51319 "EHLO resqmta-po-11v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751285AbbKJUq5 (ORCPT ); Tue, 10 Nov 2015 15:46:57 -0500 Received: from resomta-po-03v.sys.comcast.net ([96.114.154.227]) by resqmta-po-11v.sys.comcast.net with comcast id fwmG1r0024ueUHc01wmwfj; Tue, 10 Nov 2015 20:46:56 +0000 Received: from mail.gonehiking.org ([73.181.52.62]) by resomta-po-03v.sys.comcast.net with comcast id fwmv1r0011LXgTt01wmvEY; Tue, 10 Nov 2015 20:46:56 +0000 Received: from lorien.internal (lorien-wl.internal [192.168.1.40]) by mail.gonehiking.org (Postfix) with ESMTP id AD9789F375; Tue, 10 Nov 2015 13:40:54 -0700 (MST) 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 v3 3/6] media: au0828 create link between ALSA Mixer and decoder Date: Tue, 10 Nov 2015 13:40:46 -0700 Message-Id: X-Mailer: git-send-email 2.5.0 In-Reply-To: References: In-Reply-To: References: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1447188416; bh=n6hm2O/H1hzqnHRRRN7K7bBEQ4cqKby3LFR+Bu+/Tsw=; h=Received:Received:Received:From:To:Subject:Date:Message-Id; b=DHdhBx6wEsq5bmpC9yb22gZyjwbEfe0O088Bid5W36oRmSQ0pbiDtcrnHCB++jbxV 3j4/T7XUzr2cHsunLkQhoHGcdVu5moLsgg7sn35/7Bi/MtLzO5QrUjdBJhLTxWF0qf 40igmzMXHQEpQvKezYMn78aGE4YaEuMkX2ZkUYhzGJ/aws5pJaK9bTn7D5Rp8iBvqg iigI0fYTOrq7udW44gHiPyodGf1kCb7ToJ5mAziUOUSFUppzlIMaMPdcMrjqICq240 8bwyfDMR9rrYPOFRXh5zhoV3z5RBEW4OmN+wBPZ66wFQr1s2pBMzAM30SyiZIvngfC GpgHAlU7wMvnA== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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