Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1036701pxu; Wed, 2 Dec 2020 09:26:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJybA76z3L4YUtdBU8MSpFP9cfV1A01xy0YN/4KZrQV7tRgK95xU6xxNpTLtCHO6cLSSpzPC X-Received: by 2002:a17:906:edca:: with SMTP id sb10mr830130ejb.284.1606929962266; Wed, 02 Dec 2020 09:26:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606929962; cv=none; d=google.com; s=arc-20160816; b=T00oGSPt5OnBLG9HOMuE8Hj2f2iiW6YMYny76tohzLLFLOzK4UayCfUJ2LYOPnh3VE JUujldXZFnlUgvGRj/WN+H3s4+wOyV98+kKQQsFbjKdvFGWxRK/wr3OQSttbYoULS9xe aVZhFn0EczwIi/5dAQUeyPumnyZ2pCUZAVNuTcMGdUUv3QzXEPyxHdIqAFCUUFeDw+od TAzr+DhwO587CWUawe//i7yDbiTNqX9Yl1SceOli2G/d93rfsQukAAEkUFFEosbrFxdU S6KGu3ghUgTxQdqsw1j5jEsfeaM0A8B+1X2UbyaHIJRQnSD31YMuOtgEOkhQ7erGCYBc yKFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dmarc-filter:sender:dkim-signature; bh=QFFA23qy7oqkdGBf28tQidTCwbPKMD40FeR8cTpAYlU=; b=YG/bQWT8tmr9s4j+icYX91SDQBDo7vx6uWCzLoFs80X/N7q/yy2fzzkhq9cheyEqb/ FMnhkzNWJWwHFu9hqgeVmQefUCDyiJHKt/uOwHt0MiZPOmt4+MvvODMVUGG4kwilXOvx f2iMl3q0J1KhKd8N8Svjz/8uyUUPFKgH9EV7DwIP6pszivJwYldDKK6S8LM7o6DEAhwA 5a4q/XNVq8gJ0B0DW/8Hn14PZtoVYHhVPa4FY7FEKIFEN6rxcO5av6ENUNKCcrCWBtl6 sw8OjVvTqqFfbLIxb7qEPr+OLm5YAO+ExJ+diVfmRAxelAu94jqHml4q0xmrWiCf6Owc y+RA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=OIFkmh9s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q12si358097ejt.421.2020.12.02.09.25.36; Wed, 02 Dec 2020 09:26:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=OIFkmh9s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389239AbgLBRXq (ORCPT + 99 others); Wed, 2 Dec 2020 12:23:46 -0500 Received: from m42-5.mailgun.net ([69.72.42.5]:49099 "EHLO m42-5.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389088AbgLBRXq (ORCPT ); Wed, 2 Dec 2020 12:23:46 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1606929807; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=QFFA23qy7oqkdGBf28tQidTCwbPKMD40FeR8cTpAYlU=; b=OIFkmh9sOlA5fA3oH+zD4ErW64l0FmprJODY2yNGdLUYaZ5xe9yuZt6kqu9M2IlfVUtBz31/ SDYSPXmw7zkPdrzLJto0N7hrjFcvYVx+gWex4LUCdUN/Y2fT/Dk5YkUSxMtyebEeRt5nzQmj Ansyhb2l3UVvG15Ed1ZdbE+cUno= X-Mailgun-Sending-Ip: 69.72.42.5 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n01.prod.us-west-2.postgun.com with SMTP id 5fc7cd6b07535c81bab9b827 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 02 Dec 2020 17:22:51 GMT Sender: srivasam=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id A0825C43467; Wed, 2 Dec 2020 17:22:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00,SPF_FAIL, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from hyd-lnxbld210.qualcomm.com (unknown [202.46.22.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: srivasam) by smtp.codeaurora.org (Postfix) with ESMTPSA id E9D7CC43464; Wed, 2 Dec 2020 17:22:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org E9D7CC43464 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=srivasam@codeaurora.org From: Srinivasa Rao Mandadapu To: agross@kernel.org, bjorn.andersson@linaro.org, lgirdwood@gmail.com, broonie@kernel.org, robh+dt@kernel.org, plai@codeaurora.org, bgoswami@codeaurora.org, perex@perex.cz, tiwai@suse.com, srinivas.kandagatla@linaro.org, rohitkr@codeaurora.org, linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Srinivasa Rao Mandadapu , V Sujith Kumar Reddy Subject: [PATCH v5 1/2] ASoC: qcom: Fix incorrect volatile registers Date: Wed, 2 Dec 2020 22:52:27 +0530 Message-Id: <1606929748-16828-2-git-send-email-srivasam@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1606929748-16828-1-git-send-email-srivasam@codeaurora.org> References: <1606929748-16828-1-git-send-email-srivasam@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org MI2S and DMA control registers are not volatile, so remove these from volatile registers list. Registers reset state check by reading non volatile registers makes no use, so remove error check from cpu and platform trigger callbacks. Fixes commit b1824968221cc ("ASoC: qcom: Fix enabling BCLK and LRCLK in LPAIF invalid state") Signed-off-by: V Sujith Kumar Reddy Signed-off-by: Srinivasa Rao Mandadapu --- sound/soc/qcom/lpass-cpu.c | 20 ++------------------ sound/soc/qcom/lpass-platform.c | 11 ----------- 2 files changed, 2 insertions(+), 29 deletions(-) diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c index af684fd..c5e99c2 100644 --- a/sound/soc/qcom/lpass-cpu.c +++ b/sound/soc/qcom/lpass-cpu.c @@ -270,18 +270,6 @@ static int lpass_cpu_daiops_trigger(struct snd_pcm_substream *substream, struct lpaif_i2sctl *i2sctl = drvdata->i2sctl; unsigned int id = dai->driver->id; int ret = -EINVAL; - unsigned int val = 0; - - ret = regmap_read(drvdata->lpaif_map, - LPAIF_I2SCTL_REG(drvdata->variant, dai->driver->id), &val); - if (ret) { - dev_err(dai->dev, "error reading from i2sctl reg: %d\n", ret); - return ret; - } - if (val == LPAIF_I2SCTL_RESET_STATE) { - dev_err(dai->dev, "error in i2sctl register state\n"); - return -ENOTRECOVERABLE; - } switch (cmd) { case SNDRV_PCM_TRIGGER_START: @@ -454,20 +442,16 @@ static bool lpass_cpu_regmap_volatile(struct device *dev, unsigned int reg) struct lpass_variant *v = drvdata->variant; int i; - for (i = 0; i < v->i2s_ports; ++i) - if (reg == LPAIF_I2SCTL_REG(v, i)) - return true; for (i = 0; i < v->irq_ports; ++i) if (reg == LPAIF_IRQSTAT_REG(v, i)) return true; for (i = 0; i < v->rdma_channels; ++i) - if (reg == LPAIF_RDMACURR_REG(v, i) || reg == LPAIF_RDMACTL_REG(v, i)) + 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) || - reg == LPAIF_WRDMACTL_REG(v, i + v->wrdma_channel_start)) + if (reg == LPAIF_WRDMACURR_REG(v, i + v->wrdma_channel_start)) return true; return false; diff --git a/sound/soc/qcom/lpass-platform.c b/sound/soc/qcom/lpass-platform.c index 80b09de..0e71899 100644 --- a/sound/soc/qcom/lpass-platform.c +++ b/sound/soc/qcom/lpass-platform.c @@ -452,7 +452,6 @@ static int lpass_platform_pcmops_trigger(struct snd_soc_component *component, unsigned int reg_irqclr = 0, val_irqclr = 0; unsigned int reg_irqen = 0, val_irqen = 0, val_mask = 0; unsigned int dai_id = cpu_dai->driver->id; - unsigned int dma_ctrl_reg = 0; ch = pcm_data->dma_ch; if (dir == SNDRV_PCM_STREAM_PLAYBACK) { @@ -469,17 +468,7 @@ static int lpass_platform_pcmops_trigger(struct snd_soc_component *component, id = pcm_data->dma_ch - v->wrdma_channel_start; map = drvdata->lpaif_map; } - ret = regmap_read(map, LPAIF_DMACTL_REG(v, ch, dir, dai_id), &dma_ctrl_reg); - if (ret) { - dev_err(soc_runtime->dev, "error reading from rdmactl reg: %d\n", ret); - return ret; - } - if (dma_ctrl_reg == LPAIF_DMACTL_RESET_STATE || - dma_ctrl_reg == LPAIF_DMACTL_RESET_STATE + 1) { - dev_err(soc_runtime->dev, "error in rdmactl register state\n"); - return -ENOTRECOVERABLE; - } switch (cmd) { case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_RESUME: -- Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc., is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.