From patchwork Thu Feb 11 12:18:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 61750 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp155261lbl; Thu, 11 Feb 2016 04:18:45 -0800 (PST) X-Received: by 10.98.11.217 with SMTP id 86mr37830970pfl.71.1455193124968; Thu, 11 Feb 2016 04:18:44 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o4si12301928pap.178.2016.02.11.04.18.44; Thu, 11 Feb 2016 04:18:44 -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 S1753142AbcBKMSf (ORCPT + 30 others); Thu, 11 Feb 2016 07:18:35 -0500 Received: from mail-wm0-f44.google.com ([74.125.82.44]:36279 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753113AbcBKMSa (ORCPT ); Thu, 11 Feb 2016 07:18:30 -0500 Received: by mail-wm0-f44.google.com with SMTP id p63so70292696wmp.1 for ; Thu, 11 Feb 2016 04:18:30 -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=Daobo/YwJ7bOWD1hJ/4PXnWCGM+e/Z9FcnSHFxnw0So=; b=c9G2NRNT8mZDV9VKoMdsMQ78KCYLi6FvEl9kix8BzEzCEQwcrTJIcERiYttaxW349O fbiyK/CT4yndwwFPCdvAwJ8iGStn1Nb25GMuzvzur9yVakS2sLm08creQVSgJiR0OY5y 0vipU8xd+HIs4B/eCrGZXAyGMqUEl7h4I3JtY= 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=Daobo/YwJ7bOWD1hJ/4PXnWCGM+e/Z9FcnSHFxnw0So=; b=M/7RuaKBKAXjyyX6/Sl+hNyWEP+Pba8AnYMmytNPVYfaZAgVFnkxiJTaOxapQ8pb+6 ucyDA2C5QSPoKTBv9ejQOJ1ImmoZRBYGPxT/JtuyttD1mP5R7JqH58Jx7L0z7GEUO5Gt JaYKW5Rvg1pjaTg+RO6mqMKBslNKiPd6PWNVfaNg3xXUsW3tilasZGgxS+J3sWVB5KZg sUU3z4JBAuJoDd6BI47o2uTwj0Z1niq2petfPMbDdj7PcmTfZ3FbSfllElAC1J7nQqdp kj2f5dcHkPGLESYhLWTEBfwYFKSIxM6GmPOCdf1cBX+0gUw2+10T7JkrQi19qvLCspIS TBFw== X-Gm-Message-State: AG10YORYGgzGPiR7EkiIs1ngf6pHFKQFvnYNi1Uq38K6roO9fUc6pCNqFC7f48EAmCc+XUAW X-Received: by 10.28.3.134 with SMTP id 128mr16378989wmd.92.1455193109565; Thu, 11 Feb 2016 04:18:29 -0800 (PST) Received: from localhost.localdomain (host-92-13-246-184.as43234.net. [92.13.246.184]) by smtp.gmail.com with ESMTPSA id w144sm26659651wmd.8.2016.02.11.04.18.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 11 Feb 2016 04:18:29 -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 12/14] ASoC: qcom: apq8016: set the correct max register for regmap Date: Thu, 11 Feb 2016 12:18:27 +0000 Message-Id: <1455193107-1974-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 Now that we are ready to access wrdma registers, set the max register and other regmap related configs to use correct values. Signed-off-by: Srinivas Kandagatla Acked-by: Kenneth Westfield --- sound/soc/qcom/lpass-cpu.c | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) -- 1.9.1 diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c index 00b6c9d..82e16b2 100644 --- a/sound/soc/qcom/lpass-cpu.c +++ b/sound/soc/qcom/lpass-cpu.c @@ -294,6 +294,17 @@ static bool lpass_cpu_regmap_writeable(struct device *dev, unsigned int reg) return true; } + for (i = 0; i < v->wrdma_channels; ++i) { + if (reg == LPAIF_WRDMACTL_REG(v, i + v->wrdma_channel_start)) + return true; + if (reg == LPAIF_WRDMABASE_REG(v, i + v->wrdma_channel_start)) + return true; + if (reg == LPAIF_WRDMABUFF_REG(v, i + v->wrdma_channel_start)) + return true; + if (reg == LPAIF_WRDMAPER_REG(v, i + v->wrdma_channel_start)) + return true; + } + return false; } @@ -327,6 +338,19 @@ static bool lpass_cpu_regmap_readable(struct device *dev, unsigned int reg) return true; } + for (i = 0; i < v->wrdma_channels; ++i) { + if (reg == LPAIF_WRDMACTL_REG(v, i + v->wrdma_channel_start)) + return true; + if (reg == LPAIF_WRDMABASE_REG(v, i + v->wrdma_channel_start)) + return true; + if (reg == LPAIF_WRDMABUFF_REG(v, i + v->wrdma_channel_start)) + return true; + if (reg == LPAIF_WRDMACURR_REG(v, i + v->wrdma_channel_start)) + return true; + if (reg == LPAIF_WRDMAPER_REG(v, i + v->wrdma_channel_start)) + return true; + } + return false; } @@ -344,6 +368,10 @@ static bool lpass_cpu_regmap_volatile(struct device *dev, unsigned int reg) if (reg == LPAIF_RDMACURR_REG(v, i)) return true; + for (i = 0; i < v->wrdma_channels; ++i) + if (reg == LPAIF_WRDMACURR_REG(v, i + v->wrdma_channel_start)) + return true; + return false; } @@ -399,8 +427,9 @@ int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev) return PTR_ERR((void const __force *)drvdata->lpaif); } - lpass_cpu_regmap_config.max_register = LPAIF_RDMAPER_REG(variant, - variant->rdma_channels); + lpass_cpu_regmap_config.max_register = LPAIF_WRDMAPER_REG(variant, + variant->wrdma_channels + + variant->wrdma_channel_start); drvdata->lpaif_map = devm_regmap_init_mmio(&pdev->dev, drvdata->lpaif, &lpass_cpu_regmap_config);