Skip to contentSkip to conversation

Add freescale S/PDIF CPU DAI and machine drivers

PATCH Superseded Nicolin Chen 4 participants 8 messages Aug 20, 2013

Subsystems (5)

v9 of 12 Superseded Latest is v12 →

lore
Share & tools
lore
#0 lore raw

v9 cover Add freescale S/PDIF CPU DAI and machine drivers

Changelog:
v8->v9:
* Use bool instead of atomic_t.
* Use clk_prepare_enable() instead.
* Dropped dumpregs().
* Dropped unnecessary clk_round_rate().
* Dropped unused clock source enum.
* Revised dev_err() message.
v7->v8:
* Revised DT binding doc.
* Revised dev_err() error msg.
* Check return value of clk_set_rate().
v6->v7:
* Removed extra comma in array.
* Revised some comments.
* Added some dev_err().
* Check the return value of soft reset.
* Use bitrev8() instead of extra reverse_bits().
* Use cache_bypass as default for regmap.
v5->v6:
* Sorted out rxtx clk source in DT binding.
* Use devm_xxxx() functions.
* Use platform_get_resource() instead.
v4->v5:
* Dropped rx/tx-clksrc-names DT bindings.
* Use standard clock binding instead to pass the clock source list.
* Update the compatible list by using "imx35", the first SoC that has spdif.
v3->v4:
* Use regmap for CPU DAI driver.
* Use individual clock source for 32KHz, 44KHz, 48KHz playback.
* Determine clock source configuration from 'clocks' entry.
* Added imx53 to compatible list, merged imx6q and imx6dl in the list.
* Improve the algorism of reverse_bits().
* Dropped the unneeded clk_put().
v2->v3:
* Removed a wrong tag from the commit of patch-1.
v1->v2:
* Dropped one applied patch for spdif dummy codec drivers.
* Use generic DMA DT binding.
* Let spdif controller driver calculate the clock div.
* Added one optional clock source for spdif tx.
* Reivsed documentation accordingly.
Nicolin Chen (2):
ASoC: fsl: Add S/PDIF CPU DAI driver
ASoC: fsl: Add S/PDIF machine driver

 .../devicetree/bindings/sound/fsl,spdif.txt        |   54 +
 .../devicetree/bindings/sound/imx-audio-spdif.txt  |   29 +
 sound/soc/fsl/Kconfig                              |   14 +
 sound/soc/fsl/Makefile                             |    4 +
 sound/soc/fsl/fsl_spdif.c                          | 1236 ++++++++++++++++++++
 sound/soc/fsl/fsl_spdif.h                          |  191 +++
 sound/soc/fsl/imx-spdif.c                          |  134 +++
 7 files changed, 1662 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/sound/fsl,spdif.txt
 create mode 100644 Documentation/devicetree/bindings/sound/imx-audio-spdif.txt
 create mode 100644 sound/soc/fsl/fsl_spdif.c
 create mode 100644 sound/soc/fsl/fsl_spdif.h
 create mode 100644 sound/soc/fsl/imx-spdif.c
#1 lore raw

PATCH v9 1/2 ASoC: fsl: Add S/PDIF CPU DAI driver

This patch implements a device-tree-only CPU DAI driver for Freescale S/PDIF controller that supports stereo playback and record feature.

---
 .../devicetree/bindings/sound/fsl,spdif.txt        |   54 +
 sound/soc/fsl/Kconfig                              |    3 +
 sound/soc/fsl/Makefile                             |    2 +
 sound/soc/fsl/fsl_spdif.c                          | 1236 ++++++++++++++++++++
 sound/soc/fsl/fsl_spdif.h                          |  191 +++
 5 files changed, 1486 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/sound/fsl,spdif.txt
 create mode 100644 sound/soc/fsl/fsl_spdif.c
 create mode 100644 sound/soc/fsl/fsl_spdif.h
Documentation/devicetree/bindings/sound/fsl,spdif.txt new file +54 -0
new file mode 100644
index 0000000..f2ae335
@@ -0,0 +1,54 @@
+Freescale Sony/Philips Digital Interface Format (S/PDIF) Controller
+
+The Freescale S/PDIF audio block is a stereo transceiver that allows the
+processor to receive and transmit digital audio via an coaxial cable or
+a fibre cable.
+
+Required properties:
+
+  - compatible : Compatible list, must contain "fsl,imx35-spdif".
+
+  - reg : Offset and length of the register set for the device.
+
+  - interrupts : Contains the spdif interrupt.
+
+  - dmas : Generic dma devicetree binding as described in
+  Documentation/devicetree/bindings/dma/dma.txt.
+
+  - dma-names : Two dmas have to be defined, "tx" and "rx".
+
+  - clocks : Contains an entry for each entry in clock-names.
+
+  - clock-names : Includes the following entries:
+	"core"		The core clock of spdif controller
+	"rxtx<0-7>"	Clock source list for tx and rx clock.
+			This clock list should be identical to
+			the source list connecting to the spdif
+			clock mux in "SPDIF Transceiver Clock
+			Diagram" of SoC reference manual. It
+			can also be referred to TxClk_Source
+			bit of register SPDIF_STC.
+
+Example:
+
+spdif: spdif@02004000 {
+	compatible = "fsl,imx35-spdif";
+	reg = <0x02004000 0x4000>;
+	interrupts = <0 52 0x04>;
+	dmas = <&sdma 14 18 0>,
+	       <&sdma 15 18 0>;
+	dma-names = "rx", "tx";
+
+	clocks = <&clks 197>, <&clks 3>,
+	       <&clks 197>, <&clks 107>,
+	       <&clks 0>, <&clks 118>,
+	       <&clks 62>, <&clks 139>,
+	       <&clks 0>;
+	clock-names = "core", "rxtx0",
+		"rxtx1", "rxtx2",
+		"rxtx3", "rxtx4",
+		"rxtx5", "rxtx6",
+		"rxtx7";
+
+	status = "okay";
+};
sound/soc/fsl/Kconfig +3 -0
index 3a4808d..cd088cc 100644
@@ -1,6 +1,9 @@
 config SND_SOC_FSL_SSI
 	tristate
 
+config SND_SOC_FSL_SPDIF
+	tristate
+
 config SND_SOC_FSL_UTILS
 	tristate
 
sound/soc/fsl/Makefile +2 -0
index d4b4aa8..4b5970e 100644
@@ -12,9 +12,11 @@ obj-$(CONFIG_SND_SOC_P1022_RDK) += snd-soc-p1022-rdk.o
 
 # Freescale PowerPC SSI/DMA Platform Support
 snd-soc-fsl-ssi-objs := fsl_ssi.o
+snd-soc-fsl-spdif-objs := fsl_spdif.o
 snd-soc-fsl-utils-objs := fsl_utils.o
 snd-soc-fsl-dma-objs := fsl_dma.o
 obj-$(CONFIG_SND_SOC_FSL_SSI) += snd-soc-fsl-ssi.o
+obj-$(CONFIG_SND_SOC_FSL_SPDIF) += snd-soc-fsl-spdif.o
 obj-$(CONFIG_SND_SOC_FSL_UTILS) += snd-soc-fsl-utils.o
 obj-$(CONFIG_SND_SOC_POWERPC_DMA) += snd-soc-fsl-dma.o
 
sound/soc/fsl/fsl_spdif.c new file +1236 -0

1,236 lines not on this page · raw message

sound/soc/fsl/fsl_spdif.h new file +191 -0

191 lines not on this page · raw message

Signature · 1 line
1.7.1
#4 lore raw

PATCH v9 2/2 ASoC: fsl: Add S/PDIF machine driver

In reply to Nicolin Chen

This patch implements a device-tree-only machine driver for Freescale i.MX series Soc. It works with spdif_transmitter/spdif_receiver and fsl_spdif.c drivers.

---
 .../devicetree/bindings/sound/imx-audio-spdif.txt  |   29 +++++
 sound/soc/fsl/Kconfig                              |   11 ++
 sound/soc/fsl/Makefile                             |    2 +
 sound/soc/fsl/imx-spdif.c                          |  134 ++++++++++++++++++++
 4 files changed, 176 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/sound/imx-audio-spdif.txt
 create mode 100644 sound/soc/fsl/imx-spdif.c
Documentation/devicetree/bindings/sound/imx-audio-spdif.txt new file +29 -0
new file mode 100644
index 0000000..9a3fa26
@@ -0,0 +1,29 @@
+Freescale i.MX audio complex with S/PDIF transceiver
+
+Required properties:
+
+  - compatible : "fsl,imx-audio-spdif"
+
+  - model : The user-visible name of this sound complex
+
+  - spdif-controller : The phandle of the i.MX S/PDIF controller
+
+
+Optional properties:
+
+  - spdif-transmitter : The phandle of the spdif-transmitter dummy codec
+
+  - spdif-receiver : The phandle of the spdif-receiver dummy codec
+
+* Note: At least one of these two properties should be set in the DT binding.
+
+
+Example:
+
+sound-spdif {
+	compatible = "fsl,imx-audio-spdif";
+	model = "imx-spdif";
+	spdif-controller = <&spdif>;
+	spdif-transmitter = <&spdif_tx_codec>;
+	spdif-receiver = <&spdif_rx_codec>;
+};
sound/soc/fsl/Kconfig +11 -0
index cd088cc..a708380 100644
@@ -193,6 +193,17 @@ config SND_SOC_IMX_SGTL5000
 	  Say Y if you want to add support for SoC audio on an i.MX board with
 	  a sgtl5000 codec.
 
+config SND_SOC_IMX_SPDIF
+	tristate "SoC Audio support for i.MX boards with S/PDIF"
+	select SND_SOC_IMX_PCM_DMA
+	select SND_SOC_FSL_SPDIF
+	select SND_SOC_FSL_UTILS
+	select SND_SOC_SPDIF
+	help
+	  SoC Audio support for i.MX boards with S/PDIF
+	  Say Y if you want to add support for SoC audio on an i.MX board with
+	  a S/DPDIF.
+
 config SND_SOC_IMX_MC13783
 	tristate "SoC Audio support for I.MX boards with mc13783"
 	depends on MFD_MC13783 && ARM
sound/soc/fsl/Makefile +2 -0
index 4b5970e..e2aaff7 100644
@@ -45,6 +45,7 @@ snd-soc-mx27vis-aic32x4-objs := mx27vis-aic32x4.o
 snd-soc-wm1133-ev1-objs := wm1133-ev1.o
 snd-soc-imx-sgtl5000-objs := imx-sgtl5000.o
 snd-soc-imx-wm8962-objs := imx-wm8962.o
+snd-soc-imx-spdif-objs :=imx-spdif.o
 snd-soc-imx-mc13783-objs := imx-mc13783.o
 
 obj-$(CONFIG_SND_SOC_EUKREA_TLV320) += snd-soc-eukrea-tlv320.o
@@ -53,4 +54,5 @@ obj-$(CONFIG_SND_SOC_MX27VIS_AIC32X4) += snd-soc-mx27vis-aic32x4.o
 obj-$(CONFIG_SND_MXC_SOC_WM1133_EV1) += snd-soc-wm1133-ev1.o
 obj-$(CONFIG_SND_SOC_IMX_SGTL5000) += snd-soc-imx-sgtl5000.o
 obj-$(CONFIG_SND_SOC_IMX_WM8962) += snd-soc-imx-wm8962.o
+obj-$(CONFIG_SND_SOC_IMX_SPDIF) += snd-soc-imx-spdif.o
 obj-$(CONFIG_SND_SOC_IMX_MC13783) += snd-soc-imx-mc13783.o
sound/soc/fsl/imx-spdif.c new file +134 -0

134 lines not on this page · raw message

Signature · 1 line
1.7.1
#2 lore raw

Re: [PATCH v9 1/2] ASoC: fsl: Add S/PDIF CPU DAI driver

In reply to Nicolin Chen
Quoted 6 lines · Nicolin Chen

This patch implements a device-tree-only CPU DAI driver for Freescale S/PDIF controller that supports stereo playback and record feature.

---
 .../devicetree/bindings/sound/fsl,spdif.txt        |   54 +

What changed between v8 and v9?

#5 lore raw

Re: [PATCH v9 2/2] ASoC: fsl: Add S/PDIF machine driver

In reply to Nicolin Chen
Quoted 7 lines · Nicolin Chen

This patch implements a device-tree-only machine driver for Freescale i.MX series Soc. It works with spdif_transmitter/spdif_receiver and fsl_spdif.c drivers.

---
 .../devicetree/bindings/sound/imx-audio-spdif.txt  |   29 +++++

What changed between v8 and v9?

Documentation/devicetree/bindings/sound/imx-audio-spdif.txt line 18

Quoted 9 lines
Documentation/devicetree/bindings/sound/imx-audio-spdif.txt +7 -0
 
+Optional properties:
+
+  - spdif-transmitter : The phandle of the spdif-transmitter dummy codec
+
+  - spdif-receiver : The phandle of the spdif-receiver dummy codec
+
+* Note: At least one of these two properties should be set in the DT binding.

I still don't think "dummy CODEC" is an appropriate thing to have in DT.

reviewer
#6 lore raw

Re: [PATCH v9 2/2] ASoC: fsl: Add S/PDIF machine driver

Hi Stephen,

I have a whole changelist in the cover letter (PATCH 0/2). Please take a look at it.

And about the codec dummy things.. I do that only because the codec driver's doc say so.

Thank you,
Nicolin

Quoted 29 lines · Stephen Warren
Quoted 7 lines · Nicolin Chen

This patch implements a device-tree-only machine driver for Freescale i.MX series Soc. It works with spdif_transmitter/spdif_receiver and fsl_spdif.c drivers.

---
 .../devicetree/bindings/sound/imx-audio-spdif.txt  |   29 +++++

What changed between v8 and v9?

Review

Quoted 1 line
(quoted diff) +0 -0

b/Documentation/devicetree/bindings/sound/imx-audio-spdif.txt

Documentation/devicetree/bindings/sound/imx-audio-spdif.txt

Quoted 7 lines
Documentation/devicetree/bindings/sound/imx-audio-spdif.txt new file +7 -0
+Optional properties:
+
+  - spdif-transmitter : The phandle of the spdif-transmitter dummy codec
+
+  - spdif-receiver : The phandle of the spdif-receiver dummy codec
+
+* Note: At least one of these two properties should be set in the DT

binding.

I still don't think "dummy CODEC" is an appropriate thing to have in DT.
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#7 lore raw

Re: [PATCH v9 2/2] ASoC: fsl: Add S/PDIF machine driver

Quoted 7 lines · Nicole Otsuka

Hi Stephen,

I have a whole changelist in the cover letter (PATCH 0/2). Please take a look at it.

And about the codec dummy things.. I do that only because the codec driver's doc say so.

The DT binding document is not meant to be influenced by internal driver architecture.

maintainer
#3 lore raw

Re: [PATCH v9 1/2] ASoC: fsl: Add S/PDIF CPU DAI driver

In reply to Stephen Warren
Quoted 1 line · Stephen Warren

What changed between v8 and v9?

There was a changelog in the cover mail for the series:

| Changelog:
| v8->v9:
|  * Use bool instead of atomic_t.
|  * Use clk_prepare_enable() instead.
|  * Dropped dumpregs().
|  * Dropped unnecessary clk_round_rate().
|  * Dropped unused clock source enum.
|  * Revised dev_err() message.