From patchwork Wed Feb 10 10:18:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 8269721 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 5EAA8BEEE5 for ; Wed, 10 Feb 2016 10:21:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 89A54202E9 for ; Wed, 10 Feb 2016 10:21:00 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 596C920145 for ; Wed, 10 Feb 2016 10:20:59 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 7CC1F265611; Wed, 10 Feb 2016 11:20:58 +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 D49E7265736; Wed, 10 Feb 2016 11:19:24 +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 CB4FC265736; Wed, 10 Feb 2016 11:19:22 +0100 (CET) Received: from mail-wm0-f50.google.com (mail-wm0-f50.google.com [74.125.82.50]) by alsa0.perex.cz (Postfix) with ESMTP id 5257D26524F for ; Wed, 10 Feb 2016 11:18:48 +0100 (CET) Received: by mail-wm0-f50.google.com with SMTP id c200so21103533wme.0 for ; Wed, 10 Feb 2016 02:18:48 -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=+uDQax9quPc3iMohY9oGOdW3mkwkQOjIy3/ZsJw8pvw=; b=Fy+L9ukqQYCIOD6m0KdL8i9TlpPTJmW4Q/mxrBGzAsavmdhbi/fuNV4qI/9IkVwX2m UFeM8Ca6UZJ+9GKq88P2oXW8fWNKgoxFlJwfzNx8wVXydpffOBuA1CVwjlwJIbJywR/3 jS5Gp9nWbJjPBFv5aGEynGP5Dof4HpllsU0P4= 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=+uDQax9quPc3iMohY9oGOdW3mkwkQOjIy3/ZsJw8pvw=; b=ThMklUCDKYcXM+QOhjNFX5IpvJm3an/t/2lp1VXTC9EBD4YugmB6Kn1p8tjzTEBLqw cnqDE37ONGstGyX4HH41NUdxj5RItcdlzsOYcXMRakVINtvEs+qC0ZOHmWeBtthZSuvt sQ7Zb7/BcFp66kiUHJqnKEhSNG0Vy40qXxrLRYSCZ7rc/RUJbLZj/1Z3WbCPbEvOE1OX 3MEhjiT96cM5h+Sv5Nuh9LPzSqlY4EYNcOsbwLB1m9MyACV3Es47VfGzWbiRGgmxcy1Q BUxtJlAJjnP5Sl9+mLpchlyqoIzx0GsQnzS5T5d9KAwnwULG2W0gF2h/lRpgBBWsXXED VeYA== X-Gm-Message-State: AG10YORrrBV9MeGyiZzXG438ScdpQ02lx50irh9+sda37vua1J7ymomoBVF8z+nyHyLNrexG X-Received: by 10.28.0.69 with SMTP id 66mr9598265wma.51.1455099528082; Wed, 10 Feb 2016 02:18:48 -0800 (PST) Received: from localhost.localdomain (host-92-13-246-184.as43234.net. [92.13.246.184]) by smtp.gmail.com with ESMTPSA id m67sm21505670wma.10.2016.02.10.02.18.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 10 Feb 2016 02:18:47 -0800 (PST) From: Srinivas Kandagatla To: Patrick Lai , alsa-devel@alsa-project.org, Mark Brown Date: Wed, 10 Feb 2016 10:18:39 +0000 Message-Id: <1455099519-490-1-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1455099418-311-1-git-send-email-srinivas.kandagatla@linaro.org> References: <1455099418-311-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 v1 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 1c3eb65..2aaca47 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 */