From patchwork Mon Nov 12 05:35:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 10678131 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 834FC14E2 for ; Mon, 12 Nov 2018 05:33:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6EECC27F60 for ; Mon, 12 Nov 2018 05:33:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6111527FA9; Mon, 12 Nov 2018 05:33:37 +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 D2AF327F60 for ; Mon, 12 Nov 2018 05:33:35 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 92EBA267A89; Mon, 12 Nov 2018 06:33:34 +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 D3E81267A8C; Mon, 12 Nov 2018 06:33:32 +0100 (CET) Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-eopbgr790055.outbound.protection.outlook.com [40.107.79.55]) by alsa0.perex.cz (Postfix) with ESMTP id 52D27267A67 for ; Mon, 12 Nov 2018 06:33:30 +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=2o3gh6c/gtUi6dtloy0BDJpUedMdwvUWYX2k/zUMJrk=; b=DZLwEeTJN3Yb/x/Nd8tygLA4p/OVSxKMqoOly5eVNU3ryk8xMshum0fP08UdGXBWC99MOjyLnngQvWwBNBL1ZamBPQQaY8EIwKrF47szoPyTZAV8IvV2F48/+iUqQJRro66G5v0lJNMg9ILF+b5l0Uj3EB8C5y3Q5sM3oJdBETo= Received: from MWHPR12CA0062.namprd12.prod.outlook.com (2603:10b6:300:103::24) by SN1PR12MB0623.namprd12.prod.outlook.com (2a01:111:e400:c428::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.27; Mon, 12 Nov 2018 05:33:27 +0000 Received: from CO1NAM03FT021.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::204) by MWHPR12CA0062.outlook.office365.com (2603:10b6:300:103::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1294.20 via Frontend Transport; Mon, 12 Nov 2018 05:33:27 +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 CO1NAM03FT021.mail.protection.outlook.com (10.152.80.180) 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:26 +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:24 -0600 From: Vijendar Mukunda To: Date: Mon, 12 Nov 2018 11:05:00 +0530 Message-ID: <1542000903-19020-10-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)(396003)(346002)(39860400002)(376002)(136003)(2980300002)(428003)(189003)(199004)(336012)(72206003)(2906002)(53416004)(305945005)(54906003)(316002)(77096007)(39060400002)(7696005)(26005)(51416003)(426003)(47776003)(4326008)(76176011)(14444005)(186003)(8676002)(53936002)(105586002)(16586007)(5660300001)(478600001)(97736004)(486006)(476003)(356004)(6666004)(11346002)(8936002)(50466002)(446003)(81156014)(86362001)(81166006)(48376002)(36756003)(106466001)(109986005)(68736007)(2616005)(50226002)(1671002)(104016004)(126002)(42413003)(266003)(32563001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0623; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM03FT021; 1:45Y4ClKIN2DTHWobpsggCkbVnAFYPfarZVMRxFSg1jfo3RxCtnmZXO4fub48Ei/KKj7UOqCARSi8ZYE9aZRHUsA6tBgJvHe0WYRMCubxKuFURR144FgxJAqwKC8hXNQT X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8a3103d9-a0c2-480f-e527-08d648605f12 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390040)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060); SRVR:SN1PR12MB0623; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0623; 3:buFRXvl8Sv72XcwowT0w3XeSiAk9qvgVh+llYcF3OeaYhUumOadf2uIr5TVrv9mQzUwJQhkfKWmynJkcS6JXWZF3xqNXRhbP3/+OgpGXLghYy8cU6lkZy+PmJIiWiA8/g8B/JtehSPxlsw+/B9f7fphR7NI1GI/SXOJ93q3nvzVypm1AYlA26l6/Hz27wrC92EDGB25/AQJtZTSTlitPtKjKzmlLoW5lrnlGdIzL1zcQnQyALR+xBrBV0JxFE80qXSgELhSZbKPpgdhh86FLkstetUG14sKM3k6opnKpwct0+8giJs8LBf3SzX1ouu2JQ9LMx0o44dV9vfLTlfr3hKTs/alGtN7q1MzNorO/fp8=; 25:oTEcNplNLoaS7EvnbiomwJbEdgS9F1KUu4wlSUBT6qHL3fX6C1ykmdrA/O6V4PU9rn6AXBaM6cdPPwRXZR19rKYahMo9nOvfLzCczd37S4gdL/sW7wr5L2/Xl8iutQGflQ0FTV98mXXBkkmW9VZwllr761b9xenenLrLHUbmzoJJ3cx3ISvoUSG+TcBe9ekHNNM35ZthAeR4BOgdDSNKNpy2TA1Fzk2mtVGS04WYdgRgou1dSbRYSIQ+7qRQa1wgpwe2IzdfNMe2gYSGCejBPoQuocHvBRgkw0so/vtmZUErQcTTg/NhvXfGlo2AJbhdqwobH4bNYo8xjvFjgafi6fnZLMa+XhqONCLGs2YmIMs= X-MS-TrafficTypeDiagnostic: SN1PR12MB0623: X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0623; 31:IQnYvT2qRg496agFxjqFrrKJZUT1DiFGH1owh1RUQffihiap7GL853MqCC4nAFWxWDIKe+KF6j6Mae4SNVaYbKPIiyPoAkhCzE1mjusshkRz2z5I1S/S3XHudem4E5T0jnugbEWmakqdujvhIB0mImcyAQvanFdH3f87jSatcTBdxRUV+AMXJ4Zz1AUhftfB5uaP/fHBzTQtT7hKuuSJw5yM2FA8/oyRT2anur1SbIs=; 20:+PXAqgzJwOiLF3Z1MNvmHpf+5sR7x1AF3GQNVrJENKUjVZZ3VQrjINy+SQgejox5EE9hw5Wmw1B3F/55wZKWjkaP7MNUsdalUt0yZ2Q8teKo4eEnm5isBC2dw/gzlGH2G40sCuYAsWZmZY25Tr42DTDWbpZcerVmo6VTC4cPX2E3lS+gMSbWZC6KW7RKusXewzeQYJk/kLwlaT2CupchytqfENnDzgLdyOZ90Ec5EI9zvkAApUjn1XS5M/ys1ptkNDB+Bqi4TUOBwOkbs02080Wm5g/ZbhSrUVq6xKUOq5p3BcGbbZoASc5SWx+AVCEL6QJ6ijrOmRj8shMjXiHmfDcQuZeWdH6uroDi5Ljgm4ieCt2bvDfV9topRWt5Cq2QjKmWLHNEPxZ2vKnufZWEShT0hWcz3Dn15jch4n8eqTqzFf5UhsTrDF7uJ9Zg7Dh5hQSCmP1sPcoHlT6V/9pgFKDOlFCmjFT478awwtk1FsxH8e5pR458xEaq4otMSiDE 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)(93006095)(93003095)(3231402)(944501410)(52105112)(10201501046)(3002001)(6055026)(148016)(149066)(150057)(6041310)(20161123558120)(20161123562045)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095); SRVR:SN1PR12MB0623; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB0623; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0623; 4:OOAnt43sG2lEQVElt5QgafLFAu6i0WOVKjJDBkPGST0a3Yhh365cBUQeaag2TwTOshj3j8xoIMEBK0Eo618k+xE8qyY28UWgaXGVZp3NuhyEs2PddfA6QHp/JXYgJoU/llsrHQuXUxfdy8TVZEJqZqxwuU1ARqIS2MFi0wm2IlL8W3tq2Rgyzb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AoF/LIMT0yg8rn/D2SjX90oWR4gBuOmYouiWJE8OwOC7ieL0pv+/E7MHg+CLRh38djnVtXNkpsrkxw7Ey3OT29Wfg1e5TuV35yZfkhIZP1slhcpioCURlHTv4sFLKmv3W+vOW42T3S/VhHwz5B9qCpPcJx2rO874evxZ1ZX0jC8vcKlWRMabqeLFA3fk6yWMBGsrfguJcDh585DR+Xqx/3pxYdXBjWAz4q4+C8z7nng==; 5:MRZw7Kkyl7tP3+Kdu/NW0JGpsM8KjZZvEAde6t3sGu4x9xOeOfVfchf20agqWyztF4EHwnS2z19U06/RkYbU6xAG5JsdJ7WrPppH8PGvEHkirbVWopn11KaFUxEnsb5N73XpduetYIiOe8dCTmg9QK2XLe47jHz4dq6RiQBI1EE=; 7:ly4vruXfVKojEISETbyATbl/c3LgR16RTv4QuBBaM2Tn2pc+PYHyqiu1BN0VQJ7cCfk0YWAof2x/qaRF9QLw0VlCBysvdQMkK1N5byXEAhQPRmwn5994Q6nKp1G4ssiOzRBwrIafmtk9oBQnJ/IlpQ== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0623; 20:k4nsJe1fLx5/cqkeN80ZonFq/jL/ZPZjihWw1xMX5qjujUEkPfr436oWXHuGkPdT8fQEGqKNrDGt4U86PUGUz6Q86JRcGeUi7N3fzav5MI1jO8teCdo2mFep55qUpAdv2WiET4LervUeCy0oM4Xg61j+0EDfKnrdxK/MUJUHKtjCXs5Qbdi81LkoBUx1PPD3+ewGorMrpbSAzq0gLhMq30k26cm34xgzMyQmxP6FR/IvmZ00DiE6PrYSYZvinqXs X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Nov 2018 05:33:26.5356 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8a3103d9-a0c2-480f-e527-08d648605f12 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: SN1PR12MB0623 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 09/11] ASoC: amd: add acp3x runtime pm ops 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 Added runtime PM operations for ACP3x PCM platform device. Signed-off-by: Maruthi Bayyavarapu Tested-by: Ravulapati Vishnu vardhan Rao Signed-off-by: Vijendar Mukunda --- sound/soc/amd/raven/acp3x-pcm-dma.c | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/sound/soc/amd/raven/acp3x-pcm-dma.c b/sound/soc/amd/raven/acp3x-pcm-dma.c index 15a5f3b..710c5c5 100644 --- a/sound/soc/amd/raven/acp3x-pcm-dma.c +++ b/sound/soc/amd/raven/acp3x-pcm-dma.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -660,6 +661,9 @@ static int acp3x_audio_probe(struct platform_device *pdev) goto dev_err; } + pm_runtime_set_autosuspend_delay(&pdev->dev, 10000); + pm_runtime_use_autosuspend(&pdev->dev); + pm_runtime_enable(&pdev->dev); return 0; dev_err: status = acp3x_deinit(adata->acp3x_base); @@ -682,14 +686,49 @@ static int acp3x_audio_remove(struct platform_device *pdev) else dev_info(&pdev->dev, "ACP de-initialized\n"); + pm_runtime_disable(&pdev->dev); return 0; } +static int acp3x_pcm_runtime_suspend(struct device *dev) +{ + int status; + struct i2s_dev_data *adata = dev_get_drvdata(dev); + + status = acp3x_deinit(adata->acp3x_base); + if (status) + dev_err(dev, "ACP de-init failed\n"); + else + dev_info(dev, "ACP de-initialized\n"); + + rv_writel(0, adata->acp3x_base + mmACP_EXTERNAL_INTR_ENB); + + return 0; +} + +static int acp3x_pcm_runtime_resume(struct device *dev) +{ + int status; + struct i2s_dev_data *adata = dev_get_drvdata(dev); + + status = acp3x_init(adata->acp3x_base); + if (status) + return -ENODEV; + rv_writel(1, adata->acp3x_base + mmACP_EXTERNAL_INTR_ENB); + return 0; +} + +static const struct dev_pm_ops acp3x_pm_ops = { + .runtime_suspend = acp3x_pcm_runtime_suspend, + .runtime_resume = acp3x_pcm_runtime_resume, +}; + static struct platform_driver acp3x_dma_driver = { .probe = acp3x_audio_probe, .remove = acp3x_audio_remove, .driver = { .name = "acp3x_rv_i2s", + .pm = &acp3x_pm_ops, }, };