From patchwork Mon May 28 03:48:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akshu Agrawal X-Patchwork-Id: 10429759 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0ABBC60327 for ; Mon, 28 May 2018 03:49:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE89D28AAB for ; Mon, 28 May 2018 03:49:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E2D9B28B4F; Mon, 28 May 2018 03:49:30 +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.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=unavailable 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 9A61B28AAB for ; Mon, 28 May 2018 03:49:29 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 1982D2673F0; Mon, 28 May 2018 05:49:25 +0200 (CEST) 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 0D7EF2673F2; Mon, 28 May 2018 05:49:22 +0200 (CEST) Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0082.outbound.protection.outlook.com [104.47.34.82]) by alsa0.perex.cz (Postfix) with ESMTP id 22703267196 for ; Mon, 28 May 2018 05:49:18 +0200 (CEST) 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=e/ViBv2t8P+W/Z4DwclQpyI7xSSzUoAmRz9w3nWbmNo=; b=uef/t10Oj+1Q4D5g05xeISV/esQ+5NM7YjhcX/mytwUs7oE3rvqdYAWzc6p34dxmwIjrz8pV0plIdNvkZUQAFC9Ub+fulR8H7Q69tpnsXZAs3cKHBtoFhEVrewzrMjRzJrUKPh/wNZeI2GNECG5KpTvX+Xgi0uLWamn7bTKdDM0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Akshu.Agrawal@amd.com; Received: from akshu-HP-EliteBook-745-G2.amd.com (202.56.249.162) by DM5PR12MB2360.namprd12.prod.outlook.com (2603:10b6:4:b4::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.797.11; Mon, 28 May 2018 03:49:07 +0000 From: Akshu Agrawal To: Date: Mon, 28 May 2018 11:48:22 +0800 Message-Id: <1527479306-12658-1-git-send-email-akshu.agrawal@amd.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [202.56.249.162] X-ClientProxiedBy: MA1PR0101CA0064.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:20::26) To DM5PR12MB2360.namprd12.prod.outlook.com (2603:10b6:4:b4::13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:DM5PR12MB2360; X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB2360; 3:k7kF8Cvca7ncYvHQjKAec/+5H6aJXnyf70pMDtDnAHqgzO15aOR4VkGL/ncRYAQVn8UaJEPI25PCr2NCdT/22nlxO2AEYkE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4pdRyHGi5u0iKAvme5Ntt6sr3iDiyxJEsWCIMK8wJp28nhqVAlqFu+5650r/99gi5GPdy3Lzik/LlQ7Qs60Ro8cg8X/IRLcoQMJQOrX2C0w82/Ivt7oBezPnQfD3rMeXieQa2Pg6PMQuvwxL+C6lECAU8/FyzZBOU2/IRwyQTfcMc8zW6d7geGGqhZmI1Fwhuvrvw8vH1c5UEXO73sDTKJQEY05qKhGRwBKCJcKhYnOM0VuGeR4TkMx3dn3la; 4:3UkZwQtys1Gta7N+FKQ8wtISPEwRm7FWw2Vtg1JCHj79hxMkuWg91NDGFEyGupWhjjShwJEmucSAs3CMGsetb296EC/z//zslE9b6wtvjIEBPCOGjjl6OgZMFcXWlGpEtgKCsQRcK2fPpKnIHgtL6/pD5ejAC2Hi7ahnTYHiM9mfasCPCqAagzPtml1UpKPVABpEYhE7urwcQsR17zZ1tk7NRJbn2Y8q/2enJxS9OP+hr74KjqNJiARn6rX7RwHhJM/SQnQSIROqL2R1CiKpIlNUEzlf/a0URTZTUuex1XU4kR072Kv0Vp12YcyZJ9fN 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)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(3231254)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123560045)(20161123564045)(6072148)(201708071742011)(7699016); SRVR:DM5PR12MB2360; BCL:0; PCL:0; RULEID:; SRVR:DM5PR12MB2360; X-Forefront-PRVS: 06860EDC7B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(376002)(396003)(39380400002)(39860400002)(366004)(189003)(199004)(26005)(50226002)(2616005)(86362001)(81156014)(52116002)(8676002)(2906002)(4326008)(476003)(6116002)(105586002)(956004)(3846002)(106356001)(48376002)(25786009)(7736002)(39060400002)(305945005)(109986005)(50466002)(7696005)(6666003)(53416004)(1671002)(81166006)(8936002)(53936002)(51416003)(66066001)(5660300001)(186003)(47776003)(16526019)(44832011)(36756003)(486006)(97736004)(72206003)(316002)(16586007)(386003)(68736007)(6486002)(54906003)(478600001)(266003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR12MB2360; H:akshu-HP-EliteBook-745-G2.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR12MB2360; 23:lEmupK4GRwYLdfLk0BBpNkmLCjFzJGKDNn+skW5i1?= =?us-ascii?Q?4FTWotXUONpZTI23QxKueH/SP1MxWpP5EQSrBA9QsdSSAMx8F9Vno/qTsNf0?= =?us-ascii?Q?ZHooBDlJi3UEzg7WhTuGjVywskDc1C3LCrqpNzyyDGsUMFyDEKsGs1Yx7HIC?= =?us-ascii?Q?Sa+rL++XCWAojHp96KheCfD3BsMcf1ml0oiL3k0bVXJLVdxI3Tmi0C5MBt2b?= =?us-ascii?Q?Epu++SpdS+1xmMkVpRccshKwZnBFvkYtvqmKBxxXAt3kOFpOS68wiSXVtDym?= =?us-ascii?Q?VGf2Z8whITn00ODaASnJ+jbaSQn4ATbtn7oTqWmnCzJYWhJepK+N+Cylj4wv?= =?us-ascii?Q?pE2/tOdfK2RPhxL3R4iIyGOpja1AeqMLM/yuyNQoZkwedMJyldwtbWIYdbc+?= =?us-ascii?Q?LYdPMoxP1hTJzHrxNWVWqAP9k5tussAkV0dOk2Nzjjh2NgkLBkOdeQ2XHAqo?= =?us-ascii?Q?iAEAyW2zpBvmSaOoUuPuK5Y094W8DxwznkJ/silotlrGh5kWHcenLwGemEvK?= =?us-ascii?Q?QfBqSHkRLS/Hd022nnu/Q7oBkMQn+kMhKnUdlItAPGGzMflwZRFHIwqPWpUf?= =?us-ascii?Q?1lC25a5k2Uj9JDQDHwI5Bw9TlhgTQCX2AkXd1fF238xGVNAXtRVWbNVNKfIn?= =?us-ascii?Q?0+JHF3Tp3FT4SK1z483WR8x3cfSYw3f52Q6khaIBJvFpbwFT9k4QyMx/omMV?= =?us-ascii?Q?W6pou55oCuEXD7TTffndnESSAgSJ+19T0/o+ijmzaNVX0pMYKxDcg8VY1jb3?= =?us-ascii?Q?r5N9vLZ/SblHQ9PKXpNl09Y9AdY5saV1y0W+NwGF5Gw1ELCabaWAirXaBldj?= =?us-ascii?Q?tVWHsqTPsWmcDkF7BpjFHG5voqY6yVtd9Ms/h6UHdkdgxDjLFjFxw8rt0CIF?= =?us-ascii?Q?xdRouWEmmLug3iTE/BYz3zxKCYPcI0+gGnTJXH5vNoMgZ4VzeQg5pS44eG/N?= =?us-ascii?Q?ETPoBIsW67wZ/wDdohWJBMznOlZoMNA35JAEUmCRH7FdvA3ugjdheSvB0ram?= =?us-ascii?Q?QfRdk3H7M+fRZi93kRuIW69wGcpDvntrC56+TLprNexc9DZbNP/anXn7fprg?= =?us-ascii?Q?a2WD/lQQ9F+xnedX8GK/ojlmaQY2XQ2z22p7ZeQCcL28k9DhOCn/ffOqllas?= =?us-ascii?Q?jlsnEVa0cmChLdFzy5Vz+AQlIXWjQBaqCq0ZAjVvGaJbKxVcEneigYn47/Sk?= =?us-ascii?Q?9irP7WBhkMeTvKb4VwZiwl6k6UbpA5gKcHyqQFt7MJgucl2u3mqHbWZ2sfke?= =?us-ascii?Q?ZOLbyk7n5jQPXyQ6RQ=3D?= X-Microsoft-Antispam-Message-Info: YmTvo+KFOpNdVeHcKU8eBGolzk2cUqizks1YqTndnmmOX6hSVR6AF3IfroA3P74s/qa/FR6sVY4lJDDZ9fSJA99YvWboaMvcr/O6YIHn21TR5YuUlEqp3nA0m8DqfFny7Xr6W4Da66byaYIzu6XhDW0X2n8pzsHarKVGhdWDiO24B6rtjtu59NXPD6/rrbCI X-Microsoft-Exchange-Diagnost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WW+noxCyf6hpX2LgtkFXUuJZ4A9; 20:BP35p950V2dP/VKPjqQn9xaWVozk3Bc+B09iIaOM7qSgctTJAgyjksTAeb3xFPk0BZhVvV2Ueg/jOftJ/T1WOzRNxqi184IOuklOfUyvZkdip8z9puHmdeIJteDb2VcxpozODF8WGd30MoKJb+b3EZLPo3AZ2SIpPnhgxcjEanVQEYrSt4EYKeCFKckebNQGKe6ZMom4gXFfXGEZQp4KonDAsa8WfNkwhP8+bR6kDTHEkRux1DImr02f6l7sTja0 X-MS-Office365-Filtering-Correlation-Id: 3118fe6b-7d70-4c9b-85fe-08d5c44dfbba X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2018 03:49:07.2939 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3118fe6b-7d70-4c9b-85fe-08d5c44dfbba X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB2360 Cc: "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , open list , Takashi Iwai , Liam Girdwood , djkurtz@chromium.org, Mark Brown , "Mukunda, Vijendar" , Alex Deucher , akshu.agrawal@amd.com, Guenter Roeck Subject: [alsa-devel] [v2] ASoC: AMD: make channel 1 dma as circular 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 channel 1: SYSMEM<->ACP channel 2: ACP<->I2S Instead of waiting on period interrupt of ch 2 and then starting dma on ch1, we make ch1 dma as circular. This removes dependency of period granularity on hw pointer. Signed-off-by: Akshu Agrawal Reviewed-by: Daniel Kurtz Tested-by: Daniel Kurtz --- v2: Fixed kbuild error sound/soc/amd/acp-pcm-dma.c | 74 ++++++--------------------------------------- 1 file changed, 10 insertions(+), 64 deletions(-) diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c index ac32dea..7720384 100644 --- a/sound/soc/amd/acp-pcm-dma.c +++ b/sound/soc/amd/acp-pcm-dma.c @@ -337,8 +337,7 @@ static void config_acp_dma(void __iomem *acp_mmio, } /* Start a given DMA channel transfer */ -static void acp_dma_start(void __iomem *acp_mmio, - u16 ch_num, bool is_circular) +static void acp_dma_start(void __iomem *acp_mmio, u16 ch_num) { u32 dma_ctrl; @@ -369,11 +368,8 @@ static void acp_dma_start(void __iomem *acp_mmio, break; } - /* enable for ACP SRAM to/from I2S DMA channel */ - if (is_circular == true) - dma_ctrl |= ACP_DMA_CNTL_0__Circular_DMA_En_MASK; - else - dma_ctrl &= ~ACP_DMA_CNTL_0__Circular_DMA_En_MASK; + /* circular for both DMA channel */ + dma_ctrl |= ACP_DMA_CNTL_0__Circular_DMA_En_MASK; acp_reg_write(dma_ctrl, acp_mmio, mmACP_DMA_CNTL_0 + ch_num); } @@ -617,7 +613,6 @@ static int acp_deinit(void __iomem *acp_mmio) /* ACP DMA irq handler routine for playback, capture usecases */ static irqreturn_t dma_irq_handler(int irq, void *arg) { - u16 dscr_idx; u32 intr_flag, ext_intr_status; struct audio_drv_data *irq_data; void __iomem *acp_mmio; @@ -634,33 +629,13 @@ static irqreturn_t dma_irq_handler(int irq, void *arg) if ((intr_flag & BIT(ACP_TO_I2S_DMA_CH_NUM)) != 0) { valid_irq = true; - if (acp_reg_read(acp_mmio, mmACP_DMA_CUR_DSCR_13) == - PLAYBACK_START_DMA_DESCR_CH13) - dscr_idx = PLAYBACK_END_DMA_DESCR_CH12; - else - dscr_idx = PLAYBACK_START_DMA_DESCR_CH12; - config_acp_dma_channel(acp_mmio, SYSRAM_TO_ACP_CH_NUM, dscr_idx, - 1, 0); - acp_dma_start(acp_mmio, SYSRAM_TO_ACP_CH_NUM, false); - snd_pcm_period_elapsed(irq_data->play_i2ssp_stream); - acp_reg_write((intr_flag & BIT(ACP_TO_I2S_DMA_CH_NUM)) << 16, acp_mmio, mmACP_EXTERNAL_INTR_STAT); } if ((intr_flag & BIT(ACP_TO_I2S_DMA_BT_INSTANCE_CH_NUM)) != 0) { valid_irq = true; - if (acp_reg_read(acp_mmio, mmACP_DMA_CUR_DSCR_9) == - PLAYBACK_START_DMA_DESCR_CH9) - dscr_idx = PLAYBACK_END_DMA_DESCR_CH8; - else - dscr_idx = PLAYBACK_START_DMA_DESCR_CH8; - config_acp_dma_channel(acp_mmio, - SYSRAM_TO_ACP_BT_INSTANCE_CH_NUM, - dscr_idx, 1, 0); - acp_dma_start(acp_mmio, SYSRAM_TO_ACP_BT_INSTANCE_CH_NUM, - false); snd_pcm_period_elapsed(irq_data->play_i2sbt_stream); acp_reg_write((intr_flag & BIT(ACP_TO_I2S_DMA_BT_INSTANCE_CH_NUM)) << 16, @@ -669,38 +644,20 @@ static irqreturn_t dma_irq_handler(int irq, void *arg) if ((intr_flag & BIT(I2S_TO_ACP_DMA_CH_NUM)) != 0) { valid_irq = true; - if (acp_reg_read(acp_mmio, mmACP_DMA_CUR_DSCR_15) == - CAPTURE_START_DMA_DESCR_CH15) - dscr_idx = CAPTURE_END_DMA_DESCR_CH14; - else - dscr_idx = CAPTURE_START_DMA_DESCR_CH14; - config_acp_dma_channel(acp_mmio, ACP_TO_SYSRAM_CH_NUM, dscr_idx, - 1, 0); - acp_dma_start(acp_mmio, ACP_TO_SYSRAM_CH_NUM, false); - + snd_pcm_period_elapsed(irq_data->capture_i2ssp_stream); acp_reg_write((intr_flag & BIT(I2S_TO_ACP_DMA_CH_NUM)) << 16, acp_mmio, mmACP_EXTERNAL_INTR_STAT); } if ((intr_flag & BIT(ACP_TO_SYSRAM_CH_NUM)) != 0) { valid_irq = true; - snd_pcm_period_elapsed(irq_data->capture_i2ssp_stream); acp_reg_write((intr_flag & BIT(ACP_TO_SYSRAM_CH_NUM)) << 16, acp_mmio, mmACP_EXTERNAL_INTR_STAT); } if ((intr_flag & BIT(I2S_TO_ACP_DMA_BT_INSTANCE_CH_NUM)) != 0) { valid_irq = true; - if (acp_reg_read(acp_mmio, mmACP_DMA_CUR_DSCR_11) == - CAPTURE_START_DMA_DESCR_CH11) - dscr_idx = CAPTURE_END_DMA_DESCR_CH10; - else - dscr_idx = CAPTURE_START_DMA_DESCR_CH10; - config_acp_dma_channel(acp_mmio, - ACP_TO_SYSRAM_BT_INSTANCE_CH_NUM, - dscr_idx, 1, 0); - acp_dma_start(acp_mmio, ACP_TO_SYSRAM_BT_INSTANCE_CH_NUM, - false); + snd_pcm_period_elapsed(irq_data->capture_i2sbt_stream); acp_reg_write((intr_flag & BIT(I2S_TO_ACP_DMA_BT_INSTANCE_CH_NUM)) << 16, acp_mmio, mmACP_EXTERNAL_INTR_STAT); @@ -708,7 +665,6 @@ static irqreturn_t dma_irq_handler(int irq, void *arg) if ((intr_flag & BIT(ACP_TO_SYSRAM_BT_INSTANCE_CH_NUM)) != 0) { valid_irq = true; - snd_pcm_period_elapsed(irq_data->capture_i2sbt_stream); acp_reg_write((intr_flag & BIT(ACP_TO_SYSRAM_BT_INSTANCE_CH_NUM)) << 16, acp_mmio, mmACP_EXTERNAL_INTR_STAT); @@ -1015,14 +971,10 @@ static int acp_dma_prepare(struct snd_pcm_substream *substream) static int acp_dma_trigger(struct snd_pcm_substream *substream, int cmd) { int ret; - u32 loops = 4000; u64 bytescount = 0; struct snd_pcm_runtime *runtime = substream->runtime; - struct snd_soc_pcm_runtime *prtd = substream->private_data; struct audio_substream_data *rtd = runtime->private_data; - struct snd_soc_component *component = snd_soc_rtdcom_lookup(prtd, - DRV_NAME); if (!rtd) return -EINVAL; @@ -1034,18 +986,12 @@ static int acp_dma_trigger(struct snd_pcm_substream *substream, int cmd) if (rtd->bytescount == 0) rtd->bytescount = bytescount; if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { - acp_dma_start(rtd->acp_mmio, rtd->ch1, false); - while (acp_reg_read(rtd->acp_mmio, mmACP_DMA_CH_STS) & - BIT(rtd->ch1)) { - if (!loops--) { - dev_err(component->dev, - "acp dma start timeout\n"); - return -ETIMEDOUT; - } - cpu_relax(); - } + acp_dma_start(rtd->acp_mmio, rtd->ch1); + acp_dma_start(rtd->acp_mmio, rtd->ch2); + } else { + acp_dma_start(rtd->acp_mmio, rtd->ch2); + acp_dma_start(rtd->acp_mmio, rtd->ch1); } - acp_dma_start(rtd->acp_mmio, rtd->ch2, true); ret = 0; break; case SNDRV_PCM_TRIGGER_STOP: