Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3689589imu; Sun, 11 Nov 2018 21:34:20 -0800 (PST) X-Google-Smtp-Source: AJdET5fGw+YXPzSwljFaS33K8GxyJDRYySdiWV55NVyPBsIGbGo8i/qOOx07eip5C3KqEZeLjhEo X-Received: by 2002:a62:adb:: with SMTP id 88-v6mr18492203pfk.121.1542000860858; Sun, 11 Nov 2018 21:34:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542000860; cv=none; d=google.com; s=arc-20160816; b=zLhRbzhjbbPnvbKnEN+s458GEuYSj5jGXCmJHtN7YlXneg7wHjjyHbCCkSg0ycj1eJ QJ59EF0rRmp5bLebOIl4wassCB65fyZviUHHNtIZ1OUSslIMD5E4TN1ASW324C99f9hy eII0/El8zohEd5nNq8kfwyGdeMxUr6O2RUfzI8PX7XKEgyii/kJ4XwkwvVyyT2MWPk4O TqwYhqr0Jl7uW3ib0Iu+MgnSkJ969K/YcaAslwasy3ef5zjZf0UhD90yOT5UXvXJPqzg O45kFPyP2Vu3a/v4YUQCxrASJSYDQct+nXOOh7SVK9plJiSSnTz0WCTZ5rT5roaVoM76 cnZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:subject:cc:from:dkim-signature; bh=PdQuaZEB8cz0gE4Syuq6MW7Gc1ACRDPOLc7fCkdv048=; b=e/WWlOIdCt6AVWotoqoQ62Igcqp5DgJRtHBz7rjSrhRB2rXKETt9AVaXdPYo80mgdb nF5HRZd38RSY3ha3s3Kl18nH4ioJfEUcO8EaSy+aivSCrYRFf81F3xeuCeWp4hjJx+Qr WiqNrI9jA0KNb5ObEZbQh7I9E57bCV5x5+6F8xyz7dtXkglU9Ka0UmvFMKCEo4wUauBb aqQB3Ed5YhkpvsDqPZnwMxSPcz8U2PoGz4ZK6OuutB459dere9LWIywdv6Is33sOkKET rOIhWJ0ryijWMPHkcJISasiTbbpAN6MLklXu9+Ip+Woi7HPs6Mw3a+LbFm+NlogqHfT7 zILg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=ui44BHM7; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e15si13050587pgg.281.2018.11.11.21.34.05; Sun, 11 Nov 2018 21:34:20 -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=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=ui44BHM7; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731479AbeKLPYy (ORCPT + 99 others); Mon, 12 Nov 2018 10:24:54 -0500 Received: from mail-sn1nam02on0058.outbound.protection.outlook.com ([104.47.36.58]:56884 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727243AbeKLPYy (ORCPT ); Mon, 12 Nov 2018 10:24:54 -0500 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 CC: , , , Vijendar Mukunda , Maruthi Bayyavarapu , Liam Girdwood , "Mark Brown" , Jaroslav Kysela , Takashi Iwai , "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , open list Subject: [PATCH 05/11] ASoC: amd: Interrupt handler changes for ACP3x DMA driver 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 Content-Type: text/plain 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);SRVR:DM3PR12MB0746; X-Microsoft-Exchange-Diagnostics: 1;DM3PR12MB0746;3:uX4cM8OOmBnByCO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fdzpygE8RFmE6BS8IMopmR6GhqvCMMwgC9d2hIZ6uFgJJgYqTUlYRcIOJl921VY2ZMEr+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/Qv3tqi3RiDTyJjdG2lfqUtlngeG12xAyDGWOw4zuRuCt+e9a4yQvBVLuP8NJ55osx2DJYgYehNt5/tHdLYHln3ivcjL2HRBVkX8x9LIK2M3z56OqPZhc1yESnCI9AEPmRubbHY3Bf47yimymOdQr42/whysmQjkn2ulItUqp X-Forefront-PRVS: 0854128AF0 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DM3PR12MB0746;23:nlaabZV9rOQ3Syb4+g0MmUSJDyd4Wio31N2wIbM27?= =?us-ascii?Q?RQt2niMr3m5k4oCvI6+nG35KpJ4kqjjFkaoYK7nrMB3BRd7DR7TveRfzqFM5?= =?us-ascii?Q?WLet36SJVZoZH2OXb4rZKGg6TzlbfnrEVeH9GeNP5Pj9r+wozY5X8+5jeBLR?= =?us-ascii?Q?51fiBIYZ/5NBpM59zR5PgzjxFcubTKoz3RcA9xhEsNG5xctAsFOx7lnFxARA?= =?us-ascii?Q?dcB30Zg2Kt6omK71ict8VkKu3yu5Tm/APRqhFZpulSFOMScPlvdu2MI2j8QM?= =?us-ascii?Q?1Gja3Jf8vjPrxZ8vMmMCziL3H9CnGG3edtg4CXozR6iW2ZdtqunsUIwquMpK?= =?us-ascii?Q?OmyGyQzyU33jBJyfUA+XS+CQWioASK5dT2j25GZRFtcBlm2pwrSw3/J5bB6N?= =?us-ascii?Q?dgdEJ3goCJCx/At8CRJOwHXp2JgfE1YrTWcb8J7A2Jer6VLlI/u38CtThytv?= =?us-ascii?Q?bO8WRTpX663Yj9dMj1Mu11Q7aeZ0WUM1d890G7I5rHtsjk4ijy2HbgPEeq4r?= =?us-ascii?Q?ffsEz6bg6VSETx9Za19+lWx/sxY00gZoSkAbXYde4v59dtpgNZdYXheW8MTC?= =?us-ascii?Q?Wlo+iXLOk/ztv22kvdWCm+fgd+4Pmo0k4xHRURG6gj/rV6PYPlbS4oGQGyfW?= =?us-ascii?Q?exIY/ot+Wau2cqmeznTsL9A6Ssv7v5BttGQyftVTBoPCd1Z4KKhbYc9JRFfw?= =?us-ascii?Q?t8dxaITRujGDw3afSTCDXLatQUOLYBp/t9k3DmApIt52kQC2GQVyKvJ+WAsV?= =?us-ascii?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oFWY63Ae6ENH//OVqFXiq24SqlwrkOs4CsWGl81q877F9cOQXxu6pjIyOBp00pOGeelP0X4kevR6zPF+hXcOJtNkm6Cp+MC+wp6puxkLPvk5XKXQWxa6dDGpq18XTttQsiiVoj3vMOuG8TFsB+xIKGVkoSYyuIMbi4HeyqgJB7kwQ+GBqLoXd3QxV9GOjXfNbz6kWNU9QOk3sWbeaumYaGxvxE2lK5lmou0+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 To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: -- 2.7.4