From patchwork Thu Oct 15 20:50:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 7409741 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 62F78BEEA4 for ; Thu, 15 Oct 2015 20:51:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 998C52041A for ; Thu, 15 Oct 2015 20:51:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5B60420555 for ; Thu, 15 Oct 2015 20:51:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752967AbbJOUvD (ORCPT ); Thu, 15 Oct 2015 16:51:03 -0400 Received: from resqmta-po-09v.sys.comcast.net ([96.114.154.168]:56317 "EHLO resqmta-po-09v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752582AbbJOUu6 (ORCPT ); Thu, 15 Oct 2015 16:50:58 -0400 Received: from resomta-po-16v.sys.comcast.net ([96.114.154.240]) by resqmta-po-09v.sys.comcast.net with comcast id VYqQ1r0055BUCh401YqxWo; Thu, 15 Oct 2015 20:50:57 +0000 Received: from mail.gonehiking.org ([73.181.52.62]) by resomta-po-16v.sys.comcast.net with comcast id VYqw1r00A1LXgTt01YqweP; Thu, 15 Oct 2015 20:50:57 +0000 Received: from lorien.internal (lorien-wl.internal [192.168.1.40]) by mail.gonehiking.org (Postfix) with ESMTP id E95AEA1627; Thu, 15 Oct 2015 14:50:55 -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 2/2] media: au0828 create link between ALSA Mixer and decoder Date: Thu, 15 Oct 2015 14:50:53 -0600 Message-Id: <5d44b252378049b68a9cf6ad966c1b1978848676.1444941680.git.shuahkh@osg.samsung.com> 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=1444942257; bh=iEEEvBt0qewyaFC/mGomTI8Ckrub9qnF7ZxqGce4ohg=; h=Received:Received:Received:From:To:Subject:Date:Message-Id; b=etfn06QD9ViFqFL7nurtq81kus/MjzpIMZKJsWcT7LSm6wS4FSGJiaJSvQ/d/2pdC OHSFfIJ+Rucpx008fppB72zSncYNuHVMrSbLkihr8RhzXfeGAOYaFuoGHE0WtCTWzP HiU9ANgIC79vGqlx0eSv8TNZENOcBJwddSZxy9ITYoHrlL5WwKVpPLUEL3DpEam+0G toDZPud0wjgUJo0C+A07CvyNRaZA/92le/LIGFhPREmWmD3NySR4tNEiJQ8fsForNF Ftu5M+ug3F6sz655sR0rwT8/gLEKV1RUvflCaqd3z2FElFm+4P5ikZj9Yhr/eXAsOG SVoXMKb+aaDug== 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,T_DKIM_INVALID,T_RP_MATCHES_RCVD,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. Signed-off-by: Shuah Khan --- drivers/media/usb/au0828/au0828-core.c | 12 ++++++++++++ drivers/media/usb/au0828/au0828.h | 1 + 2 files changed, 13 insertions(+) diff --git a/drivers/media/usb/au0828/au0828-core.c b/drivers/media/usb/au0828/au0828-core.c index 7af5d0d..84b2405 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; } } @@ -316,6 +320,14 @@ void au0828_create_media_graph(struct media_entity *new, void *notify_data) 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