From patchwork Tue Sep 23 11:00:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 4955501 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 D85B39F2BB for ; Tue, 23 Sep 2014 11:03:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 42E08200F3 for ; Tue, 23 Sep 2014 11:03:02 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 65286201CE for ; Tue, 23 Sep 2014 11:02:56 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 5CE6C265350; Tue, 23 Sep 2014 13:02:55 +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 001DF264FE7; Tue, 23 Sep 2014 13:01:18 +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 5FB21265132; Tue, 23 Sep 2014 13:01:17 +0200 (CEST) Received: from mail-pd0-f173.google.com (mail-pd0-f173.google.com [209.85.192.173]) by alsa0.perex.cz (Postfix) with ESMTP id E3939264FE7 for ; Tue, 23 Sep 2014 13:01:06 +0200 (CEST) Received: by mail-pd0-f173.google.com with SMTP id y10so6281974pdj.18 for ; Tue, 23 Sep 2014 04:01:06 -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=wK0qiKvLF9pz5NT/TCwMfvvr+tqoAFUxMwNxk1+WxCE=; b=BLNSzR0rjujczpqXDHbQh5r/gxfUHui73Lf15n9g/LeFQbxPubm2v/9sTOHlIRzg/r 4eCb7EzbYLquh8Q6Z8gc/vHH6zdWIs+u53yMpsYZ2ykBMMPG78SWnwRYuswmsRzR9Xk/ CgkhDItQRTwgVh/TRB7shFXoBWUNnHvQM+4If8DclM06CS0H4cjsBMHLr2f4ggZ8k2b5 cOvr5AAdPVn9S39bV7r4Qcig3XCLOZU7kc3b4txOhE6pkJNbBp419q3mfRXtwH7JsIn3 Aax63/vmA2v6bx8yPdQI8nkoqRCFwEDnXVEdifyCYyQvv9xQhYRvweJD56Qh6CIuFK57 5X7g== X-Received: by 10.66.121.232 with SMTP id ln8mr12029644pab.152.1411470066056; Tue, 23 Sep 2014 04:01:06 -0700 (PDT) Received: from localhost.localdomain ([122.169.152.214]) by mx.google.com with ESMTPSA id zn2sm11757781pbb.41.2014.09.23.04.01.03 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 23 Sep 2014 04:01:05 -0700 (PDT) From: Sudip Mukherjee To: Jaroslav Kysela , Takashi Iwai Date: Tue, 23 Sep 2014 16:30:22 +0530 Message-Id: <1411470024-25244-3-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1411470024-25244-1-git-send-email-sudipm.mukherjee@gmail.com> References: <1411470024-25244-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 v4 3/5] 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 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);