Skip to contentSkip to conversation

Enable DMA mode on Intel Keem Bay platform

PATCH In review Michael Sit Wei Hong 3 participants 5 messages Jan 8, 2021 – Jan 14, 2021

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v2 cover Enable DMA mode on Intel Keem Bay platform

v2: Update patch to align with latest kernel release.
v1: Initial patch version, to enable DMA mode on Intel Keembay platform.

Michael Sit Wei Hong (2):
dt-bindings: sound: intel, keembay-i2s: Add info for device to use DMA
ASoC: Intel: KMB: Enable DMA transfer mode

 .../bindings/sound/intel,keembay-i2s.yaml     |  14 ++
 sound/soc/intel/Kconfig                       |   2 +
 sound/soc/intel/keembay/kmb_platform.c        | 157 ++++++++++++++++--
 sound/soc/intel/keembay/kmb_platform.h        |   9 +
 4 files changed, 167 insertions(+), 15 deletions(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH v2 1/2 dt-bindings: sound: intel, keembay-i2s: Add info for device to use DMA

Add descriptions for entries needed for audio device to use DMA channels for audio playback and capture.

---
 .../bindings/sound/intel,keembay-i2s.yaml          | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
Documentation/devicetree/bindings/sound/intel,keembay-i2s.yaml +14 -0
index d346e61ab708..e0658f122cbb 100644
@@ -45,6 +45,18 @@ properties:
       - const: osc
       - const: apb_clk
 
+  dmas:
+    items:
+      - description: DMA controller phandle and DMA channel
+                     for TX and RX
+
+  dma-names:
+    items:
+      - description: "tx" for the transmit channel
+                     "rx" for the receive channel
+      - const: tx
+      - const: rx
+
 required:
   - compatible
   - "#sound-dai-cells"
@@ -70,4 +82,6 @@ examples:
          interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>;
          clock-names = "osc", "apb_clk";
          clocks = <&scmi_clk KEEM_BAY_PSS_AUX_I2S3>, <&scmi_clk KEEM_BAY_PSS_I2S3>;
+         dmas = <&axi_dma0 29 &axi_dma0 33>;
+         dma-names = "tx", "rx";
      };
Signature · 1 line
2.17.1
maintainer
#2 lore raw

Re: [PATCH v2 1/2] dt-bindings: sound: intel, keembay-i2s: Add info for device to use DMA

Quoted 2 lines · Michael Sit Wei Hong

Add descriptions for entries needed for audio device to use DMA channels for audio playback and capture.

Please use get_maintainers.pl so patches go to the right lists.

This binding has errors in linux-next:

./Documentation/devicetree/bindings/sound/intel,keembay-i2s.yaml: while parsing a block mapping
in "<unicode string>", line 55, column 9
did not find expected key
in "<unicode string>", line 55, column 27

Quoted 12 lines
---
 .../bindings/sound/intel,keembay-i2s.yaml          | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
Documentation/devicetree/bindings/sound/intel,keembay-i2s.yaml +0 -0
index d346e61ab708..e0658f122cbb 100644

Documentation/devicetree/bindings/sound/intel,keembay-i2s.yaml properties: · line 51

Quoted 7 lines
Documentation/devicetree/bindings/sound/intel,keembay-i2s.yaml +4 -0
@@ -45,6 +45,18 @@ properties:
       - const: osc
       - const: apb_clk
 
+  dmas:
+    items:
+      - description: DMA controller phandle and DMA channel
+                     for TX and RX

This defines 'dmas' has 1 entry.

Documentation/devicetree/bindings/sound/intel,keembay-i2s.yaml properties: · line 55

Quoted 4 lines
Documentation/devicetree/bindings/sound/intel,keembay-i2s.yaml +4 -0
+
+  dma-names:
+    items:
+      - description: "tx" for the transmit channel

The quotes are what cause the above problem.

Documentation/devicetree/bindings/sound/intel,keembay-i2s.yaml properties: · line 58

Quoted 3 lines
Documentation/devicetree/bindings/sound/intel,keembay-i2s.yaml +3 -0
+                     "rx" for the receive channel
+      - const: tx
+      - const: rx

And here dma-names has 3 entries. Drop 'description' because it just says what the schema defines.

Please send incremental fixes as Mark already applied.

Rob

#3 lore raw

PATCH v2 2/2 ASoC: Intel: KMB: Enable DMA transfer mode

In reply to Michael Sit Wei Hong

Enable DMA transfer mode for Intel Keem Bay ASoC platform driver.

The driver will search the device tree for DMA resources at boot time to enable DMA transfer mode, and will proceed to use DMA transfer if the resource is available, otherwise the default PIO mode will be used.

---
 sound/soc/intel/Kconfig                |   2 +
 sound/soc/intel/keembay/kmb_platform.c | 157 ++++++++++++++++++++++---
 sound/soc/intel/keembay/kmb_platform.h |   9 ++
 3 files changed, 153 insertions(+), 15 deletions(-)
sound/soc/intel/Kconfig +2 -0
index 0c6404fc12b3..f3a4a907b29d 100644
@@ -203,6 +203,8 @@ config SND_SOC_INTEL_KEEMBAY
 	tristate "Keembay Platforms"
 	depends on ARCH_KEEMBAY || COMPILE_TEST
 	depends on COMMON_CLK
+	select SND_DMAENGINE_PCM
+	select SND_SOC_GENERIC_DMAENGINE_PCM
 	help
 	  If you have a Intel Keembay platform then enable this option
 	  by saying Y or m.
sound/soc/intel/keembay/kmb_platform.c +142 -15

248 lines not on this page · raw message

sound/soc/intel/keembay/kmb_platform.h +9 -0
index 0c393e5916b6..67234caee814 100644
@@ -12,6 +12,7 @@
 #include <linux/bits.h>
 #include <linux/bitfield.h>
 #include <linux/types.h>
+#include <sound/dmaengine_pcm.h>
 
 /* Register values with reference to KMB databook v1.1 */
 /* common register for all channel */
@@ -103,7 +104,12 @@
 #define DW_I2S_PROVIDER	BIT(3)
 
 #define I2S_RXDMA	0x01C0
+#define I2S_RRXDMA	0x01C4
 #define I2S_TXDMA	0x01C8
+#define I2S_RTXDMA	0x01CC
+#define I2S_DMACR	0x0200
+#define I2S_DMAEN_RXBLOCK	(1 << 16)
+#define I2S_DMAEN_TXBLOCK	(1 << 17)
 
 /*
  * struct i2s_clk_config_data - represent i2s clk configuration data
@@ -131,6 +137,9 @@ struct kmb_i2s_info {
 	u32 xfer_resolution;
 	u32 fifo_th;
 	bool clock_provider;
+	/* data related to DMA transfers b/w i2s and DMAC */
+	struct snd_dmaengine_dai_dma_data play_dma_data;
+	struct snd_dmaengine_dai_dma_data capture_dma_data;
 
 	struct i2s_clk_config_data config;
 	int (*i2s_clk_cfg)(struct i2s_clk_config_data *config);
Signature · 1 line
2.17.1
maintainer
#4 lore raw
In reply to Michael Sit Wei Hong
Quoted 9 lines · Michael Sit Wei Hong

Michael Sit Wei Hong (2):
dt-bindings: sound: intel, keembay-i2s: Add info for device to use DMA
ASoC: Intel: KMB: Enable DMA transfer mode

 .../bindings/sound/intel,keembay-i2s.yaml     |  14 ++
 sound/soc/intel/Kconfig                       |   2 +
 sound/soc/intel/keembay/kmb_platform.c        | 157 ++++++++++++++++--
 sound/soc/intel/keembay/kmb_platform.h        |   9 +
 4 files changed, 167 insertions(+), 15 deletions(-)

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/2] dt-bindings: sound: intel, keembay-i2s: Add info for device to use DMA

      commit: 9ddaa1e6181b3d33080f2ed7c27cb0bba819e562
[2/2] ASoC: Intel: KMB: Enable DMA transfer mode
      commit: 11b943c06a1c1baafb0325896e666d77f5ac78b8

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark