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: 61624 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp2552437lbl; Wed, 10 Feb 2016 02:19:00 -0800 (PST) X-Received: by 10.98.16.198 with SMTP id 67mr27448886pfq.21.1455099540334; Wed, 10 Feb 2016 02:19:00 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 6si4173503pfp.194.2016.02.10.02.19.00; Wed, 10 Feb 2016 02:19:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dkim=pass header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757694AbcBJKSw (ORCPT + 30 others); Wed, 10 Feb 2016 05:18:52 -0500 Received: from mail-wm0-f52.google.com ([74.125.82.52]:38354 "EHLO mail-wm0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757655AbcBJKSt (ORCPT ); Wed, 10 Feb 2016 05:18:49 -0500 Received: by mail-wm0-f52.google.com with SMTP id p63so19640828wmp.1 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=IOXkuFHEZ7f+WNVfdS0kRvoHINmN/oqM6xnRnOb+ECTeBgEkxvDzDVxZWlgjE93BCu ShbKf34PEXupKDuc/rpSKAoK3qB/H2o9eCPLsnYq8zLFLwzJCvJ2L9lC+WaqXP4iteL/ lbJaewdF+ZoVrlPFreBSo/wKuHVOoBei5uFBTRRnb1e8xNiulLb7SDJy5HP92LPNMrp4 AhzLtI63fDo2qZHrihv7NzxRQpZ6D2ARiTP1O/pH+lWecq571aEBE6BslyzPCaU4Tl9M MHTjspuKNW9hRswE+HBtohoiHJKoD57xwCqylwea3irzRglgsXXU6QMjuwUcg+C93iVc qXnw== X-Gm-Message-State: AG10YORuY3EkSEE59xDDwJF5KrgKVLcGO/gVjaM7c0kvbCdqD7UBfx/uh5USKRkFd9JoZTYm 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 Cc: Banajit Goswami , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, kwestfie@codeaurora.org, Srinivas Kandagatla Subject: [PATCH v1 04/14] ASoC: qcom: pass direction to dma allocation 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 1.9.1 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 */