From patchwork Mon Feb 1 17:29:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 60953 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp170729lbb; Mon, 1 Feb 2016 09:29:33 -0800 (PST) X-Received: by 10.98.64.83 with SMTP id n80mr40449103pfa.149.1454347772892; Mon, 01 Feb 2016 09:29:32 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ai6si25394797pad.181.2016.02.01.09.29.32; Mon, 01 Feb 2016 09:29:32 -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 S1754697AbcBAR32 (ORCPT + 30 others); Mon, 1 Feb 2016 12:29:28 -0500 Received: from mail-wm0-f45.google.com ([74.125.82.45]:38530 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754159AbcBAR3Y (ORCPT ); Mon, 1 Feb 2016 12:29:24 -0500 Received: by mail-wm0-f45.google.com with SMTP id p63so82141738wmp.1 for ; Mon, 01 Feb 2016 09:29:23 -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=xo7m02gOMYXgZb55p1Nk1o7wMAY7mn+WjMj6l5pXGD4=; b=IY6gqebQpxwWZBQUeMLQJAwt6Nke+9smAT7cR0v8u1OrhsJXNII0QulTF6xqCcV0M1 BEuRCeEhHjPSPo92p/BB/HK9YtQHx5UuEBLBkErZccTI48AA4s7WIZjAsRjYfk7SuZ18 H0vk9oa9nFEydZqLrPOBc3j/V9Cd4JMPapYIQ= 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=xo7m02gOMYXgZb55p1Nk1o7wMAY7mn+WjMj6l5pXGD4=; b=mtTxU13XOrz+b2w6YFQjxZsaIRAWTLmdy5G9TJApysnhDTpuelYyoDsoaRRnUYzOz5 DKXs7C8u9bCnyA4KPLliizgnwCABGhIumUgX/HVlnkkoTa4qEqhjhcJfofchAu0CeaMI pmChD2IZm7GL7KuJ5yeDzyRsiU0Z4/p4Zm4J7aAuaKsidOZau/IMmLGiaTphQHlDnm/H AjC4LOPIciRjSY6OwUsWTTwMggv3pc6RHFE0OqW7OI9Toch193ES4vrnrKwP4ouQ4C/Z qOHn9cdYv+CyvNX+4yBTFNPWUGxua7FuM0+FQeWeN5OE330bzy7kpJV4+w0rsGN+baOA tTZg== X-Gm-Message-State: AG10YOSbfTUPWvovqXt/u4Mspa4L1HbKYZ+TTp3TVJ/p4gMc14kB6jffCpq4COzQB0qJV0RL X-Received: by 10.194.235.4 with SMTP id ui4mr23054437wjc.177.1454347763125; Mon, 01 Feb 2016 09:29:23 -0800 (PST) Received: from localhost.localdomain (host-92-13-246-184.as43234.net. [92.13.246.184]) by smtp.gmail.com with ESMTPSA id l2sm30214750wjf.15.2016.02.01.09.29.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 01 Feb 2016 09:29:22 -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 10/15] ASoC: qcom: apq8016: add wrdma support Date: Mon, 1 Feb 2016 17:29:20 +0000 Message-Id: <1454347760-10856-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 adds wrdma support in lpass-apq8016 by providing the register offsets and adding support in dma channel allocation callback. Signed-off-by: Srinivas Kandagatla --- sound/soc/qcom/lpass-apq8016.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) -- 1.9.1 diff --git a/sound/soc/qcom/lpass-apq8016.c b/sound/soc/qcom/lpass-apq8016.c index df44f09..3eef0c3 100644 --- a/sound/soc/qcom/lpass-apq8016.c +++ b/sound/soc/qcom/lpass-apq8016.c @@ -137,11 +137,23 @@ 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->dma_ch_bit_map, + int chan = 0; + + if (direction == SNDRV_PCM_STREAM_PLAYBACK) { + chan = find_first_zero_bit(&drvdata->dma_ch_bit_map, v->rdma_channels); - if (chan >= v->rdma_channels) - return -EBUSY; + if (chan >= v->rdma_channels) + return -EBUSY; + } else { + chan = find_next_zero_bit(&drvdata->dma_ch_bit_map, + v->wrdma_channel_start + + v->wrdma_channels, + v->wrdma_channel_start); + + if (chan >= v->wrdma_channel_start + v->wrdma_channels) + return -EBUSY; + } set_bit(chan, &drvdata->dma_ch_bit_map); @@ -213,7 +225,11 @@ static struct lpass_variant apq8016_data = { .rdma_reg_base = 0x8400, .rdma_reg_stride = 0x1000, .rdma_channels = 2, - .rdmactl_audif_start = 1, + .dmactl_audif_start = 1, + .wrdma_reg_base = 0xB000, + .wrdma_reg_stride = 0x1000, + .wrdma_channel_start = 5, + .wrdma_channels = 2, .dai_driver = apq8016_lpass_cpu_dai_driver, .num_dai = ARRAY_SIZE(apq8016_lpass_cpu_dai_driver), .init = apq8016_lpass_init,