Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5790640imu; Tue, 13 Nov 2018 11:47:33 -0800 (PST) X-Google-Smtp-Source: AJdET5ecjuI93jNrh3AHMbQ31jRfqdyOPCZHFKZeDdoR1VB+S+/5ByXLL9FutsRz67prtXJoN12T X-Received: by 2002:a17:902:3084:: with SMTP id v4-v6mr6278556plb.326.1542138453737; Tue, 13 Nov 2018 11:47:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542138453; cv=none; d=google.com; s=arc-20160816; b=ah6QwhGBisQRktPVikRSu0IVVq2qb8kcdRWY+QigycgQOZVm3V+FkTkuxSgM7JMjnN Ajy4JKGPlLfUbFwSDYmRioteF9fleKOnOi6sIVz4YE0l2TAH0x7a49aSMDAxxjvMHxyn GS9lWM6GzHF6xKiRJM74Im4dXgzWRJdhGyyLn61e1Zvd3k/BANZX4jIeEjhhZuqU3PqZ 2SzJXeqVkOg6EHtEGPx3N1rLuebaj05ASIkPsVPIPVB7kI4sKoCPrTBzTJHQU8lz6znN tjkDibDwCXevtlc/sjaG6hflumFNho+/x8sRVcVDJnkE/NcKbzCgv4hVSbHqcK4j1ad5 m3jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:in-reply-to:subject:cc:to :from:dkim-signature; bh=SGOZscAVPVNRhLtT/WQE7eJ9jIA+uflAtnu7GXLShtc=; b=k7EzDVRgrFqxE28FEwIy6xtESbm9nLBWY+05FfPKdvJfGsx4Vx8QmI5E/0JIe0u45+ /UiZOMcQQCucLLSfZaOPL0ax7xtCbXeh6YFakzPE6TxfzoYPlLJMKsdyZFyl2nns6Ggm rD8e4iX7X5tWtud7zypltCPDr7Q0Ja9+X9tkswkbBhf6PVoJqc2Hb17n2nCZyWETFgA3 kcXte94dV66OnU3KDEZEhHlMLTfo+ZDD4/U7AzUuDCzZQ4W8B23uhgTzJrFLov2KcRas y3TdOi488yT6URPA6JO8TVnIX4PcwsyyYf54fHFSPFGg6BgsGjeFTiilpH1rUvVeHVwz mphg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=Os20ckI8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f22si11235199pgm.81.2018.11.13.11.47.18; Tue, 13 Nov 2018 11:47:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=Os20ckI8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728815AbeKNFpP (ORCPT + 99 others); Wed, 14 Nov 2018 00:45:15 -0500 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:50486 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728349AbeKNFpP (ORCPT ); Wed, 14 Nov 2018 00:45:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=SGOZscAVPVNRhLtT/WQE7eJ9jIA+uflAtnu7GXLShtc=; b=Os20ckI8uekU MqRDfG5quuPyuBnf7+yGnxL6SFE+DNGtHR6CpVlOrXT/7EqTsrp2xb+ZJeZ2acd1P0oIGbAGh4BLy 56TLpMqORoBYnnKsBJHayFoFvMplHe3yjIMgJp2zYYCZNgerNlSUXVskrIq1kyVBPkQwou62w9bNs Rfhz8=; Received: from [64.114.255.97] (helo=finisterre.ee.mobilebroadband) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gMecw-0002VI-8e; Tue, 13 Nov 2018 19:45:34 +0000 Received: by finisterre.ee.mobilebroadband (Postfix, from userid 1000) id 71603440078; Tue, 13 Nov 2018 19:45:28 +0000 (GMT) From: Mark Brown To: Vijendar Mukunda Cc: Maruthi Bayyavarapu , Ravulapati Vishnu vardhan Rao , Vijendar Mukunda , Mark Brown , "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER, MANAGEM..." , Maruthi Bayyavarapu , open list , Takashi Iwai , Liam Girdwood , Vishnuvardhanrao.Ravulapati@amd.com, Mark Brown , Alexander.Deucher@amd.com, alsa-devel@alsa-project.org Subject: Applied "ASoC: amd: add acp3x system resume pm op" to the asoc tree In-Reply-To: <1542000903-19020-11-git-send-email-Vijendar.Mukunda@amd.com> Message-Id: <20181113194528.71603440078@finisterre.ee.mobilebroadband> Date: Tue, 13 Nov 2018 19:45:28 +0000 (GMT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch ASoC: amd: add acp3x system resume pm op has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark From 8de1b5ed03370e46bf9f5b425e3f260dac3bc336 Mon Sep 17 00:00:00 2001 From: Vijendar Mukunda Date: Mon, 12 Nov 2018 11:05:01 +0530 Subject: [PATCH] ASoC: amd: add acp3x system resume pm op When system wide suspend happens, ACP will be powered off. When system resumes, all the runtime configuration data for ACP needs to be programmed again. Added 'resume'pm call back to ACP pm ops. Signed-off-by: Maruthi Bayyavarapu Tested-by: Ravulapati Vishnu vardhan Rao Signed-off-by: Vijendar Mukunda Signed-off-by: Mark Brown --- sound/soc/amd/raven/acp3x-pcm-dma.c | 46 +++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/sound/soc/amd/raven/acp3x-pcm-dma.c b/sound/soc/amd/raven/acp3x-pcm-dma.c index 710c5c5ae625..2e61cef00f41 100644 --- a/sound/soc/amd/raven/acp3x-pcm-dma.c +++ b/sound/soc/amd/raven/acp3x-pcm-dma.c @@ -690,6 +690,51 @@ static int acp3x_audio_remove(struct platform_device *pdev) return 0; } +static int acp3x_resume(struct device *dev) +{ + int status; + u32 val; + struct i2s_dev_data *adata = dev_get_drvdata(dev); + + status = acp3x_init(adata->acp3x_base); + if (status) + return -ENODEV; + + if (adata->play_stream && adata->play_stream->runtime) { + struct i2s_stream_instance *rtd = + adata->play_stream->runtime->private_data; + config_acp3x_dma(rtd, SNDRV_PCM_STREAM_PLAYBACK); + rv_writel((rtd->xfer_resolution << 3), + rtd->acp3x_base + mmACP_BTTDM_ITER); + if (adata->tdm_mode == true) { + rv_writel(adata->tdm_fmt, adata->acp3x_base + + mmACP_BTTDM_TXFRMT); + val = rv_readl(adata->acp3x_base + mmACP_BTTDM_ITER); + rv_writel((val | 0x2), adata->acp3x_base + + mmACP_BTTDM_ITER); + } + } + + if (adata->capture_stream && adata->capture_stream->runtime) { + struct i2s_stream_instance *rtd = + adata->capture_stream->runtime->private_data; + config_acp3x_dma(rtd, SNDRV_PCM_STREAM_CAPTURE); + rv_writel((rtd->xfer_resolution << 3), + rtd->acp3x_base + mmACP_BTTDM_IRER); + if (adata->tdm_mode == true) { + rv_writel(adata->tdm_fmt, adata->acp3x_base + + mmACP_BTTDM_RXFRMT); + val = rv_readl(adata->acp3x_base + mmACP_BTTDM_IRER); + rv_writel((val | 0x2), adata->acp3x_base + + mmACP_BTTDM_IRER); + } + } + + rv_writel(1, adata->acp3x_base + mmACP_EXTERNAL_INTR_ENB); + return 0; +} + + static int acp3x_pcm_runtime_suspend(struct device *dev) { int status; @@ -721,6 +766,7 @@ static int acp3x_pcm_runtime_resume(struct device *dev) static const struct dev_pm_ops acp3x_pm_ops = { .runtime_suspend = acp3x_pcm_runtime_suspend, .runtime_resume = acp3x_pcm_runtime_resume, + .resume = acp3x_resume, }; static struct platform_driver acp3x_dma_driver = { -- 2.19.1