From patchwork Mon Feb 1 17:29:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 60956 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp170996lbb; Mon, 1 Feb 2016 09:29:53 -0800 (PST) X-Received: by 10.98.34.25 with SMTP id i25mr5445738pfi.26.1454347791205; Mon, 01 Feb 2016 09:29:51 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id wz4si12457142pab.145.2016.02.01.09.29.50; Mon, 01 Feb 2016 09:29:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-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-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754247AbcBAR3q (ORCPT + 7 others); Mon, 1 Feb 2016 12:29:46 -0500 Received: from mail-wm0-f41.google.com ([74.125.82.41]:35248 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754193AbcBAR3m (ORCPT ); Mon, 1 Feb 2016 12:29:42 -0500 Received: by mail-wm0-f41.google.com with SMTP id r129so81633019wmr.0 for ; Mon, 01 Feb 2016 09:29:41 -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=/oNYHc7/ic8YDKFEfHaUYysA8bsTRqVXzkQdGSBs/x8=; b=krTbIheM4AodTOihWDl2b/3DDck/Im1r6ujCSQ9U3gacrY/cTJcoQ6YG0M1tJbs1vU +vTFjwasFxar9U6U75PjVLwLmjPcEGqkHkAJNDYQv0VqlF0f9QdkyEgx0V7dx9B8zqm9 4+sSEpenHE+MCw+1EPP7bGMJrEtrPqXQX9eq0= 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=/oNYHc7/ic8YDKFEfHaUYysA8bsTRqVXzkQdGSBs/x8=; b=DXGyslN94N+lFM5VbnL0jCPkH/ogKRNcxxbelllD0mNqX4IoC0B6LniDCV3ArCcZdx abwfOfkLbeajM2D7snueVW52CKqX6IE7D1Nf5SeVGduxg7Xhk7/O+qvGhnZyhUol/ffW E9wdHsMiAI0wCz2/tUiD6n29DkVbsRPNAhLMNjkv/sMvgUApDc0CInw2B2+9/0DScbdO btVl7OckJHYPsoeYjP9BiYpca+gV2cXEIBvhFDLNPQQZl5D6FJS/yfPhtkTUdU3hWVQj AX56KLGDnvEEyJrYwwStImJFJqx6RAICe6sjf81WY/HPzXLY7Sy7eKOals+o8hsVPc54 h+QA== X-Gm-Message-State: AG10YOTxxgrFBb1WBcou8QET4/KIvBSmqLK3f191G0fQsXePAlw5GezfjsearbGpL1RZZ/Uh X-Received: by 10.28.103.5 with SMTP id b5mr3618955wmc.5.1454347781371; Mon, 01 Feb 2016 09:29:41 -0800 (PST) Received: from localhost.localdomain (host-92-13-246-184.as43234.net. [92.13.246.184]) by smtp.gmail.com with ESMTPSA id 198sm12530799wml.22.2016.02.01.09.29.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 01 Feb 2016 09:29:40 -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 13/15] ASoC: qcom: apq8016: set the correct max register for regmap Date: Mon, 1 Feb 2016 17:29:38 +0000 Message-Id: <1454347778-11002-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-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@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 --- sound/soc/qcom/lpass-cpu.c | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c index 97bc202..82c21b2 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; } @@ -398,8 +426,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);