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: 61743 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp154816lbl; Thu, 11 Feb 2016 04:17:49 -0800 (PST) X-Received: by 10.98.2.216 with SMTP id 207mr66161615pfc.3.1455193069565; Thu, 11 Feb 2016 04:17:49 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v68si12387413pfi.16.2016.02.11.04.17.49; Thu, 11 Feb 2016 04:17:49 -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 S1752743AbcBKMRr (ORCPT + 30 others); Thu, 11 Feb 2016 07:17:47 -0500 Received: from mail-wm0-f45.google.com ([74.125.82.45]:35177 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751210AbcBKMRq (ORCPT ); Thu, 11 Feb 2016 07:17:46 -0500 Received: by mail-wm0-f45.google.com with SMTP id c200so70375547wme.0 for ; Thu, 11 Feb 2016 04:17:45 -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=nIrxPLrfpHi7O30STF7T5WTyU2WZE1CEYYGx+ZM1t7ht9nzRx5CZytg7me+E+lTH4k PIh3f0QHXLUJ8oJNXjQCV82BXb/HChCvS8OLLXCU6aoGYIWDySkoQ5pHVPo/nJhxMoIz RLlGfKl9wZLSuVHJ7iiVC74+CLu1ckDlw5Oug+evtVNAQ0IWIayntPqCHv9ra7Kc1LmJ f7UDJ2fqBttKDjcBAS96J4yilxbK457/iJHYQhaeXDRKwgzcIBfH5RAqvlRtNgmJyWqT 3NWUjjX60VgBEPu7CMPbXT1SbIvsqpeZ2ivSj/PlThr2+A1ECNUrvPVrx9O7nb0MXfs1 ZQew== X-Gm-Message-State: AG10YOROWjnivLJOBFoklD1iRc5UngP2mJTlnF4chfFYgqq4MsnnlzEoTPC6INC94jCef2rR 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 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 v3 04/14] ASoC: qcom: pass direction to dma allocation 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> 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 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 */