From patchwork Mon Nov 12 05:35:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 10678133 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F147514BA for ; Mon, 12 Nov 2018 05:33:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DFA3827F60 for ; Mon, 12 Nov 2018 05:33:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D147827FA9; Mon, 12 Nov 2018 05:33:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1442B27F60 for ; Mon, 12 Nov 2018 05:33:51 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id DDF762679BF; Mon, 12 Nov 2018 06:33:49 +0100 (CET) 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 C85F52679BF; Mon, 12 Nov 2018 06:33:47 +0100 (CET) Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-eopbgr790087.outbound.protection.outlook.com [40.107.79.87]) by alsa0.perex.cz (Postfix) with ESMTP id 9DF972677E4 for ; Mon, 12 Nov 2018 06:33:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CCAO4ZUf6UeO/NWbRWAidAwihnT8i1sbrPmRcJyIqbk=; b=MrTxHoXqQ2DwCru5esFif7QKnZAkM4krpyCySOSAyx1aWRrGJ8NQfyS26C+lea0jFkN1hX0Icn0PZ91YWWtCNRYoS16QX2rdCXDcZjVPWui2zyzHHfRhVOuq2EGI1ZuFksRhSh6hDjDV+Eth3UUQC4E8K2gJNfd099Hfm0xoqK4= Received: from BN6PR12CA0025.namprd12.prod.outlook.com (2603:10b6:405:70::11) by BLUPR12MB0417.namprd12.prod.outlook.com (2a01:111:e400:516a::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.29; Mon, 12 Nov 2018 05:33:42 +0000 Received: from CO1NAM03FT040.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::201) by BN6PR12CA0025.outlook.office365.com (2603:10b6:405:70::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1294.26 via Frontend Transport; Mon, 12 Nov 2018 05:33:41 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV01.amd.com (165.204.84.17) by CO1NAM03FT040.mail.protection.outlook.com (10.152.81.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1339.10 via Frontend Transport; Mon, 12 Nov 2018 05:33:41 +0000 Received: from LinuxHost.amd.com (10.34.1.3) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server id 14.3.389.1; Sun, 11 Nov 2018 23:33:39 -0600 From: Vijendar Mukunda To: Date: Mon, 12 Nov 2018 11:05:01 +0530 Message-ID: <1542000903-19020-11-git-send-email-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1542000903-19020-1-git-send-email-Vijendar.Mukunda@amd.com> References: <1542000903-19020-1-git-send-email-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(979002)(136003)(376002)(346002)(39860400002)(396003)(2980300002)(428003)(199004)(189003)(336012)(446003)(2616005)(8676002)(11346002)(126002)(476003)(8936002)(86362001)(1671002)(426003)(305945005)(81166006)(486006)(186003)(81156014)(50226002)(68736007)(106466001)(97736004)(53416004)(105586002)(36756003)(51416003)(109986005)(53936002)(5660300001)(76176011)(50466002)(77096007)(7696005)(48376002)(47776003)(54906003)(14444005)(16586007)(39060400002)(72206003)(2906002)(104016004)(316002)(356004)(6666004)(26005)(478600001)(4326008)(42413003)(266003)(32563001)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR12MB0417; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM03FT040; 1:6WbYB/cqCf7B1X0yO2UFUCNc/cNd7oiIIbOnPN3klRDgpoQ7OEJZ3sMhPmwCaNOzN0stOzw/0BGnsVScS5qaUx81s5kQ/79Zg6u6UaZIyWOc/833uCThBZU11nZC/YTS X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8f1c7e2e-2206-44ed-62b9-08d6486067c3 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390040)(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060); SRVR:BLUPR12MB0417; X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0417; 3:WylATZjVpMd7pJPw2n3igrvHHgb4He3AB8F4ATFME6zmWG9MCd4kROzOrhpgVWBYfil0T2yZAxMROTTsln+pd5+qcbKzGmFVoC3DO6n8YX50+NWKdnRj5dbJa7WpYKzKddk6B+6s+ucF8eYduTbR2DpGcRJfM2DzpZfqRlDbUnvm1IRPpbasuOqgblaOMqjQXHmcBEqCgFnqrc4GhKQxSfnTd3CbAyHXos2wcQaIzAo6eKyMrYG9FXZ25R9FZABe0c1cr3aB19tjpyc5huZEGcWQXXc4caACTTV74FGRbBYChzsEnBoVqsaOCVbeKM6/DM1a6kDtBpcEpiyH+dDic0N3ya1/zIVDONnWgfvw/dE=; 25:lg17G+iGeJbpOeUSQ5kS9u6wRXrR2z8V3X8A+mviXe2Hl6yoCkSTEU3xKSrQDtfkJNlxrM0E99BIvYohGyhpLk8GAPcxnWWJaHeJB/Mzf0hcXjzlmrt3yeksDlHdudKF8ALDUU4hFU8iuB7pbSGptKNdoD+hb0H9sQo8WLUzT3LNjYmS79PFBbjtYGXMsbWX2aUZBEIYuscrusfHHn/zTF6SugooEk38mgjoK2Y6tZjA0c7lAD7hOQw8yINMEovM+kYchdymzf+XcTjtsKDPhGledKqFB3U36PwlhHIU10EadF1iYdEVQ+b2yniup1cGr3UUlQYWeoQh1xLk1J/WkcH22HI9BeDWs7+LARR8Agw= X-MS-TrafficTypeDiagnostic: BLUPR12MB0417: X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0417; 31:UT0Y2WwXMvxvslzsbYi19dxv7Nd8l7aXShPaeKO8A6fPZoHgmX1Qccq6CZ12QLaskICQSke5lwt4zvgaWXz2Htb+k6jFycQa/15G7GrpG3OULr2t2HqsTmjaqQ39+unuVflVtP2Zg0zuPTC6eyUjv/w8m7lsc01o+wtGiOWj6MYTwpZgQG4pLLb4cE6NcXWucb6DKzF/bQdEZSAZyGw4zdXQtTQhxglYZ7PAu+OYubA=; 20:rcHQaHzswtBGy7eOPywbSMO9C0zU7rpHqDlUlvY8hFvd1QHrBgw36axYYZdaqZ6HYAA7vLxklrhewZmwUqlfrw1VEkcW7XHVuBV2HTYt6Na2D5eyn0NXvs/cigQG0sSYe1s1BF+U5iYuaQca/dcO4l3tJU/Ey3HPpyr+ZohGvOtrbgysyA3iqB5qf/vTy0sdpZKWG4IULilUaCHrTCoAE+3pPVTXF1cQEruQybFb6ajiHItLtYwcJ4WFm5vAuCXeijbisZPBb4cKtzTz/gWBLu0hwwVZwGDz2MKVTKOqe5VZhNmlv5z4Dx8mHoCTm8WYKTWKMd4QCjw7C6tBtsKLSGOz2ffPSEbZQmnm1a1rZNM+4b6mfd6nLNlPHTOGAxKucORSbKGxHhVJKP43QvVW7z16Y6DggRg42sWnlVR3J66/tcBRzCh8f9VWDqBwVuCJP3jDPW2VbVJYSd9H6tZ8STVapDXpIZ8OdeH0afil/q70ZcENukXRXYdDpqcyl220 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3231382)(944501410)(52105112)(3002001)(93006095)(93003095)(6055026)(148016)(149066)(150057)(6041310)(20161123558120)(20161123562045)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095); SRVR:BLUPR12MB0417; BCL:0; PCL:0; RULEID:; SRVR:BLUPR12MB0417; X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0417; 4:bqj4reqaw3DqXlWtETlIcF9r+rghh0Zu74PoUoCW4xf/Xd6t2Uh/dFXuVVGuhZoJyukU127/Ov1K78nfVDZ3V7cmNtR44dvrbQB/RO14G8FJrg9cP6Rgpgt4qlFAbk4DPJRxqYg/+43hF+jkxDSJTxb96DovVqvj19suwRbAXa0LK5yUgL+LJzWTbQErQQWL3Gq3tHVtQrELDv9IjUetAQefdkIUNSlh58tUhr4misW2tXamg2lupWSgbtaKVRoufscWDt8/CkxMkVOI/fMged0oHlmObkUba/mab9Vw1/FLOe3jsCpfinUiOTwhhiPq X-Forefront-PRVS: 0854128AF0 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR12MB0417; 23:6+w6XTQiQxPd7VlzvBXfz9Nyh51KH16pSlVUe2SMK?= R7DfeAdN6zly9x7jwkloendduYBLYOyzIEvzgbDCywMTKe8P55r7E7xGQzUgX97eqUOW52gS7zqaUlu5LaCJIa2U5i3odBwAioZkiUPr4QedG75BecWDud9E6yi5XVWHt/B9IxzjdMInxnj6XjYtNLaLzB7h836V4uKnlYwSqHeS3OFHuOoMkO3F5t+gcNxAX1Ke2y7CE8l+SFN0Lw17ed+m01oVRwqJwgiORFfIk64+i3RPI+34v5aLwo72x9IIeJc+ZR3T2chEb2pEgVKXXzvNL4BdoY3DRkbt0XtlTLNjXRyYJgI9DJrkWu2jxxbnCPKhicCql8i+vN4+zi0mXU5MhIoH0LgbFDhHCr1g0iz3gjzSglNA+1TfOshuFAAnLixs8VWe+ffSXakVH07R1eQbFLoKV0STVkcdoDK9ayeyyzPoIjQA3j0bZAXaT2iy7A11SxKiAQEI3R8AHebQZomRLy06ed/wOh3FHMe6EJvY57SQGNns9bUfWjH+rivhfYYlQgEmOcuVejP+0yxJi5jlfbh4tRULdRAzBhdURH6JDybC/FEcHoPVnW/z6Rp6cq/jmxVhf8dBYt7iQgmUuNTxYakjGYRnctRxhiA+TJ5IN4LmdLbmSyswgQIOHbKHIILQowuJhtDGCcbvHzhPPvAqwA2qr1ZdwASnl/Zs8CXeisMiNZjTPfokj0moC50G49jNeAgjASV7/d3zPpFR9xrfIDAxRIumh485aX3HNwoKRrQhIRBQ3flo+f35NKvmDc2jR8y/n6Edtd+wJQki1nMtwzUg2eYJCqSGPpd6XJ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jHMwVO4s5anwPcBwkz1TcUsOCX4YatkHKitB7dmDexBeN08Oz3tZUFLE/FcVboeGaGmnvX5/iLDTuqdjwhQjrsUWutRFivV6BYp8bDtd4TxP13bOMskgbkBfPMLr9MGJSmeJU+jc/xzR80LRFHa5s29p5DqOGGTFolZ/wzhEqsDVzFLD007P6YuvlZxzfbfvyoKAJZ9TmYzl4CJ9l0zS+nMCFgrCHuecyYJCNju6aCuddxMdaPxE9hA7fJd5ygYXmS69HXFeEAr+qrhhkoe30lfrunIeP++fvmQ3MOCBV37jUCYl+yhOeniwP48j4P7fGGLQf818iALEc7aWCgt2vlUX1FmdfwFEgKHnmw==; 5:Avn4EVKMqY2H5y5MSQsnFcFnceGPV6sPkguBKDUyiuld4VP4VKV+dowmacKnY7473QwwCQjWf/srGs1UN+0desuk2DsVvdyixYeAW1lKBiH/Wvq/BP5XYlz8WkuPF7lYKZxO7GNmLsK1p0kjcM8EzXs1gXVGfE18cQvVbq8gNwM=; 7:dR4h5ivqp2h4yOi9O/PXb3cnD+Kq963NHNBpncqfTB1OlaL7/93sq9s1eZYYjkXpL2gpU7SqTOYztAhu8icNoAlX7nHKCWqDytA9o0xJLID2Q4PM0ow5FF8Feq6kmQt9+MmBOoDEB/IGQqYh/4q8Bg== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0417; 20:D5a4FgpGZZhm6T/EoXnGK5+KJVOlweQcVEZlnev/TANKzzueNMyXBL5gU241YzYEg138jYAy0OG4Qdbkq/iqsoUjNH3WQONX6tWR3n5mkjNVbS4aYPeN5+JUMsZAVp9ULUzu/45GhYNTsqhdSBouWj3PZmoax2oRdNHUthQ1mhXikWovWPHOpo2PXYX1W/QB7tIQZ64FIkRysN7r+GEDrOgrcVet09yRhd1XL3/L0uLwtvodxjrsluGf7GB6orO1 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Nov 2018 05:33:41.0984 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8f1c7e2e-2206-44ed-62b9-08d6486067c3 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXCHOV01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR12MB0417 Cc: "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , Maruthi Bayyavarapu , open list , Takashi Iwai , Liam Girdwood , Vishnuvardhanrao.Ravulapati@amd.com, Mark Brown , Vijendar Mukunda , Alexander.Deucher@amd.com Subject: [alsa-devel] [PATCH 10/11] ASoC: amd: add acp3x system resume pm op 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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 710c5c5..2e61cef 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 = {