From patchwork Wed Feb 10 10:19:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 61634 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp2554018lbl; Wed, 10 Feb 2016 02:22:48 -0800 (PST) X-Received: by 10.98.19.12 with SMTP id b12mr56628430pfj.29.1455099768425; Wed, 10 Feb 2016 02:22:48 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 76si4225327pfk.107.2016.02.10.02.22.48; Wed, 10 Feb 2016 02:22:48 -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 S1757929AbcBJKWp (ORCPT + 30 others); Wed, 10 Feb 2016 05:22:45 -0500 Received: from mail-wm0-f46.google.com ([74.125.82.46]:37907 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757773AbcBJKTV (ORCPT ); Wed, 10 Feb 2016 05:19:21 -0500 Received: by mail-wm0-f46.google.com with SMTP id p63so19659409wmp.1 for ; Wed, 10 Feb 2016 02:19:20 -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=65KGlg/AKV9sf5TmxU9y7KMuxCWErWAQCN+Lti7H3UY=; b=PNOcBBJHaUbJZP6z6Dl7/uFV79/cTQTJYl4TIlxfIGAX2a/BH7ljRGwe2T4duAoeo1 jfDIXazrSzI2VXkG3mDT3QO32SwbBFkAvHVwRYDXKkIEhYmdu6MAh3yNyBMdifYFnOXL DStm8Mcoijt1HyhuZfDQ6i4R4d5D7wWjTIdwQ= 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=65KGlg/AKV9sf5TmxU9y7KMuxCWErWAQCN+Lti7H3UY=; b=L6/Y7FKJ/IHK2lkeEJqOQM/TlOcHEC9dxFq2w2gZ7qx4rcUyaypiCrGHXBDwFT1wkY yLdKHopAXv6YdrH1DPeQ6RRvmF1BrQCXBXNCfft+5NwRWSbnGcuu4xD5Heu2q5ldJO3K E4YMZ4RBNljI+5phcfzzYysSSigN4DseGo9El4S+QVOAOHtbRuZy7sjouKA1SOwgqsPd Bv4VFSjC42it0Kx3XZiDuNOo9LEwkUjVewMe6TerL4cZyYMXj7sRjWNtVtA2GJI9l0P5 bXfMiQjShVo5COgDZNzGdl/1csd+BqNHLBWFnFETGILkrtvkd7pkcdI2M5l3+/iiuHyR T2pQ== X-Gm-Message-State: AG10YOQK9ph4tiHruWo8QTZkDxi0U46jr/83gqDDmlOZQaJXtfKL6O6YCsjuntcx9rd8GxMy X-Received: by 10.194.5.227 with SMTP id v3mr46778206wjv.59.1455099560128; Wed, 10 Feb 2016 02:19:20 -0800 (PST) Received: from localhost.localdomain (host-92-13-246-184.as43234.net. [92.13.246.184]) by smtp.gmail.com with ESMTPSA id cb2sm2268547wjc.16.2016.02.10.02.19.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 10 Feb 2016 02:19:19 -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 08/14] ASoC: qcom: apq8016: add wrdma support Date: Wed, 10 Feb 2016 10:19:17 +0000 Message-Id: <1455099557-665-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 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 | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) -- 1.9.1 diff --git a/sound/soc/qcom/lpass-apq8016.c b/sound/soc/qcom/lpass-apq8016.c index ca3bbd5..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); @@ -214,6 +226,10 @@ static struct lpass_variant apq8016_data = { .rdma_reg_stride = 0x1000, .rdma_channels = 2, .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,