Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1929581imm; Sun, 27 May 2018 20:52:04 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp2wvTp/U0YuiO08LvUi9RtJrCyOi2YsgJKHKXrN/83XBvfNu+NlhvN6aiiW8T/FpM7B9Av X-Received: by 2002:a62:c00e:: with SMTP id x14-v6mr11734035pff.67.1527479524547; Sun, 27 May 2018 20:52:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527479524; cv=none; d=google.com; s=arc-20160816; b=xy16IfPJ7SCrQFykfZmkiu0DkmF3WRchaCbwhpEjmikO5adkGGpznwzz2cYBDl4of3 BveVfA/QtUurm6DifAVcMfY//PuAST2ufXfFDqpjgTceUkHI0FE6CM2x1fzt5+4GCpYO 3ExV2gsLU3qjqayotqz+VD/FTzxLyYKywj9GFeuPddnOQQe8+aHQaSsfKeuZGGh+49B9 fRWdr/bG4tw4hZsF7xljqwIsXOY3Ak+bYAvxkUTyLbnLrnEkjZQG4vqlXdsGNiPmNv5M faspf00+WkHTEci3pQBmF9bUY/BNb+1W+B2ECukTa8EzSvAlkexli+kOW1hMe5QmWRda CdnQ== 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:message-id:date:subject:cc:from :dkim-signature:arc-authentication-results; bh=e/ViBv2t8P+W/Z4DwclQpyI7xSSzUoAmRz9w3nWbmNo=; b=hbqMa37UAkRWOZLh9SgGG36wmR+Mmn/prMLiXu6tb93+4KxeLHFayK3Uv9MvWLtvSC GiPvbZQjGDyoOGlnTqmC/Km/DGKTokVy6ZTnclsa1DlAAPVGs+Fhbqf+dMZasBhGwXLW SCw0xjCYUTbB91LLtYP5Lrj0P6BdgspncFbIEVV/AzFgkx+vbXVuNuADZacO91qFdBW6 odxDYwI955aWm10wQKsNaudg1TkpgnEn8fL4uzbZFl2isw0tTN8q8KCN4xi/KS0e4p6u T3KxdA4IZj5Vz1XMAWJyaL84ZnD/EZhBuIddaFBWJ52ceeVv1YOF3+Hwcx0xt0LBXhPI DU1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=uef/t10O; 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 c10-v6si30608738pfn.133.2018.05.27.20.51.49; Sun, 27 May 2018 20:52:04 -0700 (PDT) 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=uef/t10O; 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 S1751808AbeE1DtU (ORCPT + 99 others); Sun, 27 May 2018 23:49:20 -0400 Received: from mail-by2nam01on0083.outbound.protection.outlook.com ([104.47.34.83]:9622 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751118AbeE1DtR (ORCPT ); Sun, 27 May 2018 23:49:17 -0400 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 Cc: djkurtz@chromium.org, akshu.agrawal@amd.com, Alexander.Deucher@amd.com, Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , "Mukunda, Vijendar" , Alex Deucher , Guenter Roeck , alsa-devel@alsa-project.org (moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM...), linux-kernel@vger.kernel.org (open list) Subject: [v2] ASoC: AMD: make channel 1 dma as circular 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 Content-Type: text/plain 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/22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YL4tlIM4pdRyHGi5u0iKAvme5Ntt6sr3iDiyxJEsWCIMK8wJp28nhqVAlqFu+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-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75WW+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 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 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: -- 1.9.1