From: Myunguk Kim <mwkim@gaonchips.com>
To: alsa-devel@alsa-project.org
Cc: "Jaroslav Kysela" <perex@perex.cz>,
"Takashi Iwai" <tiwai@suse.com>,
"Liam Girdwood" <lgirdwood@gmail.com>,
"Mark Brown" <broonie@kernel.org>,
"Maxim Kochetkov" <fido_max@inbox.ru>,
"Xingyu Wu" <xingyu.wu@starfivetech.com>,
"Kuninori Morimoto" <kuninori.morimoto.gx@renesas.com>,
"Uw e Kleine-König" <u.kleine-koenig@pengutronix.de>,
"Myunguk Kim" <mwkim@gaonchips.com>,
linux-kernel@vger.kernel.org, "Rob Herring" <robh+dt@kernel.org>,
"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Jose Abreu" <joabreu@synopsys.com>,
devicetree@vger.kernel.org
Subject: [PATCH] ASoC: dwc: Add Single DMA mode support
Date: Mon, 11 Sep 2023 11:40:23 +0900 [thread overview]
Message-ID: <20230911024023.43833-1-mwkim@gaonchips.com> (raw)
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 <mwkim@gaonchips.com>
---
.../bindings/sound/snps,designware-i2s.yaml | 3 +++
include/sound/designware_i2s.h | 1 +
sound/soc/dwc/dwc-i2s.c | 12 ++++++++++--
3 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/sound/snps,designware-i2s.yaml b/Documentation/devicetree/bindings/sound/snps,designware-i2s.yaml
index a48d040b0a4f..43a46ba2a70c 100644
--- a/Documentation/devicetree/bindings/sound/snps,designware-i2s.yaml
+++ b/Documentation/devicetree/bindings/sound/snps,designware-i2s.yaml
@@ -86,6 +86,9 @@ properties:
The phandle to System Register Controller syscon node and the I2S-rx(ADC)
enabled control offset and mask of SYS_SYSCONSAIF__SYSCFG register.
+ no-burst:
+ description: Use single transaction only between DesignWare I2S and DMA IP.
+
allOf:
- $ref: dai-common.yaml#
- if:
diff --git a/include/sound/designware_i2s.h b/include/sound/designware_i2s.h
index f6803205a9fb..f0207f21f09d 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_NO_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..71ff894035a4 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_NO_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_NO_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, "no-burst", NULL))
+ dev->quirks |= DW_I2S_QUIRK_NO_BURST;
ret = dw_configure_dai_by_dt(dev, dw_i2s_dai, res);
}
if (ret < 0)
--
2.34.1
next reply other threads:[~2023-09-11 2:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-11 2:40 Myunguk Kim [this message]
2023-09-11 6:12 ` Krzysztof Kozlowski
2023-09-13 2:53 ` Myunguk Kim
2023-09-13 6:38 ` Krzysztof Kozlowski
2023-09-13 6:43 ` Myunguk Kim
2023-09-13 6:58 ` Krzysztof Kozlowski
2023-09-11 12:31 ` Mark Brown
2023-09-13 4:09 ` Myunguk Kim
2023-09-13 15:07 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230911024023.43833-1-mwkim@gaonchips.com \
--to=mwkim@gaonchips.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=fido_max@inbox.ru \
--cc=joabreu@synopsys.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=robh+dt@kernel.org \
--cc=tiwai@suse.com \
--cc=u.kleine-koenig@pengutronix.de \
--cc=xingyu.wu@starfivetech.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®