From patchwork Fri Oct 1 11:21:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivasa Rao Mandadapu X-Patchwork-Id: 12530335 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A82AC4332F for ; Fri, 1 Oct 2021 11:22:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7B62961A8C for ; Fri, 1 Oct 2021 11:22:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353809AbhJALYZ (ORCPT ); Fri, 1 Oct 2021 07:24:25 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:46392 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353805AbhJALYX (ORCPT ); Fri, 1 Oct 2021 07:24:23 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1633087360; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=40ApUzuvtbwbH4t5Gb3Ts0gs6DJSioSNyNBn2+OJZQc=; b=tla5XeHhRXQ2XagVhyD5naEZQ+otZPawXE+/rwBEn0ryPm7Rk8ljcB+Ax96eYYJVXDypUvS7 qWD+40qmHNx17fSYEVbbOUloGsAwOSC0KBPPA83XJglCphCZmxIsv0pyGij6jyE+hQGuetsR b1yMIx8gblWOqIIqjfIvClZR0W8= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyI1MzIzYiIsICJsaW51eC1hcm0tbXNtQHZnZXIua2VybmVsLm9yZyIsICJiZTllNGEiXQ== Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n05.prod.us-west-2.postgun.com with SMTP id 6156ef7fa5a9bab6e84cda55 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Fri, 01 Oct 2021 11:22:39 GMT Sender: srivasam=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 81D30C4361B; Fri, 1 Oct 2021 11:22:39 +0000 (UTC) Received: from hu-srivasam-hyd.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 0FADBC4338F; Fri, 1 Oct 2021 11:22:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 smtp.codeaurora.org 0FADBC4338F 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=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, swboyd@chromium.org, judyhsiao@chromium.org Cc: Srinivasa Rao Mandadapu , Venkata Prasad Potturu Subject: [PATCH 8/8] ASoc: qcom: lpass: Add suspend and resume for sc7280 platform Date: Fri, 1 Oct 2021 16:51:32 +0530 Message-Id: <1633087292-1378-9-git-send-email-srivasam@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1633087292-1378-1-git-send-email-srivasam@codeaurora.org> References: <1633087292-1378-1-git-send-email-srivasam@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Adds device suspend and resume callbacks for sc7280 platform driver ops. Signed-off-by: Venkata Prasad Potturu Signed-off-by: Srinivasa Rao Mandadapu --- sound/soc/qcom/lpass-cpu.c | 22 ++++++++++++++++++++++ sound/soc/qcom/lpass-sc7280.c | 2 ++ sound/soc/qcom/lpass.h | 2 ++ 3 files changed, 26 insertions(+) diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c index c8dec52..5aa5630 100644 --- a/sound/soc/qcom/lpass-cpu.c +++ b/sound/soc/qcom/lpass-cpu.c @@ -1307,6 +1307,28 @@ int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev) } EXPORT_SYMBOL_GPL(asoc_qcom_lpass_cpu_platform_probe); +int asoc_qcom_lpass_cpu_platform_resume(struct platform_device *pdev) +{ + struct lpass_data *drvdata = platform_get_drvdata(pdev); + + if (drvdata->variant->init) + drvdata->variant->init(pdev); + + return 0; +} +EXPORT_SYMBOL_GPL(asoc_qcom_lpass_cpu_platform_resume); + +int asoc_qcom_lpass_cpu_platform_suspend(struct platform_device *pdev, pm_message_t state) +{ + struct lpass_data *drvdata = platform_get_drvdata(pdev); + + if (drvdata->variant->exit) + drvdata->variant->exit(pdev); + + return 0; +} +EXPORT_SYMBOL_GPL(asoc_qcom_lpass_cpu_platform_suspend); + int asoc_qcom_lpass_cpu_platform_remove(struct platform_device *pdev) { struct lpass_data *drvdata = platform_get_drvdata(pdev); diff --git a/sound/soc/qcom/lpass-sc7280.c b/sound/soc/qcom/lpass-sc7280.c index 983a61b..6fdf111 100644 --- a/sound/soc/qcom/lpass-sc7280.c +++ b/sound/soc/qcom/lpass-sc7280.c @@ -591,6 +591,8 @@ static struct platform_driver sc7280_lpass_cpu_platform_driver = { .probe = asoc_qcom_lpass_cpu_platform_probe, .remove = asoc_qcom_lpass_cpu_platform_remove, .shutdown = asoc_qcom_lpass_cpu_platform_shutdown, + .resume = asoc_qcom_lpass_cpu_platform_resume, + .suspend = asoc_qcom_lpass_cpu_platform_suspend, }; module_platform_driver(sc7280_lpass_cpu_platform_driver); diff --git a/sound/soc/qcom/lpass.h b/sound/soc/qcom/lpass.h index e0ea698..53d9b5d 100644 --- a/sound/soc/qcom/lpass.h +++ b/sound/soc/qcom/lpass.h @@ -419,5 +419,7 @@ extern const struct snd_soc_dai_ops asoc_qcom_lpass_cpu_dai_ops; int lpass_cpu_pcm_new(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); extern const struct snd_soc_dai_ops asoc_qcom_lpass_wcd_dai_ops; +int asoc_qcom_lpass_cpu_platform_suspend(struct platform_device *pdev, pm_message_t state); +int asoc_qcom_lpass_cpu_platform_resume(struct platform_device *pdev); #endif /* __LPASS_H__ */