From patchwork Thu Aug 6 14:25:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 6960371 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 503E39F38B for ; Thu, 6 Aug 2015 14:31:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7B8E4206AC for ; Thu, 6 Aug 2015 14:31:57 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 4C8F720690 for ; Thu, 6 Aug 2015 14:31:56 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 6342A2619FB; Thu, 6 Aug 2015 16:31:55 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id A2D8E2606C1; Thu, 6 Aug 2015 16:26:26 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id EDC762606B8; Thu, 6 Aug 2015 16:26:24 +0200 (CEST) Received: from mail-yk0-f176.google.com (mail-yk0-f176.google.com [209.85.160.176]) by alsa0.perex.cz (Postfix) with ESMTP id 615302605CB for ; Thu, 6 Aug 2015 16:25:29 +0200 (CEST) Received: by ykoo205 with SMTP id o205so63594755yko.0 for ; Thu, 06 Aug 2015 07:25:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=QbeQO2E3HiBLD7h5oXNmHITES4/v+m4a+9/M8hxG6Dw=; b=Pk+/mLohUGmOTuev1lg9hPjgiD0CETh97nBsNDaC6qhQF9osWf+KmgJL6Xw2rVESIx ln2PuOrzDikvNgnKtTcnHeccZ2eD6u96jZRBdEHxy4WpLgUn7Mwg8dCbnHxDGjVYzo2x higTBP0C7cM98DpUgf94zRvwLQm1Mo9N1hQk4aYBZ1y1/ADi8950Cpg7bkM1gzOVgjtZ urdbbEmiSKNzequu7VHv5ss14m9AlMTNXEyKzckw8u+4NNm7kNG7or/fEiHB7WW9lRtH mJ6otzVAO05f0s2JmxQyPoZ3vlbJ3/R54sMHNq/PTDQvcc2IC3vkntXQEXtBimbLJd8S 5YEA== X-Received: by 10.129.117.196 with SMTP id q187mr1975159ywc.15.1438871128769; Thu, 06 Aug 2015 07:25:28 -0700 (PDT) Received: from localhost.localdomain (static-74-96-105-49.washdc.fios.verizon.net. [74.96.105.49]) by smtp.gmail.com with ESMTPSA id k128sm6182789ywe.11.2015.08.06.07.25.27 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Aug 2015 07:25:28 -0700 (PDT) From: Alex Deucher X-Google-Original-From: Alex Deucher To: broonie@kernel.org, airlied@gmail.com, dri-devel@lists.freedesktop.org, alsa-devel@alsa-project.org Date: Thu, 6 Aug 2015 10:25:11 -0400 Message-Id: <1438871112-25946-11-git-send-email-alexander.deucher@amd.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1438871112-25946-1-git-send-email-alexander.deucher@amd.com> References: <1438871112-25946-1-git-send-email-alexander.deucher@amd.com> Cc: tiwai@suse.de, Maruthi Srinivas Bayyavarapu , lgirdwood@gmail.com Subject: [alsa-devel] [PATCH 11/12] ASoC: AMD: add suspend/resume for ACP PCM driver X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Maruthi Srinivas Bayyavarapu Added suspend/resume functionality for AMD ACP ASoC PCM driver. Enabled them in the ASoC machine driver Signed-off-by: Maruthi Bayyavarapu Reviewed-by: Alex Deucher Reviewed-by: Murali Krishna Vemuri --- sound/soc/amd/acp-pcm-dma.c | 31 +++++++++++++++++++++++++++++++ sound/soc/amd/acp-rt286.c | 1 - 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c index 0f58957..db09b77 100644 --- a/sound/soc/amd/acp-pcm-dma.c +++ b/sound/soc/amd/acp-pcm-dma.c @@ -625,11 +625,42 @@ static int acp_amdsoc_remove(struct amd_gnb_bus_dev *adev) return 0; } +static int acp_pcm_suspend(struct device *dev) +{ + return 0; +} + +static int acp_pcm_resume(struct device *dev) +{ + struct snd_pcm_substream *substream; + struct snd_pcm_runtime *runtime; + struct audio_substream_data *rtd; + + struct audio_drv_data *irq_data = + (struct audio_drv_data *)dev_get_drvdata(dev); + + substream = irq_data->play_stream; + runtime = substream->runtime; + rtd = runtime->private_data; + + irq_data->acp_dev->config_i2s(irq_data->acp_dev, rtd->i2s_config); + irq_data->acp_dev->config_dma(irq_data->acp_dev, rtd->dma_config); + + return 0; +} + +static const struct dev_pm_ops acp_pm_ops = { + SET_SYSTEM_SLEEP_PM_OPS(acp_pcm_suspend, acp_pcm_resume) +}; + static struct amd_gnb_bus_driver acp_dma_driver = { .name = "acp-pcm-driver", .ip = AMD_GNB_IP_ACP_PCM, .probe = acp_amdsoc_probe, .remove = acp_amdsoc_remove, + .driver = { + .pm = &acp_pm_ops, + }, }; static int __init amdsoc_bus_acp_dma_driver_init(void) diff --git a/sound/soc/amd/acp-rt286.c b/sound/soc/amd/acp-rt286.c index 7d4bdf9..8be9236 100644 --- a/sound/soc/amd/acp-rt286.c +++ b/sound/soc/amd/acp-rt286.c @@ -129,7 +129,6 @@ static struct snd_soc_dai_link carrizo_dai_rt286 = { .codec_name = "rt286.3-001c", .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM, - .ignore_suspend = 1, .ops = &carrizo_rt286_ops, .init = carrizo_init, };