Skip to contentSkip to conversation

Add I2S audio support for ARC AXS10x boards

PATCH In review Jose Abreu 2 participants 4 messages Jun 9, 2016 – Jun 13, 2016

Subsystems (4)
lore
Share & tools
lore

Jose Abreu

author
#0 lore raw

v9 cover Add I2S audio support for ARC AXS10x boards

ARC AXS10x platforms consist of a mainboard with several peripherals. One of those peripherals is an HDMI output port controlled by the ADV7511 transmitter.

This patch set adds I2S audio for the AXS10x platform.

NOTE:
Although the mainline I2S driver uses ALSA DMA engine, this controller can be built without DMA support so it was necessary to add this custom platform driver so that HDMI audio works in AXS boards.

Changes v8 -> v9:
* Use defines in IRQ handling

Changes v7 -> v8:
* Build PIO PCM as module
* Always unmask interrupts even when in DMA mode
* Fallback to PIO mode only if ALSA DMA engine probe fails

Changes v6 -> v7:
* Discard the use of memcpy
* Report IRQ_HANDLED only when there is an IRQ
* Use interrupts to check if PIO mode is in use
* Unmask interrupts only when in PIO mode
* Remove empty functions

Changes v5 -> v6:
* Use SNDRV_DMA_TYPE_CONTINUOUS

Changes v4 -> v5:
* Resolve undefined references when compiling as module
* Dropped adv7511 audio patches
* Use DMA properties in I2S to check which mode to use: PIO or DMA (as suggested by Lars-Peter Clausen)

Changes v3 -> v4:
* Reintroduced custom PCM driver (see note below)
* Use DT boolean to switch between ALSA DMA engine PCM or custom PCM
* Use fifo depth to program I2S FCR
* Update I2S documentation

Changes v2 -> v3:
* Removed pll_config functions (as suggested by Alexey Brodkin)
* Removed HDMI start at adv7511_core (as suggested by Archit Taneja)
* Use NOP functions for adv7511_audio (as suggested by Archit Taneja)
* Added adv7511_audio_exit() function (as suggested by Archit Taneja)
* Moved adv7511 to its own folder (as suggested by Archit Taneja)
* Separated file rename of adv7511_core (as suggested by Emil Velikov)
* Compile adv7511 as module if ALSA SoC is compiled as module
* Load adv7511 audio only if declared in device tree (as suggested by Laurent Pinchart)
* Dropped custom platform driver, using now ALSA DMA engine
* Dropped IRQ handler for I2S

Changes v1 -> v2:
* DT bindings moved to separate patch (as suggested by Alexey Brodkin)
* Removed defconfigs entries (as suggested by Alexey Brodkin)

Cc Carlos Palminha <palminha at synopsys.com>
Cc Mark Brown <broonie at kernel.org>
Cc Liam Girdwood <lgirdwood at gmail.com>
Cc Jaroslav Kysela <perex at perex.cz>
Cc Takashi Iwai <tiwai at suse.com>
Cc Rob Herring <robh at kernel.org>
Cc Alexey Brodkin <abrodkin at synopsys.com>
Cc linux-snps-arc at lists.infradead.org
Cc alsa-devel at alsa-project.org
Cc linux-kernel at vger.kernel.org

Jose Abreu (2):
ASoC: dwc: Add PIO PCM extension
ASoC: dwc: Add irq parameter to DOCUMENTATION

 .../devicetree/bindings/sound/designware-i2s.txt   |   4 +
 sound/soc/dwc/Kconfig                              |   9 +
 sound/soc/dwc/Makefile                             |   1 +
 sound/soc/dwc/designware_i2s.c                     | 161 +++++++--------
 sound/soc/dwc/designware_pcm.c                     | 225 +++++++++++++++++++++
 sound/soc/dwc/local.h                              | 128 ++++++++++++
 6 files changed, 440 insertions(+), 88 deletions(-)
 create mode 100644 sound/soc/dwc/designware_pcm.c
 create mode 100644 sound/soc/dwc/local.h
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH v9 1/2 ASoC: dwc: Add PIO PCM extension

A PCM extension was added to I2S driver so that audio samples are transferred using PIO mode.

The PCM supports two channels @ 16 or 32 bits with rates 32k, 44.1k and 48k.

Although the mainline I2S driver uses ALSA DMA engine the I2S controller can be built without DMA support, therefore this is the reason why this extension was added.

Cc Carlos Palminha <[email protected]>
Cc Mark Brown <[email protected]>
Cc Liam Girdwood <[email protected]>
Cc Jaroslav Kysela <[email protected]>
Cc Takashi Iwai <[email protected]>
Cc Rob Herring <[email protected]>
Cc Alexey Brodkin <[email protected]>

---

Changes v8 -> v9:
* Use defines in IRQ handling

Changes v7 -> v8:
* Build PIO PCM as module
* Always unmask interrupts even when in DMA mode
* Fallback to PIO mode only if ALSA DMA engine probe fails

Changes v6 -> v7:
* Discard the use of memcpy
* Report IRQ_HANDLED only when there is an IRQ
* Use interrupts to check if PIO mode is in use
* Unmask interrupts only when in PIO mode
* Remove empty functions

Changes v5 -> v6:
* Use SNDRV_DMA_TYPE_CONTINUOUS

Changes v4 -> v5:
* Resolve undefined references when compiling as module
* Use DMA properties in I2S to check which mode to use: PIO or DMA (as suggested by Lars-Peter Clausen)

Changes v3 -> v4:
* Reintroduced custom PCM driver
* Use DT boolean to switch between ALSA DMA engine PCM or custom PCM

Changes v2 -> v3:
* Removed pll_config functions (as suggested by Alexey Brodkin)
* Dropped custom platform driver, using now ALSA DMA engine
* Dropped IRQ handler for I2S

No changes v1 -> v2.

 sound/soc/dwc/Kconfig          |   9 ++
 sound/soc/dwc/Makefile         |   1 +
 sound/soc/dwc/designware_i2s.c | 161 +++++++++++++----------------
 sound/soc/dwc/designware_pcm.c | 225 +++++++++++++++++++++++++++++++++++++++++
 sound/soc/dwc/local.h          | 128 +++++++++++++++++++++++
 5 files changed, 436 insertions(+), 88 deletions(-)
 create mode 100644 sound/soc/dwc/designware_pcm.c
 create mode 100644 sound/soc/dwc/local.h
sound/soc/dwc/Kconfig +9 -0
index d50e085..c297efe 100644
@@ -7,4 +7,13 @@ config SND_DESIGNWARE_I2S
 	 Synopsys desigwnware I2S device. The device supports upto
 	 maximum of 8 channels each for play and record.
 
+config SND_DESIGNWARE_PCM
+	tristate "PCM PIO extension for I2S driver"
+	depends on SND_DESIGNWARE_I2S
+	help
+	 Say Y, M or N if you want to add a custom ALSA extension that registers
+	 a PCM and uses PIO to transfer data.
+
+	 This functionality is specially suited for I2S devices that don't have
+	 DMA support.
 
sound/soc/dwc/Makefile +1 -0
index 319371f..1b48bccc 100644
@@ -1,3 +1,4 @@
 # SYNOPSYS Platform Support
 obj-$(CONFIG_SND_DESIGNWARE_I2S) += designware_i2s.o
+obj-$(CONFIG_SND_DESIGNWARE_PCM) += designware_pcm.o
 
sound/soc/dwc/designware_i2s.c +73 -88

194 lines not on this page · raw message

sound/soc/dwc/designware_pcm.c new file +225 -0

225 lines not on this page · raw message

sound/soc/dwc/local.h new file +128 -0

128 lines not on this page · raw message

Signature · 1 line
1.9.1
maintainer
#2 lore raw

Applied "ASoC: dwc: Add PIO PCM extension" to the asoc tree

The patch

ASoC: dwc: Add PIO PCM extension

has been applied to the asoc tree at

git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git

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

Quoted 1 line

From 79361b2b98b7b64bcf71e0aa4e4dac497bcb94bc Mon Sep 17 00:00:00 2001

From: Jose Abreu <[email protected]>
Date: Thu, 9 Jun 2016 12:47:05 +0100
Subject: [PATCH] ASoC: dwc: Add PIO PCM extension

A PCM extension was added to I2S driver so that audio samples are transferred using PIO mode.

The PCM supports two channels @ 16 or 32 bits with rates 32k, 44.1k and 48k.

Although the mainline I2S driver uses ALSA DMA engine the I2S controller can be built without DMA support, therefore this is the reason why this extension was added.

Cc Carlos Palminha <[email protected]>
Cc Mark Brown <[email protected]>
Cc Liam Girdwood <[email protected]>
Cc Jaroslav Kysela <[email protected]>
Cc Takashi Iwai <[email protected]>
Cc Rob Herring <[email protected]>
Cc Alexey Brodkin <[email protected]>
---
 sound/soc/dwc/Kconfig          |   9 ++
 sound/soc/dwc/Makefile         |   1 +
 sound/soc/dwc/designware_i2s.c | 161 +++++++++++++----------------
 sound/soc/dwc/designware_pcm.c | 225 +++++++++++++++++++++++++++++++++++++++++
 sound/soc/dwc/local.h          | 128 +++++++++++++++++++++++
 5 files changed, 436 insertions(+), 88 deletions(-)
 create mode 100644 sound/soc/dwc/designware_pcm.c
 create mode 100644 sound/soc/dwc/local.h
sound/soc/dwc/Kconfig +9 -0
index d50e08517dce..c297efe43861 100644
@@ -7,4 +7,13 @@ config SND_DESIGNWARE_I2S
 	 Synopsys desigwnware I2S device. The device supports upto
 	 maximum of 8 channels each for play and record.
 
+config SND_DESIGNWARE_PCM
+	tristate "PCM PIO extension for I2S driver"
+	depends on SND_DESIGNWARE_I2S
+	help
+	 Say Y, M or N if you want to add a custom ALSA extension that registers
+	 a PCM and uses PIO to transfer data.
+
+	 This functionality is specially suited for I2S devices that don't have
+	 DMA support.
 
sound/soc/dwc/Makefile +1 -0
index 319371f690f4..1b48bcccbc51 100644
@@ -1,3 +1,4 @@
 # SYNOPSYS Platform Support
 obj-$(CONFIG_SND_DESIGNWARE_I2S) += designware_i2s.o
+obj-$(CONFIG_SND_DESIGNWARE_PCM) += designware_pcm.o
 
sound/soc/dwc/designware_i2s.c +73 -88

194 lines not on this page · raw message

sound/soc/dwc/designware_pcm.c new file +225 -0

225 lines not on this page · raw message

sound/soc/dwc/local.h new file +128 -0

128 lines not on this page · raw message

Signature · 1 line
2.8.1
author
#3 lore raw

PATCH v9 2/2 ASoC: dwc: Add irq parameter to DOCUMENTATION

In reply to Jose Abreu

A parameter description for the interruptions of the I2S controller was added.

Cc Carlos Palminha <[email protected]>
Cc Mark Brown <[email protected]>
Cc Liam Girdwood <[email protected]>
Cc Jaroslav Kysela <[email protected]>
Cc Takashi Iwai <[email protected]>
Cc Rob Herring <[email protected]>
Cc Alexey Brodkin <[email protected]>

---

No changes v7 -> v9.

Changes v6 -> v7:
* interrupts is now optional property

No changes v5 -> v6.

Changes v4 -> v5:
* interrupts is now required property
* Drop 'snps-use-dmaengine' property

This patch was only introduced in v4.

 Documentation/devicetree/bindings/sound/designware-i2s.txt | 4 ++++
 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/sound/designware-i2s.txt +4 -0
index 7bb5424..6a536d5 100644
@@ -12,6 +12,10 @@ Required properties:
    one for receive.
  - dma-names : "tx" for the transmit channel, "rx" for the receive channel.
 
+Optional properties:
+ - interrupts: The interrupt line number for the I2S controller. Add this
+   parameter if the I2S controller that you are using does not support DMA.
+
 For more details on the 'dma', 'dma-names', 'clock' and 'clock-names'
 properties please check:
 	* resource-names.txt
Signature · 1 line
1.9.1