Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1198205pxu; Fri, 27 Nov 2020 01:59:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJy3Iu1JY+Fj1uW6Rb093RZJ2BJMe/RNbsoinEBLcMCBNzioDrBFqYNhg4Z4Xl2vvnK9iwfl X-Received: by 2002:aa7:d456:: with SMTP id q22mr5841303edr.206.1606471188468; Fri, 27 Nov 2020 01:59:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606471188; cv=none; d=google.com; s=arc-20160816; b=DUMZWVZR7cNR20WeBqXTxyJffCe7wK0YdVF6W8QsiUTIuslFMABm1A8+5EUMEepjvn mGAp+bVsPtV4/bL6iiOOY7KpDvbXzb6SyrqjaD1jw1gBkfRJY9XO9Au31kXCHa2E9tMw 3aP0rFkVbnIpzj4ebJrDqajY1matFNZXizg4GdYnJTrEuB0CxJW8rRlxWKlZaMnquzm1 O4oNTrOfhilTLU5L16crfWV2G/4evnBHuUzHY0inVMUMbcNpSzYjj7YDmY1fpT1HM/+e FQZSBwUdN6YEV1om21cOzL2jeWqs+jlFXwAHKZS4728GPbh41VT0XDE+MZ02zRFF2bGT hC0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from:dmarc-filter :sender:dkim-signature; bh=uh97Z0sQ4kcYvO9iLWdWG4UvbvTzslMqDnQZy4L6frI=; b=H2gR0UsDNBXqzVMjpeI5AcUQss2oOdRimuNN4f3HgiJFSaf5J2tBBRMjvDKeN5z/8S 4G3M/iUE9uOAdIXtuMyYxuLNFSZQqfmTyymHqiglHOenOKqtumF8uJLjhw6RMR+cnwLX Zr7oqrIuJp4Jm1sXOOUeKq3xvcqWchjKoy3CILzE8YPBM5rE8oIuGiZrvtn0groZhbbX Qe1tYyOuRyNv3PQhhqric/j0Oe33Ehs+pZ8myt/h12FA0cvxokHbwGY3DzO+f57SWE66 5b4TJfqMOUK+sr44QwoXbxs6/+XQrW8iVf5+y+Ngq1bebHxpKxhhBJN70GNigNSkvekd 3FQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=XuPw0WjB; 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 u19si5731505edo.433.2020.11.27.01.59.26; Fri, 27 Nov 2020 01:59:48 -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=XuPw0WjB; 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 S1727697AbgK0J4t (ORCPT + 99 others); Fri, 27 Nov 2020 04:56:49 -0500 Received: from z5.mailgun.us ([104.130.96.5]:26397 "EHLO z5.mailgun.us" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727232AbgK0J4s (ORCPT ); Fri, 27 Nov 2020 04:56:48 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1606471008; h=Message-Id: Date: Subject: Cc: To: From: Sender; bh=uh97Z0sQ4kcYvO9iLWdWG4UvbvTzslMqDnQZy4L6frI=; b=XuPw0WjBYE7rKB6ClQ77vZcQZW/0yMt6M2nNVC6lwJax1SyIcC7LO61hKw7ID5Qlvwi6D3ud AxhIP7A33xLIzbLOMP+Bv3qrGI5DganNnvUnjhH//eaoQT6CEqTQWLudG3zSmwo7eI6PqfN7 RJFKMYjHbBXvEFBNHJlxDUJ92KM= X-Mailgun-Sending-Ip: 104.130.96.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-n06.prod.us-east-1.postgun.com with SMTP id 5fc0cd5fa5c560669c7e683a (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Fri, 27 Nov 2020 09:56:47 GMT Sender: srivasam=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id BB43AC4346A; Fri, 27 Nov 2020 09:56:46 +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 860B9C4346A; Fri, 27 Nov 2020 09:56:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 860B9C4346A 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 v3] ASoC: qcom: Fix playback recover problem in suspend resume Date: Fri, 27 Nov 2020 15:26:28 +0530 Message-Id: <1606470988-26965-1-git-send-email-srivasam@codeaurora.org> X-Mailer: git-send-email 2.7.4 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org To support playback continuation after hard suspend(bypass powerd) and resume: Prepare device in platform trigger callback. Make I2s and DMA control registers as non volatile. Signed-off-by: V Sujith Kumar Reddy Signed-off-by: Srinivasa Rao Mandadapu --- Changes Since v1 and v2: -- Subject lines changed sound/soc/qcom/lpass-cpu.c | 8 ++------ sound/soc/qcom/lpass-platform.c | 5 +++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c index af684fd..c99be03 100644 --- a/sound/soc/qcom/lpass-cpu.c +++ b/sound/soc/qcom/lpass-cpu.c @@ -454,20 +454,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..2b0a7c1 100644 --- a/sound/soc/qcom/lpass-platform.c +++ b/sound/soc/qcom/lpass-platform.c @@ -481,8 +481,9 @@ static int lpass_platform_pcmops_trigger(struct snd_soc_component *component, return -ENOTRECOVERABLE; } switch (cmd) { - case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_RESUME: + lpass_platform_pcmops_prepare(component, substream); + case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: ret = regmap_fields_write(dmactl->enable, id, LPAIF_DMACTL_ENABLE_ON); @@ -592,7 +593,7 @@ static int lpass_platform_pcmops_trigger(struct snd_soc_component *component, break; } - return 0; + return ret; } static snd_pcm_uframes_t lpass_platform_pcmops_pointer( -- Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc., is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.