From patchwork Mon Nov 12 05:34:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijendar Mukunda X-Patchwork-Id: 10678123 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 22B9114E2 for ; Mon, 12 Nov 2018 05:32:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0DF1829E28 for ; Mon, 12 Nov 2018 05:32:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 01AF629E3A; Mon, 12 Nov 2018 05:32:32 +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 2AAB829E28 for ; Mon, 12 Nov 2018 05:32:32 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id ECFD1267877; Mon, 12 Nov 2018 06:32:30 +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 6AAF12679BF; Mon, 12 Nov 2018 06:32:28 +0100 (CET) Received: from NAM05-CO1-obe.outbound.protection.outlook.com (mail-eopbgr720045.outbound.protection.outlook.com [40.107.72.45]) by alsa0.perex.cz (Postfix) with ESMTP id 2B94C2677E4 for ; Mon, 12 Nov 2018 06:32:25 +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=PdQuaZEB8cz0gE4Syuq6MW7Gc1ACRDPOLc7fCkdv048=; b=ui44BHM7TT5WcJJlnSrh1JvkkLvOzDG1GdS6x96d2b5iF4RUytjYRoQpzxUvDheTglm9fkUsW8a9M7qC+pHggQSW0uVpy5lh7LHGhkKrAVN1T/HAY425+XdwAcvU/R/CgQ6g4OjYhS+6MHCrhMT5nhfHWxU/OOre1x3XQRBNEUM= Received: from MWHPR12CA0071.namprd12.prod.outlook.com (2603:10b6:300:103::33) by DM3PR12MB0746.namprd12.prod.outlook.com (2a01:111:e400:5984::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.23; Mon, 12 Nov 2018 05:32:23 +0000 Received: from CO1NAM03FT056.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::209) by MWHPR12CA0071.outlook.office365.com (2603:10b6:300:103::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1294.21 via Frontend Transport; Mon, 12 Nov 2018 05:32:23 +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 CO1NAM03FT056.mail.protection.outlook.com (10.152.81.144) 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:32:22 +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:32:20 -0600 From: Vijendar Mukunda To: Date: Mon, 12 Nov 2018 11:04:56 +0530 Message-ID: <1542000903-19020-6-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)(376002)(346002)(396003)(39860400002)(136003)(2980300002)(428003)(189003)(199004)(48376002)(4326008)(426003)(50466002)(14444005)(1671002)(77096007)(54906003)(50226002)(53416004)(104016004)(2616005)(186003)(68736007)(11346002)(26005)(336012)(47776003)(126002)(476003)(486006)(39060400002)(446003)(36756003)(305945005)(8936002)(53936002)(478600001)(16586007)(5660300001)(72206003)(106466001)(7696005)(8676002)(2906002)(6666004)(76176011)(109986005)(316002)(81166006)(51416003)(356004)(105586002)(81156014)(86362001)(97736004)(266003)(32563001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM3PR12MB0746; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM03FT056; 1:6DVMPJwdWrSaBKi1bXiKnVTfaQLKeYz48lSsOZR6x9hGDbwiQc/L1OBGq5tg7QGncW5PoShV99/jixQFXzyh0hgwHJoBCrOJJfoyNWdV561WpcvhHBuUlsgqxuthQ25P X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 78cdf4cc-db45-4d01-512d-08d648603923 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390040)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060); S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FxkxPUO3GcnuVgYKo=; 20:K96WvY1Ld68LVj+QKUdY6sTp8e7+u4+HiJeYE5Am/+ufR1KKfdzpygE8RFmE6BS8IMopmR6GhqvCMMwgC9d2hIZ6uFgJJgYqTUlYRcIOJl921VY2ZMEr+zX1JryNfuf49JcrOrckxGw7M9I+ZRF0h36xsryuwZ0xdOYKlecX7WjzDqzfOJZpg0bxJJbVYTbIkaEIg07rCdADJK63AoUqQp3i+XXe+qECfftn4051MRd4SyQZsp33B/1OJpYt8OV7ngBWch+6lYuZm8rOj69TbPtpgwtydISaUjL4Og1uVkl6+UkyIBz87hjLqHMhSd8vbRAnJRWN5f6a0eCi0tFpLAYks8xlTMXusEKuYDEsnR3nyVVhIyndSy4Tb3hAitBJ91Kcgn1bdkE+Hog2Pvq2oSS7vjq+MFtojDGwPygit7Zp/IifF6Nren3DvrUjvPEDSzzV6uuOehzGZLPaGRxc97miULXXBEFxaivq2Cw97b7JJd2ld4w4CeKRRWCrfD0O 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)(3231402)(944501410)(52105112)(93006095)(93003095)(3002001)(6055026)(148016)(149066)(150057)(6041310)(20161123564045)(20161123560045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(201708071742011)(7699051)(76991095); SRVR:DM3PR12MB0746; BCL:0; PCL:0; RULEID:; SRVR:DM3PR12MB0746; X-Microsoft-Exchange-Diagnostics: 1; DM3PR12MB0746; 4:YB/PcrSxmsNf1/oe+Xv7I/mRfQLbSp2XPb0wSYBMy167AGP9weN6vSAdVy7EQP32ez+wUFJGft8PUTlsADVRrkB0cps+usc4Jhi1N7b/26HvfNHN3wK1OcEWyV4Uz/3oydnA0PRbGqpnnFB0vPkwH3R/Qv3tqi3RiDTyJjd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2lK5lmou0+6jsc9upkAURa8ZVDWQpoa7JLKWNpBrIQkLhBMoZI6gkDzjzPbiMk+iK8H8Pc3W92vSg1wGEXdDVUDwTlMs8K8Pi9eoUOMRob8r06vZ9Fl/m61L34QcJwhligpTy2o/j+tmiK1Z0jo37FDHzzAezTdN1XKvrTs69cX8JvGMrwu81ORk/CwGoRlZJki8z0Cu968sNSVRqfmqJPX1mdDVA==; 5:b/iC1NeawILOnK399K6J8TCcwXUWyAy6iv1kXS588utcYzMD0vJemKBJtIy3rNsMTU5G0NjP6yp2VFEyoqAoNB+S9hKdfXmkSvBiptDCQiXJIKQScFVHjsRTYMowsdvrNjywuje1sbiiyOFMwmHdt+6DADkEYL6bIIn7aoONI80=; 7:/Yk5OtfrWnJGVrb5zVuyxUxYGLekRQMOUtNbBnZjigGomSwuvWlgt2xgCQj9x5c+atO9zBlSyYeLEncoJP+EZPuMOJr0T5lZqKjtdhc2gCruKRYkCYMEoBdpk6I96KtixtpVzs8dqBzNCQr4B3cL4A== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM3PR12MB0746; 20:TSsvFfuUj0iock4RmiVM70DH26NPDX0xoUGDbFetah0yUvSARz2zsw7lZTFGhOPHttn/kC5TVJJELyocDaOJGdY13C519YPSAIkI5LFIhW7EJ2i4t13IOrsdLEm51Xi3wgQfy579pU+9jR0nWW88CwehaoKrul2350W1PT7QF5lMlaL8914xCNNhB9Njj+NIn3AyaXbbz0V933LVEQeoD1i/mKm3xr0mIDWt51er8R+D4E4jF2dTrZcxS4YL5nXG X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Nov 2018 05:32:22.8429 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 78cdf4cc-db45-4d01-512d-08d648603923 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: DM3PR12MB0746 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 05/11] ASoC: amd: Interrupt handler changes for ACP3x DMA 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Whenever audio data equal to the I2S FIFO watermark level are produced/consumed, interrupt is generated. Acknowledge the interrupt. 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 3e806f7..94f915a 100644 --- a/sound/soc/amd/raven/acp3x-pcm-dma.c +++ b/sound/soc/amd/raven/acp3x-pcm-dma.c @@ -27,6 +27,7 @@ #define DRV_NAME "acp3x-i2s-audio" struct i2s_dev_data { + unsigned int i2s_irq; void __iomem *acp3x_base; struct snd_pcm_substream *play_stream; struct snd_pcm_substream *capture_stream; @@ -132,6 +133,38 @@ static int acp3x_deinit(void __iomem *acp3x_base) return 0; } +static irqreturn_t i2s_irq_handler(int irq, void *dev_id) +{ + u16 play_flag, cap_flag; + u32 val; + struct i2s_dev_data *rv_i2s_data = dev_id; + + if (!rv_i2s_data) + return IRQ_NONE; + + play_flag = 0; + cap_flag = 0; + val = rv_readl(rv_i2s_data->acp3x_base + mmACP_EXTERNAL_INTR_STAT); + if ((val & BIT(BT_TX_THRESHOLD)) && rv_i2s_data->play_stream) { + rv_writel(BIT(BT_TX_THRESHOLD), rv_i2s_data->acp3x_base + + mmACP_EXTERNAL_INTR_STAT); + snd_pcm_period_elapsed(rv_i2s_data->play_stream); + play_flag = 1; + } + + if ((val & BIT(BT_RX_THRESHOLD)) && rv_i2s_data->capture_stream) { + rv_writel(BIT(BT_RX_THRESHOLD), rv_i2s_data->acp3x_base + + mmACP_EXTERNAL_INTR_STAT); + snd_pcm_period_elapsed(rv_i2s_data->capture_stream); + cap_flag = 1; + } + + if (play_flag | cap_flag) + return IRQ_HANDLED; + else + return IRQ_NONE; +} + static struct snd_pcm_ops acp3x_dma_ops = { .open = NULL, .close = NULL, @@ -205,6 +238,13 @@ static int acp3x_audio_probe(struct platform_device *pdev) adata->acp3x_base = devm_ioremap(&pdev->dev, res->start, resource_size(res)); + res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); + if (!res) { + dev_err(&pdev->dev, "IORESOURCE_IRQ FAILED\n"); + return -ENODEV; + } + + adata->i2s_irq = res->start; adata->play_stream = NULL; adata->capture_stream = NULL; @@ -220,6 +260,12 @@ static int acp3x_audio_probe(struct platform_device *pdev) dev_err(&pdev->dev, "Fail to register acp i2s dai\n"); goto dev_err; } + status = devm_request_irq(&pdev->dev, adata->i2s_irq, i2s_irq_handler, + irqflags, "ACP3x_I2S_IRQ", adata); + if (status) { + dev_err(&pdev->dev, "ACP3x I2S IRQ request failed\n"); + goto dev_err; + } return 0; dev_err: