From patchwork Fri Sep 8 03:54:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Myunguk Kim X-Patchwork-Id: 13378878 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 03C42EE57DF for ; Mon, 11 Sep 2023 07:33:15 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id F2495DEC; Mon, 11 Sep 2023 09:32:23 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz F2495DEC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1694417594; bh=zY5cIby5AyUOVr0qdK1iemH1+nsD7Txp1CEa8wAwuZE=; h=From:To:Cc:Subject:Date:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=kx/I0k2+F2BfniiC2ZwCsGqU+9t+Cr/+XfGVGPdPgmhRXiXC8dotrRwXOUtgQCaej 5lLtvGCioRP8Z4257yAEBPCj1jyc0GOlXzWuzIASN6vRuwOpeqzFhyiLrotB9vl4SZ G2vAD1ert6ulm4Qmeu0aUaAsQFP96TllRCVBsL/o= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9F2AAF80578; Mon, 11 Sep 2023 09:31:28 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 12787F80567; Mon, 11 Sep 2023 09:31:28 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 07832F80494; Fri, 8 Sep 2023 05:55:38 +0200 (CEST) Received: from smtp4.hiworks.co.kr (smtp4.hiworks.co.kr [121.254.168.203]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id A6C22F80236 for ; Fri, 8 Sep 2023 05:55:01 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A6C22F80236 Received: (qmail 7739 invoked from network); 8 Sep 2023 12:54:55 +0900 Received: from unknown (HELO hiworks.co.kr) (192.168.10.224) by 0 (qmail 1.03 + ejcp v14) with SMTP; 8 Sep 2023 12:54:55 +0900 Received: (qmail 154234 invoked from network); 8 Sep 2023 12:54:54 +0900 Received: from unknown (HELO saram-MINIPC-PN53..) (mwkim@gaonchips.com@220.88.49.178) by 0 (qmail 1.03 + ejcp v14) with SMTP; 8 Sep 2023 12:54:54 +0900 X-Authinfo: HIWORKS SMTP authenticated X-MailFrom-INFO: Info From: Myunguk Kim To: alsa-devel@alsa-project.org Cc: Jaroslav Kysela , Takashi Iwai , Liam Girdwood , Mark Brown , Maxim Kochetkov , Xingyu Wu , Kuninori Morimoto , =?utf-8?q?Uw_e_Kleine?= =?utf-8?q?-K=C3=B6nig?= , Myunguk Kim , linux-kernel@vger.kernel.org Subject: [PATCH 1/1] ASoC: dwc: Add Single DMA mode support Date: Fri, 8 Sep 2023 12:54:49 +0900 Message-Id: <20230908035449.2211723-1-mwkim@gaonchips.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-MailFrom: mwkim@gaonchips.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 Message-ID-Hash: 5SNKESNUJZZCAUD4XH6L77UIQYXAGOBX X-Message-ID-Hash: 5SNKESNUJZZCAUD4XH6L77UIQYXAGOBX X-Mailman-Approved-At: Mon, 11 Sep 2023 07:31:20 +0000 X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: There is a SoC between dwc and DMA block (ie. PL330) that does not have a burst signal and supports only single. So write not-support-burst property on dts, it support single DMA mode. Signed-off-by: Myunguk Kim --- include/sound/designware_i2s.h | 1 + sound/soc/dwc/dwc-i2s.c | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/include/sound/designware_i2s.h b/include/sound/designware_i2s.h index f6803205a9fb..060e0cbcd55c 100644 --- a/include/sound/designware_i2s.h +++ b/include/sound/designware_i2s.h @@ -36,6 +36,7 @@ struct i2s_platform_data { #define DW_I2S_QUIRK_COMP_REG_OFFSET (1 << 0) #define DW_I2S_QUIRK_COMP_PARAM1 (1 << 1) #define DW_I2S_QUIRK_16BIT_IDX_OVERRIDE (1 << 2) + #define DW_I2S_QUIRK_NOT_SUPPORT_BURST (1 << 3) unsigned int quirks; unsigned int i2s_reg_comp1; unsigned int i2s_reg_comp2; diff --git a/sound/soc/dwc/dwc-i2s.c b/sound/soc/dwc/dwc-i2s.c index 5ab1b3eb2d28..c4dd8c18beba 100644 --- a/sound/soc/dwc/dwc-i2s.c +++ b/sound/soc/dwc/dwc-i2s.c @@ -713,7 +713,10 @@ static int dw_configure_dai_by_dt(struct dw_i2s_dev *dev, dev->play_dma_data.dt.addr = res->start + I2S_TXDMA; dev->play_dma_data.dt.fifo_size = fifo_depth * (fifo_width[idx2]) >> 8; - dev->play_dma_data.dt.maxburst = 16; + if (dev->quirks & DW_I2S_QUIRK_NOT_SUPPORT_BURST) + dev->play_dma_data.dt.maxburst = 1; + else + dev->play_dma_data.dt.maxburst = 16; } if (COMP1_RX_ENABLED(comp1)) { idx2 = COMP2_RX_WORDSIZE_0(comp2); @@ -722,7 +725,10 @@ static int dw_configure_dai_by_dt(struct dw_i2s_dev *dev, dev->capture_dma_data.dt.addr = res->start + I2S_RXDMA; dev->capture_dma_data.dt.fifo_size = fifo_depth * (fifo_width[idx2] >> 8); - dev->capture_dma_data.dt.maxburst = 16; + if (dev->quirks & DW_I2S_QUIRK_NOT_SUPPORT_BURST) + dev->capture_dma_data.dt.maxburst = 1; + else + dev->capture_dma_data.dt.maxburst = 16; } return 0; @@ -979,6 +985,8 @@ static int dw_i2s_probe(struct platform_device *pdev) ret = dw_configure_dai_by_pd(dev, dw_i2s_dai, res, pdata); } else { clk_id = "i2sclk"; + if (of_get_property(pdev->dev.of_node, "not-support-burst", NULL)) + dev->quirks |= DW_I2S_QUIRK_NOT_SUPPORT_BURST; ret = dw_configure_dai_by_dt(dev, dw_i2s_dai, res); } if (ret < 0)