From patchwork Sun Sep 21 16:03:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 4944021 X-Patchwork-Delegate: tiwai@suse.de 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8D4AF9F313 for ; Sun, 21 Sep 2014 16:04:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C14742021B for ; Sun, 21 Sep 2014 16:04:48 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 9BB37201FA for ; Sun, 21 Sep 2014 16:04:47 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 9252E26533B; Sun, 21 Sep 2014 18:04:46 +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=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 41419261A73; Sun, 21 Sep 2014 18:04:10 +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 14D192625DB; Sun, 21 Sep 2014 18:04:09 +0200 (CEST) Received: from mail-pd0-f169.google.com (mail-pd0-f169.google.com [209.85.192.169]) by alsa0.perex.cz (Postfix) with ESMTP id 68374261A73 for ; Sun, 21 Sep 2014 18:03:59 +0200 (CEST) Received: by mail-pd0-f169.google.com with SMTP id w10so2877048pde.14 for ; Sun, 21 Sep 2014 09:03:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=3iU5jhtchCTNQG8rf9EtPS0vkGVCPtjI5oIy67PiPUs=; b=ZmumoVFTpewtR8jH3IMjnvfOmuyaOXykn2lnDHdMUPI30AtSee6mgPBIRbePui/uWl 7aAjvKLd94THsYNQaRzBrOedmFm2GvYixeY3pgOVvFlCYhotCqMtATeRlP6xavRhF6Tc MweSB59Y67yHm+zUpPVKLPewLpzrx00hcUIEqLNPjy4NrGv3GwpIiQZUmSJhIWQb5dZ4 ruNPJry5c+eC4MojQkOl0Hz/q6HmPB4NPUZQFokROhcwcBytElsSvcumHVk0Nz8dMq1f tNIVPKkrgdu4Cgu/ZaAn+LzLZZykSCsCOrsUYOasmjBKGN142QZOSvYozqJC/vOPfaA+ zVMQ== X-Received: by 10.68.235.105 with SMTP id ul9mr17544885pbc.3.1411315437921; Sun, 21 Sep 2014 09:03:57 -0700 (PDT) Received: from localhost.localdomain ([122.169.152.214]) by mx.google.com with ESMTPSA id nl2sm7053380pdb.83.2014.09.21.09.03.55 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 21 Sep 2014 09:03:57 -0700 (PDT) From: Sudip Mukherjee To: Jaroslav Kysela , Takashi Iwai Date: Sun, 21 Sep 2014 21:33:38 +0530 Message-Id: <1411315421-24138-2-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1411315421-24138-1-git-send-email-sudipm.mukherjee@gmail.com> References: <1411315421-24138-1-git-send-email-sudipm.mukherjee@gmail.com> Cc: alsa-devel@alsa-project.org, Sudip Mukherjee , linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH v3 2/5] sound: pci: ctxfi: ctatc.c: added reference to card 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 added reference of the card in the convert_format function so that we can know which card has called the function Signed-off-by: Sudip Mukherjee --- sound/pci/ctxfi/ctatc.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sound/pci/ctxfi/ctatc.c b/sound/pci/ctxfi/ctatc.c index b21eda4..3e29e13 100644 --- a/sound/pci/ctxfi/ctatc.c +++ b/sound/pci/ctxfi/ctatc.c @@ -171,7 +171,8 @@ static unsigned long atc_get_ptp_phys(struct ct_atc *atc, int index) return atc->vm->get_ptp_phys(atc->vm, index); } -static unsigned int convert_format(snd_pcm_format_t snd_format) +static unsigned int convert_format(snd_pcm_format_t snd_format, + struct snd_card *card) { switch (snd_format) { case SNDRV_PCM_FORMAT_U8: @@ -268,7 +269,8 @@ static int atc_pcm_playback_prepare(struct ct_atc *atc, struct ct_atc_pcm *apcm) src = apcm->src; src->ops->set_pitch(src, pitch); src->ops->set_rom(src, select_rom(pitch)); - src->ops->set_sf(src, convert_format(apcm->substream->runtime->format)); + src->ops->set_sf(src, convert_format(apcm->substream->runtime->format, + atc->card)); src->ops->set_pm(src, (src->ops->next_interleave(src) != NULL)); /* Get AMIXER resource */ @@ -738,7 +740,8 @@ static int atc_pcm_capture_start(struct ct_atc *atc, struct ct_atc_pcm *apcm) /* Set up recording SRC */ src = apcm->src; - src->ops->set_sf(src, convert_format(apcm->substream->runtime->format)); + src->ops->set_sf(src, convert_format(apcm->substream->runtime->format, + atc->card)); src->ops->set_sa(src, apcm->vm_block->addr); src->ops->set_la(src, apcm->vm_block->addr + apcm->vm_block->size); src->ops->set_ca(src, apcm->vm_block->addr); @@ -807,7 +810,8 @@ static int spdif_passthru_playback_get_resources(struct ct_atc *atc, src = apcm->src; src->ops->set_pitch(src, pitch); src->ops->set_rom(src, select_rom(pitch)); - src->ops->set_sf(src, convert_format(apcm->substream->runtime->format)); + src->ops->set_sf(src, convert_format(apcm->substream->runtime->format, + atc->card)); src->ops->set_pm(src, (src->ops->next_interleave(src) != NULL)); src->ops->set_bp(src, 1);