Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1038180pxu; Wed, 2 Dec 2020 09:28:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJwfVg3BQSV05eDwV5MTZA1Iut1A84ntA9y+BJJvw2tjfgPYRu5KmA1kmxJEHFbk9PDRFTIm X-Received: by 2002:a17:906:a1cb:: with SMTP id bx11mr792066ejb.508.1606930100218; Wed, 02 Dec 2020 09:28:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606930100; cv=none; d=google.com; s=arc-20160816; b=O12VexwEJqpDQtk+1WhbAVqgXFZt5snCUmIC35qYcSYTW7muBvKDfUx3krd6s0lj/k AX/yArSfpaZcyfcUZe6IH/3UpEI5+AXqVlx44rqjUtTTV96cGagznMF3YvAPt/f+Ug46 798MlQzDYUvradhNhk7kOXd3Iya8KujecyeOElQxiqhsZDFSJLSG/pCcDVW/0DgiuzZl 3HgmoYgefzYxcauzFw5tVdA+PiXYKy3YpjhidUIstfmCpytf9qzaSFDUiuO4kPJnlVhv qCs8PR04rJchAh5JnE8OOlsfAoZP9Uu+ECyjKOsbH915l7HhQxcnW63hZgcUR8urhM0y Wtlw== 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=XCbGtFpkxfX04IDxYSYPabTaVb2FLbxMGt+XuP7RsZE=; b=GI2OTPO0L9ycryQuwADlt2RwS5lG5mVr3EmL+udiPbNaCD6MAnPq3N0D/ASbZMpaFM ZQzppRlFsS3lwfsepWvzr4PqExlp13LUDrNAjggxbJ2EqDM5upGmSsySwdq/jmTbdYuG +76iaa9GHZkZuW+uDlvmU6eF/2DW02mLeQSvuo/nZKbYQnPq7aognZMV7zNfGjRCjXXr /FMjwXvi675ghQyzkRHYxvrAuKkGoIoMJr/Ofjr3+K8qKtWiHLh0JPlLzFqcR23LKV3X VDW2Mp+RLuY1VC2xKPwSAmgEHfcuO8d3NXeuP9EShC/ue4SlzaAQeFxGY02h/jO2VXYE QI+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=IR2P9FFW; 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 c7si365032edr.193.2020.12.02.09.27.56; Wed, 02 Dec 2020 09:28:20 -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=IR2P9FFW; 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 S2389248AbgLBRXv (ORCPT + 99 others); Wed, 2 Dec 2020 12:23:51 -0500 Received: from a2.mail.mailgun.net ([198.61.254.61]:28191 "EHLO a2.mail.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389244AbgLBRXv (ORCPT ); Wed, 2 Dec 2020 12:23:51 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1606929812; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=XCbGtFpkxfX04IDxYSYPabTaVb2FLbxMGt+XuP7RsZE=; b=IR2P9FFWSEUsTpyIUnVH4Glh3ivPFE3eNhESALIr4vQcApmt1EQFe14Cg+78ktJjZ7nvc0+P y8gNktioAlUq5pNRXo9rb+JShxT98/MKS6rAdy8EA4pn8j9jwzWLw0q/FgYcimS+HbM1iXEr ZIZkpmi/qWKFjnCNFuvlCGAJKGo= X-Mailgun-Sending-Ip: 198.61.254.61 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 5fc7cd7107535c81bab9cb96 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 02 Dec 2020 17:22:57 GMT Sender: srivasam=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 0A69AC43467; Wed, 2 Dec 2020 17:22:56 +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 379CFC43461; Wed, 2 Dec 2020 17:22:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 379CFC43461 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 2/2] ASoC: qcom: Add support for playback recover after resume Date: Wed, 2 Dec 2020 22:52:28 +0530 Message-Id: <1606929748-16828-3-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 To support playback continuation after hard suspend(bypass powerd) and resume do regcache sync with component driver pm ops. Signed-off-by: V Sujith Kumar Reddy Signed-off-by: Srinivasa Rao Mandadapu Reviewed-by: Srinivas Kandagatla Tested-by: Steev Klimaszewski --- sound/soc/qcom/lpass-platform.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/sound/soc/qcom/lpass-platform.c b/sound/soc/qcom/lpass-platform.c index 0e71899..12764a8 100644 --- a/sound/soc/qcom/lpass-platform.c +++ b/sound/soc/qcom/lpass-platform.c @@ -827,6 +827,39 @@ static void lpass_platform_pcm_free(struct snd_soc_component *component, } } +static int lpass_platform_pcmops_suspend(struct snd_soc_component *component) +{ + struct lpass_data *drvdata = snd_soc_component_get_drvdata(component); + struct regmap *map; + unsigned int dai_id = component->id; + + if (dai_id == LPASS_DP_RX) + map = drvdata->hdmiif_map; + else + map = drvdata->lpaif_map; + + regcache_cache_only(map, true); + regcache_mark_dirty(map); + + return 0; +} + +static int lpass_platform_pcmops_resume(struct snd_soc_component *component) +{ + struct lpass_data *drvdata = snd_soc_component_get_drvdata(component); + struct regmap *map; + unsigned int dai_id = component->id; + + if (dai_id == LPASS_DP_RX) + map = drvdata->hdmiif_map; + else + map = drvdata->lpaif_map; + + regcache_cache_only(map, false); + return regcache_sync(map); +} + + static const struct snd_soc_component_driver lpass_component_driver = { .name = DRV_NAME, .open = lpass_platform_pcmops_open, @@ -839,6 +872,8 @@ static const struct snd_soc_component_driver lpass_component_driver = { .mmap = lpass_platform_pcmops_mmap, .pcm_construct = lpass_platform_pcm_new, .pcm_destruct = lpass_platform_pcm_free, + .suspend = lpass_platform_pcmops_suspend, + .resume = lpass_platform_pcmops_resume, }; -- Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc., is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.