Skip to contentSkip to conversation

Support ZTE zx296702 SPDIF/I2S

PATCH In review Jun Nie 2 participants 6 messages Jun 4, 2015

Subsystems (3)
lore
Share & tools
lore

Jun Nie

author
#0 lore raw

v5 cover Support ZTE zx296702 SPDIF/I2S

Changes vs v4:
- Fix devm_zalloc argument issue in SPDIF driver and static issue in i2s.

Changes vs v3:
- remove HDMI stuff and will add it in video side later
- Polish SPDIF driver with devm_*

Changes vs v2:
- remove pcm dma driver and merge the related call into DAI driver
- Add zx HDMI codec with direct HDMI function call
- Other typo and minor fix

Jun Nie (4):
dt: Add documentation for the ZTE SPDIF controller
dt: Add documentation for the ZTE I2S controller
ASoC: zx: Add zx296702 SPDIF support
ASoC: zx: Add ZTE zx296702 I2S DAI driver

 .../devicetree/bindings/sound/zte,zx-i2s.txt       |  44 +++
 .../devicetree/bindings/sound/zte,zx-spdif.txt     |  28 ++
 sound/soc/Kconfig                                  |   1 +
 sound/soc/Makefile                                 |   1 +
 sound/soc/zte/Kconfig                              |  17 +
 sound/soc/zte/Makefile                             |   2 +
 sound/soc/zte/zx296702-i2s.c                       | 437 +++++++++++++++++++++
 sound/soc/zte/zx296702-spdif.c                     | 370 +++++++++++++++++
 8 files changed, 900 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/zte,zx-i2s.txt
 create mode 100644 Documentation/devicetree/bindings/sound/zte,zx-spdif.txt
 create mode 100644 sound/soc/zte/Kconfig
 create mode 100644 sound/soc/zte/Makefile
 create mode 100644 sound/soc/zte/zx296702-i2s.c
 create mode 100644 sound/soc/zte/zx296702-spdif.c
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH v5 1/4 dt: Add documentation for the ZTE SPDIF controller

This patch adds the devicetree documentation for the ZTE zx296702 SPDIF audio controller.

---
 .../devicetree/bindings/sound/zte,zx-spdif.txt     | 28 ++++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/zte,zx-spdif.txt
Documentation/devicetree/bindings/sound/zte,zx-spdif.txt new file +28 -0
new file mode 100644
index 0000000..989544e
@@ -0,0 +1,28 @@
+ZTE ZX296702 SPDIF controller
+
+Required properties:
+ - compatible : Must be "zte,zx296702-spdif"
+ - reg : Must contain SPDIF core's registers location and length
+ - clocks : Pairs of phandle and specifier referencing the controller's clocks.
+ - clock-names: "tx" for the clock to the SPDIF interface.
+ - dmas: Pairs of phandle and specifier for the DMA channel that is used by
+   the core. The core expects one dma channel for transmit.
+ - dma-names : Must be "tx"
+
+For more details on the 'dma', 'dma-names', 'clock' and 'clock-names' properties
+please check:
+	* resource-names.txt
+	* clock/clock-bindings.txt
+	* dma/dma.txt
+
+Example:
+	spdif0: spdif0@0b004000 {
+		compatible = "zte,zx296702-spdif";
+		reg = <0x0b004000 0x1000>;
+		clocks = <&lsp0clk ZX296702_SPDIF0_DIV>;
+		clock-names = "tx";
+		interrupts = <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>;
+		dmas = <&dma 4>;
+		dma-names = "tx";
+		status = "okay";
+	};
Signature · 1 line
1.9.1
author
#2 lore raw

PATCH v5 2/4 dt: Add documentation for the ZTE I2S controller

In reply to Jun Nie

This patch adds the devicetree documentation for the ZTE zx296702 I2S audio controller.

---
 .../devicetree/bindings/sound/zte,zx-i2s.txt       | 44 ++++++++++++++++++++++
 1 file changed, 44 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/zte,zx-i2s.txt
Documentation/devicetree/bindings/sound/zte,zx-i2s.txt new file +44 -0
new file mode 100644
index 0000000..7e5aa6f
@@ -0,0 +1,44 @@
+ZTE ZX296702 I2S controller
+
+Required properties:
+ - compatible : Must be "zte,zx296702-i2s"
+ - reg : Must contain I2S core's registers location and length
+ - clocks : Pairs of phandle and specifier referencing the controller's clocks.
+ - clock-names: "tx" for the clock to the I2S interface.
+ - dmas: Pairs of phandle and specifier for the DMA channel that is used by
+   the core. The core expects two dma channels for transmit.
+ - dma-names : Must be "tx" and "rx"
+
+For more details on the 'dma', 'dma-names', 'clock' and 'clock-names' properties
+please check:
+	* resource-names.txt
+	* clock/clock-bindings.txt
+	* dma/dma.txt
+
+Example:
+	i2s0: i2s0@0b005000 {
+		#sound-dai-cells = <0>;
+		compatible = "zte,zx296702-i2s";
+		reg = <0x0b005000 0x1000>;
+		clocks = <&lsp0clk ZX296702_I2S0_DIV>;
+		clock-names = "tx";
+		interrupts = <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>;
+		dmas = <&dma 5>, <&dma 6>;
+		dma-names = "tx", "rx";
+		status = "okay";
+	};
+
+	sound {
+		compatible = "simple-audio-card";
+		simple-audio-card,name = "zx296702_snd";
+		simple-audio-card,format = "left_j";
+		simple-audio-card,bitclock-master = <&sndcodec>;
+		simple-audio-card,frame-master = <&sndcodec>;
+		sndcpu: simple-audio-card,cpu {
+			sound-dai = <&i2s0>;
+		};
+
+		sndcodec: simple-audio-card,codec {
+			sound-dai = <&acodec>;
+		};
+	};
Signature · 1 line
1.9.1
author
#3 lore raw

PATCH v5 3/4 ASoC: zx: Add zx296702 SPDIF support

In reply to Jun Nie

Add driver for zx296702 SPDIF controller

---
 sound/soc/Kconfig              |   1 +
 sound/soc/Makefile             |   1 +
 sound/soc/zte/Kconfig          |   8 +
 sound/soc/zte/Makefile         |   1 +
 sound/soc/zte/zx296702-spdif.c | 370 +++++++++++++++++++++++++++++++++++++++++
 5 files changed, 381 insertions(+)
 create mode 100644 sound/soc/zte/Kconfig
 create mode 100644 sound/soc/zte/Makefile
 create mode 100644 sound/soc/zte/zx296702-spdif.c
sound/soc/Kconfig +1 -0
index 3ba52da..e2828e1 100644
@@ -57,6 +57,7 @@ source "sound/soc/tegra/Kconfig"
 source "sound/soc/txx9/Kconfig"
 source "sound/soc/ux500/Kconfig"
 source "sound/soc/xtensa/Kconfig"
+source "sound/soc/zte/Kconfig"
 
 # Supported codecs
 source "sound/soc/codecs/Kconfig"
sound/soc/Makefile +1 -0
index 974ba70..57bf32d 100644
@@ -38,3 +38,4 @@ obj-$(CONFIG_SND_SOC)	+= tegra/
 obj-$(CONFIG_SND_SOC)	+= txx9/
 obj-$(CONFIG_SND_SOC)	+= ux500/
 obj-$(CONFIG_SND_SOC)	+= xtensa/
+obj-$(CONFIG_SND_SOC)	+= zte/
sound/soc/zte/Kconfig new file +8 -0
new file mode 100644
index 0000000..4f05573
@@ -0,0 +1,8 @@
+config ZX296702_SPDIF
+	tristate "ZX296702 spdif"
+	depends on SOC_ZX296702 || COMPILE_TEST
+	depends on COMMON_CLK
+	select SND_SOC_GENERIC_DMAENGINE_PCM
+	help
+	  Say Y or M if you want to add support for codecs attached to the
+	  zx296702 spdif interface
sound/soc/zte/Makefile new file +1 -0
new file mode 100644
index 0000000..fb3a4a0
@@ -0,0 +1 @@
+obj-$(CONFIG_ZX296702_SPDIF)	+= zx296702-spdif.o
sound/soc/zte/zx296702-spdif.c new file +370 -0

370 lines not on this page · raw message

Signature · 1 line
1.9.1
author
#4 lore raw

PATCH v5 4/4 ASoC: zx: Add ZTE zx296702 I2S DAI driver

In reply to Jun Nie

Add ZTE zx296702 I2S interface DAI driver

---
 sound/soc/zte/Kconfig        |   9 +
 sound/soc/zte/Makefile       |   1 +
 sound/soc/zte/zx296702-i2s.c | 437 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 447 insertions(+)
 create mode 100644 sound/soc/zte/zx296702-i2s.c
sound/soc/zte/Kconfig +9 -0
index 4f05573..c47eb25 100644
@@ -6,3 +6,12 @@ config ZX296702_SPDIF
 	help
 	  Say Y or M if you want to add support for codecs attached to the
 	  zx296702 spdif interface
+
+config ZX296702_I2S
+	tristate "ZX296702 i2s"
+	depends on SOC_ZX296702 || COMPILE_TEST
+	depends on COMMON_CLK
+	select SND_SOC_GENERIC_DMAENGINE_PCM
+	help
+	  Say Y or M if you want to add support for codecs attached to the
+	  zx296702 i2s interface
sound/soc/zte/Makefile +1 -0
index fb3a4a0..254ed2c 100644
@@ -1 +1,2 @@
 obj-$(CONFIG_ZX296702_SPDIF)	+= zx296702-spdif.o
+obj-$(CONFIG_ZX296702_I2S)	+= zx296702-i2s.o
sound/soc/zte/zx296702-i2s.c new file +437 -0

437 lines not on this page · raw message

Signature · 1 line
1.9.1
maintainer
#5 lore raw
In reply to Jun Nie
Quoted 2 lines · Jun Nie

Changes vs v4:
- Fix devm_zalloc argument issue in SPDIF driver and static issue in i2s.

I already did the devm fix by hand and I applied some fixes from Fengguang for other issues. Please send incremental fixes for any other issues.