From patchwork Mon Feb 1 17:28:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 60947 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp170254lbb; Mon, 1 Feb 2016 09:28:52 -0800 (PST) X-Received: by 10.66.180.168 with SMTP id dp8mr20793636pac.104.1454347732645; Mon, 01 Feb 2016 09:28:52 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v72si47423395pfa.164.2016.02.01.09.28.52; Mon, 01 Feb 2016 09:28:52 -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 S1754521AbcBAR2o (ORCPT + 30 others); Mon, 1 Feb 2016 12:28:44 -0500 Received: from mail-wm0-f42.google.com ([74.125.82.42]:34355 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754124AbcBAR2k (ORCPT ); Mon, 1 Feb 2016 12:28:40 -0500 Received: by mail-wm0-f42.google.com with SMTP id 128so81921477wmz.1 for ; Mon, 01 Feb 2016 09:28:39 -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=ywPUaTKVsm8qWzpmzlFGMHguqZV/QJO+ftw8iUcpPZk=; b=MFtipwZskoPePLNG2xlVi73935m/tAzlcHdX51TseP7UhFUB/rqhMBvpk9a5U3KaUi HUOL+OHl6RDKSvVXtyp0dIPDGIO6bHLgTJ2CCOwwBsBBDbjap1Qv+57kWNDhHW0mehzB 4gGWooMPccjUfoXA99UoiXroRhbF1A2zRfT2o= 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=ywPUaTKVsm8qWzpmzlFGMHguqZV/QJO+ftw8iUcpPZk=; b=Ja98199ZrOap1aARf0c77pnB1z3g2WiJY5GYEYYTeWAD7dJagg8L6tRsU9QnJhHGvN IMdBfmeeCLBQCZ7C8IaYZ8bFcB2vZ1mbARHrHUJuhdKuUKWC4oEguur7Qf4dyHNFSn// 3DbCwziKgtM0fhIJdHnkfvT/T3LbAn6C3st3VzgDvGYMcql5AVepM/8DRa6d35CBk/rp ZDDFWH/o2TUe4gGlbPG/2Mhj9eMo3+N1DK5DXjryu/Zca0ydNUYnYb/UpBSMeTddBRh7 mDbUSk2PCdZDk/v+wjlLPZcDNhm8HElancbYnlSHkLF9DXQmiAvl+MN3/1egQqvmyBjY Ai5Q== X-Gm-Message-State: AG10YOQuBCkYMDpMWrzqtDRUgPAnigzlS7Qi8SO/Vx/95owV3Q6amJ8ffUOU2ZPfvw2oSTA7 X-Received: by 10.194.103.198 with SMTP id fy6mr28364572wjb.48.1454347719143; Mon, 01 Feb 2016 09:28: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 e198sm12565160wmd.0.2016.02.01.09.28.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 01 Feb 2016 09:28:38 -0800 (PST) From: Srinivas Kandagatla To: Patrick Lai , alsa-devel@alsa-project.org Cc: Banajit Goswami , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH RFC 04/15] ASoC: qcom: pass direction to dma allocation Date: Mon, 1 Feb 2016 17:28:34 +0000 Message-Id: <1454347714-10508-1-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1454347622-9970-1-git-send-email-srinivas.kandagatla@linaro.org> References: <1454347622-9970-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 --- sound/soc/qcom/lpass-apq8016.c | 3 ++- sound/soc/qcom/lpass-ipq806x.c | 2 +- sound/soc/qcom/lpass.h | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) -- 1.9.1 diff --git a/sound/soc/qcom/lpass-apq8016.c b/sound/soc/qcom/lpass-apq8016.c index 94efc01..2d43842 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.h b/sound/soc/qcom/lpass.h index 7c3367f..30449f3 100644 --- a/sound/soc/qcom/lpass.h +++ b/sound/soc/qcom/lpass.h @@ -83,7 +83,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 */