From patchwork Thu Feb 11 12:17:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 8278641 Return-Path: X-Original-To: patchwork-alsa-devel@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 75414BEEE5 for ; Thu, 11 Feb 2016 12:19:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 91FD120222 for ; Thu, 11 Feb 2016 12:19:54 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 5B29220397 for ; Thu, 11 Feb 2016 12:19:53 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 54EC1265C96; Thu, 11 Feb 2016 13:19:52 +0100 (CET) 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_SIGNED, NO_DNS_FOR_FROM,RCVD_IN_DNSWL_NONE,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 8B9932658D8; Thu, 11 Feb 2016 13:18:15 +0100 (CET) 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 D34862658D8; Thu, 11 Feb 2016 13:18:13 +0100 (CET) Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) by alsa0.perex.cz (Postfix) with ESMTP id 352312658DF for ; Thu, 11 Feb 2016 13:17:44 +0100 (CET) Received: by mail-wm0-f41.google.com with SMTP id p63so65762381wmp.1 for ; Thu, 11 Feb 2016 04:17:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=B9/tzgNabic4M68o6gvPZSYyx3iyWOIwopHFkjPTOu8=; b=RSH/2vGeKwM7N+NAQShk0qlPGooTe7Wswv5SFX54rqAhYsfdTvqrhG8bX5ILeENJjp hhcm+mAwwqeRqttIBrPMt5JUjD1hNiUP52hLt0YAqg4ZEO0iujeiZpr2rV/RLvOH98jv KUiGb2zWiHmCPGE+n/Jqmlq5z3ebfXY8m7IvU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=B9/tzgNabic4M68o6gvPZSYyx3iyWOIwopHFkjPTOu8=; b=ZTxOarlcH0BlR60qTGPGWULP1GEEVhnvaiLlr7ggdgnStV6Z4z8YxNXEyNL5fjjf+v RP5zwgm0yxit2XUnUm1LomYNj+KRd8V/jEoGJ82YIbZjIFV4aXS/Z1ddzIPA0FtoFt3e HCrjymtCwIyxVoPq5nQPoSx4cg+qrii+tPrYoB1HJhcqme/KedL75mhx9md9g1uaL4J3 KG1FoB9y3Mma3rOLTxLCpsuRBsjnmAcjNml8HMQ/hvjKUNT4eyCTWkZiH9yj2Jgjd3oZ 3y9F3m+mPyEWnL7D+BjR/GNmW3g7X4aZWC6V2jwjJw1vwSQ7JG2pD4ShYEKr0W/vPjoU WsaQ== X-Gm-Message-State: AG10YOTFTdaPWGxt0J29MgbPV3e9GR0+VpGzH80d3UyWeCboetOJwEPU8DAoLNFG0EoMCnBK X-Received: by 10.28.211.141 with SMTP id k135mr16415469wmg.51.1455193059928; Thu, 11 Feb 2016 04:17:39 -0800 (PST) Received: from localhost.localdomain (host-92-13-246-184.as43234.net. [92.13.246.184]) by smtp.gmail.com with ESMTPSA id r62sm7802151wmd.15.2016.02.11.04.17.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 11 Feb 2016 04:17:38 -0800 (PST) From: Srinivas Kandagatla To: Patrick Lai , alsa-devel@alsa-project.org, Mark Brown Date: Thu, 11 Feb 2016 12:17:37 +0000 Message-Id: <1455193057-1662-1-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1455193007-1481-1-git-send-email-srinivas.kandagatla@linaro.org> References: <1455193007-1481-1-git-send-email-srinivas.kandagatla@linaro.org> Cc: kwestfie@codeaurora.org, Banajit Goswami , Liam Girdwood , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Takashi Iwai , Srinivas Kandagatla Subject: [alsa-devel] [PATCH v3 04/14] ASoC: qcom: pass direction to dma allocation 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 This patch updates the internal dma allocation callbacks to take the stream direction so that it can allocate channels suitable for that stream direction. Before the capture support this was not necessary. Signed-off-by: Srinivas Kandagatla Acked-by: Kenneth Westfield --- sound/soc/qcom/lpass-apq8016.c | 3 ++- sound/soc/qcom/lpass-ipq806x.c | 2 +- sound/soc/qcom/lpass-platform.c | 3 ++- sound/soc/qcom/lpass.h | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sound/soc/qcom/lpass-apq8016.c b/sound/soc/qcom/lpass-apq8016.c index 6cc7e72..99061f4 100644 --- a/sound/soc/qcom/lpass-apq8016.c +++ b/sound/soc/qcom/lpass-apq8016.c @@ -133,7 +133,8 @@ static struct snd_soc_dai_driver apq8016_lpass_cpu_dai_driver[] = { }, }; -static int apq8016_lpass_alloc_dma_channel(struct lpass_data *drvdata) +static int apq8016_lpass_alloc_dma_channel(struct lpass_data *drvdata, + int direction) { struct lpass_variant *v = drvdata->variant; int chan = find_first_zero_bit(&drvdata->rdma_ch_bit_map, diff --git a/sound/soc/qcom/lpass-ipq806x.c b/sound/soc/qcom/lpass-ipq806x.c index 7a41679..119048c 100644 --- a/sound/soc/qcom/lpass-ipq806x.c +++ b/sound/soc/qcom/lpass-ipq806x.c @@ -63,7 +63,7 @@ static struct snd_soc_dai_driver ipq806x_lpass_cpu_dai_driver = { .ops = &asoc_qcom_lpass_cpu_dai_ops, }; -static int ipq806x_lpass_alloc_dma_channel(struct lpass_data *drvdata) +static int ipq806x_lpass_alloc_dma_channel(struct lpass_data *drvdata, int dir) { return IPQ806X_LPAIF_RDMA_CHAN_MI2S; } diff --git a/sound/soc/qcom/lpass-platform.c b/sound/soc/qcom/lpass-platform.c index 7245c2e..69c5ad8 100644 --- a/sound/soc/qcom/lpass-platform.c +++ b/sound/soc/qcom/lpass-platform.c @@ -457,7 +457,8 @@ static int lpass_platform_pcm_new(struct snd_soc_pcm_runtime *soc_runtime) return -ENOMEM; if (v->alloc_dma_channel) - data->rdma_ch = v->alloc_dma_channel(drvdata); + data->rdma_ch = v->alloc_dma_channel(drvdata, + SNDRV_PCM_STREAM_PLAYBACK); if (IS_ERR_VALUE(data->rdma_ch)) return data->rdma_ch; diff --git a/sound/soc/qcom/lpass.h b/sound/soc/qcom/lpass.h index 412399a..8475b60 100644 --- a/sound/soc/qcom/lpass.h +++ b/sound/soc/qcom/lpass.h @@ -84,7 +84,7 @@ struct lpass_variant { /* SOC specific intialization like clocks */ int (*init)(struct platform_device *pdev); int (*exit)(struct platform_device *pdev); - int (*alloc_dma_channel)(struct lpass_data *data); + int (*alloc_dma_channel)(struct lpass_data *data, int direction); int (*free_dma_channel)(struct lpass_data *data, int ch); /* SOC specific dais */