From patchwork Mon Sep 29 09:03:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 4994681 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 069479F1D4 for ; Mon, 29 Sep 2014 09:06:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 23EE020274 for ; Mon, 29 Sep 2014 09:06:40 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id BE06320265 for ; Mon, 29 Sep 2014 09:06:38 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id CE98E26060F; Mon, 29 Sep 2014 11:06:37 +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 B1A61260612; Mon, 29 Sep 2014 11:04:39 +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 16E19260619; Mon, 29 Sep 2014 11:04:38 +0200 (CEST) Received: from mail-pd0-f171.google.com (mail-pd0-f171.google.com [209.85.192.171]) by alsa0.perex.cz (Postfix) with ESMTP id DADDA2605E4 for ; Mon, 29 Sep 2014 11:03:57 +0200 (CEST) Received: by mail-pd0-f171.google.com with SMTP id ft15so1165821pdb.30 for ; Mon, 29 Sep 2014 02: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=3FfiDT1WaOGZB2aXwsOVq538Vx+oVeuEew8tw0Otebc=; b=igo30GLu04J38/AgsZGK3Dsa2M6Ly8JJrymOjGVeHv+SPOibjySJed8HP+Ks6wS+Og sWQhF4bxosx4Ldas2FkCDYUw2kh9ZeUUNo3lJTrWgWQI0SKeYatpawD7KVFV7JPbxZ2Z R6cXwpcQGxYSEpSJZMuPpng/lVHiV6PHhITaVM3te5FpA7NI6FGXPxnjJNU8f4bWG1St pbd3c+kIj/hU0cPYFbI0dDFP6RMiQPsfrJp3fHxGt0wkOpBIQmTafD8knVZbXmPPiOJU JDINIzdYloglgr4heAjdhfewl5DFQ4i/aI622Zj9SzIkgXK/hQ0KQc4HKhKiRAQQ3jK0 bM/g== X-Received: by 10.70.96.237 with SMTP id dv13mr70087536pdb.66.1411981437037; Mon, 29 Sep 2014 02:03:57 -0700 (PDT) Received: from localhost.localdomain ([122.169.156.227]) by mx.google.com with ESMTPSA id v11sm11799385pas.24.2014.09.29.02.03.54 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 29 Sep 2014 02:03:56 -0700 (PDT) From: Sudip Mukherjee To: Jaroslav Kysela , Takashi Iwai Date: Mon, 29 Sep 2014 14:33:25 +0530 Message-Id: <1411981406-10611-5-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1411981406-10611-1-git-send-email-sudipm.mukherjee@gmail.com> References: <1411981406-10611-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 v5 5/6] ALSA: ctxfi: ctatc: added reference to snd_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. this reference of the snd_card will actually be used in a later patch to convert the pr_* macro to dev_*. 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 5cc8c38..d62aa9e 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);