Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp20074110rwd; Wed, 28 Jun 2023 19:37:11 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4NJ5IB7ClESVgdd87ouVHKN9DRFVfS6iLRuDVEUS0inHnJ6dCABJpp4PD2cU/CISl7Nnrw X-Received: by 2002:a05:6a00:10cf:b0:668:681f:ca98 with SMTP id d15-20020a056a0010cf00b00668681fca98mr28328012pfu.27.1688006230751; Wed, 28 Jun 2023 19:37:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688006230; cv=none; d=google.com; s=arc-20160816; b=Y2NBH3ua3uNd3nDCWy85Oevdk99Y/UVN9jMcPn0ZWS2genColik4nTLpjUvHOMeuIb iWLvcVtQcyko0vrramG5FwtWCsMwNTVfbmOM78WB8g3JUZWRzzpJjW1HTmu1YNbdz6hA viiXfkBGzx+XCO487E+oHcdvZV0vOsYHEphchUh8IvOY5mUf0cokQDtWaIqqIeNKZ+WA qn/3FjYZrFDstdC69JUMH9m3Pwxg5RdDCE0dHDmhtN3wRzPhVRAr9MVxATCKj7p6PtXp rWAR5kN17ZllPCxJ+Eyj73D2qF8kVeAkUDXXt3iVnjNeG4+O9QUdukorANsAJw9sRKLc 1REQ== 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 :to:from; bh=T5NTX7bExaJx12mntv4lml8PG9b1GDk/DaU6P/STw2A=; fh=wqCnLC59fNJLqJJs3/NMi5/oD30IP5JQsz1JrCsHxko=; b=BRYrdkNnwxGXQ85YmmfPC5JycLHykgB+PFEnoR2NtpOTIO8/LOl4ny8ixRqwlvMwnv PWWTR0j+83Wl+kcEk/WzPrLNiYK9H5RtDKxp4vka2GaG8zj6PzCxte/70YsZwhzjkoIh UMnci8V3Z9g/vRn+d1XI6zzhcVDi0z1Dz7IosTlvj9FjgTpvN1nQZEnOFJisLSzOEgoM 7MwPiTvqh6FT01KVtQDWiPog0n82KjT7GwDaATK5WJAZraq5ejlk35O0Tf2vrDQqj4Xd GrTQMsGC0HOvjy0JNAzac+snW2Rtm4pg1dXD87WF8D33UaqEJNbq7SIqazEAwdw4rK7s VfBg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 2-20020a630002000000b0055adfd70273si6775114pga.538.2023.06.28.19.36.56; Wed, 28 Jun 2023 19:37:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229639AbjF2CTB (ORCPT + 99 others); Wed, 28 Jun 2023 22:19:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230314AbjF2CS7 (ORCPT ); Wed, 28 Jun 2023 22:18:59 -0400 Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 804E2211D; Wed, 28 Jun 2023 19:18:57 -0700 (PDT) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 222B4200D56; Thu, 29 Jun 2023 04:10:40 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id DF4AA200D42; Thu, 29 Jun 2023 04:10:39 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 2919D181D0E5; Thu, 29 Jun 2023 10:10:38 +0800 (+08) From: Shengjiu Wang To: tfiga@chromium.org, m.szyprowski@samsung.com, mchehab@kernel.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, shengjiu.wang@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, nicoleotsuka@gmail.com, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, linuxppc-dev@lists.ozlabs.org Subject: [PATCH 6/6] ASoC: fsl_easrc: enable memory to memory function Date: Thu, 29 Jun 2023 09:37:53 +0800 Message-Id: <1688002673-28493-7-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1688002673-28493-1-git-send-email-shengjiu.wang@nxp.com> References: <1688002673-28493-1-git-send-email-shengjiu.wang@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Intergrate memory to memory feature to EASRC driver. call m2m probe(), remove(), suspend() and resume() in different callback. Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_easrc.c | 41 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/sound/soc/fsl/fsl_easrc.c b/sound/soc/fsl/fsl_easrc.c index b735b24badc2..bc5404627032 100644 --- a/sound/soc/fsl/fsl_easrc.c +++ b/sound/soc/fsl/fsl_easrc.c @@ -29,6 +29,7 @@ #include #include "fsl_easrc.h" +#include "fsl_asrc_m2m.h" #include "imx-pcm.h" #define FSL_EASRC_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \ @@ -2190,11 +2191,21 @@ static int fsl_easrc_probe(struct platform_device *pdev) return ret; } + /* probe the m2m feature */ + ret = fsl_asrc_m2m_probe(easrc); + if (ret) { + dev_err(&pdev->dev, "failed to init m2m device %d\n", ret); + return ret; + } + return 0; } static void fsl_easrc_remove(struct platform_device *pdev) { + /* remove the m2m feature */ + fsl_asrc_m2m_remove(pdev); + pm_runtime_disable(&pdev->dev); } @@ -2295,12 +2306,38 @@ static __maybe_unused int fsl_easrc_runtime_resume(struct device *dev) return ret; } +static int __maybe_unused fsl_easrc_suspend(struct device *dev) +{ + struct fsl_asrc *easrc = dev_get_drvdata(dev); + int ret; + + /* suspend m2m function first */ + fsl_asrc_m2m_suspend(easrc); + + ret = pm_runtime_force_suspend(dev); + + return ret; +} + +static int __maybe_unused fsl_easrc_resume(struct device *dev) +{ + struct fsl_asrc *easrc = dev_get_drvdata(dev); + int ret; + + ret = pm_runtime_force_resume(dev); + + /* resume m2m function */ + fsl_asrc_m2m_resume(easrc); + + return ret; +} + static const struct dev_pm_ops fsl_easrc_pm_ops = { SET_RUNTIME_PM_OPS(fsl_easrc_runtime_suspend, fsl_easrc_runtime_resume, NULL) - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, - pm_runtime_force_resume) + SET_SYSTEM_SLEEP_PM_OPS(fsl_easrc_suspend, + fsl_easrc_resume) }; static struct platform_driver fsl_easrc_driver = { -- 2.34.1