diff mbox

[v2,1/9] ASoC: sti: add binding for ASoc driver

Message ID 1431951176-24670-2-git-send-email-arnaud.pouliquen@st.com (mailing list archive)
State New, archived
Headers show

Commit Message

Arnaud POULIQUEN May 18, 2015, 12:12 p.m. UTC
Add Asoc driver bindings documentation.
Describe the required properties for each of the hardware IPs drivers.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
---
 .../devicetree/bindings/sound/st,sti-asoc-card.txt | 158 +++++++++++++++++++++
 1 file changed, 158 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/st,sti-asoc-card.txt

Comments

Mark Brown May 22, 2015, 12:43 p.m. UTC | #1
On Mon, May 18, 2015 at 02:12:48PM +0200, Arnaud Pouliquen wrote:

> Add Asoc driver bindings documentation.

ASoC.

> +  - standby:  standby mode activation deactivation. this mode is specific to
> +	      Uni player IP and allows to transmit bus clock and a pattern data
> +	      while audio stream is stopped or paused.
> +  - auto-suspend-delay: runtime auto suspend delay (in ms) before deactivating
> +			stanby mode. Equivalent to the DAPM mechanism but for
> +			CPU DAI.

It's still not clear to me that these are things that should be
configured via the DT.  Otherwise this looks OK.
Arnaud POULIQUEN May 22, 2015, 1:24 p.m. UTC | #2
Oops...sorry, i missed to clean these lines...
I suppressed standby mode in my V2. I plan to propose this mode in a 
separate patch based on DAPM...
I let you check the rest of the patches then will clean lines in the V3

On 05/22/2015 02:43 PM, Mark Brown wrote:
> On Mon, May 18, 2015 at 02:12:48PM +0200, Arnaud Pouliquen wrote:
>
>> Add Asoc driver bindings documentation.
>
> ASoC.
>
>> +  - standby:  standby mode activation deactivation. this mode is specific to
>> +	      Uni player IP and allows to transmit bus clock and a pattern data
>> +	      while audio stream is stopped or paused.
>> +  - auto-suspend-delay: runtime auto suspend delay (in ms) before deactivating
>> +			stanby mode. Equivalent to the DAPM mechanism but for
>> +			CPU DAI.
>
> It's still not clear to me that these are things that should be
> configured via the DT.  Otherwise this looks OK.
>
Mark Brown May 25, 2015, 12:14 p.m. UTC | #3
On Fri, May 22, 2015 at 03:24:10PM +0200, Arnaud Pouliquen wrote:
> Oops...sorry, i missed to clean these lines...

Please don't top post.

> I suppressed standby mode in my V2. I plan to propose this mode in a
> separate patch based on DAPM...
> I let you check the rest of the patches then will clean lines in the V3

Ah, OK.
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/sound/st,sti-asoc-card.txt b/Documentation/devicetree/bindings/sound/st,sti-asoc-card.txt
new file mode 100644
index 0000000..e4296bb
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/st,sti-asoc-card.txt
@@ -0,0 +1,158 @@ 
+STMicroelectronics sti ASOC cards
+
+The sti ASoC Sound Card can be used, for all sti SoCs using internal sti-sas
+codec or external codecs.
+
+sti sound drivers allows to expose sti SOC audio interface through the
+generic ASOC simple card. For details about sound card declaration please refer to
+Documentation/devicetree/bindings/sound/simple-card.txt.
+
+-sti-asoc-platform: audio platform engine.
+Required properties:
+  - compatible: "st,sti-audio-platform".
+  - st,syscfg: phandle to boot-device system configuration registers
+  - clocks: CPU_DAI IP clock source, listed in the same order than the
+	    CPU_DAI properties.
+  - clock-names: name of the clocks listed in clocks property in the same order
+  - reg: CPU DAI IP Base address and size entries, listed  in same
+	 order than the CPU_DAI properties.
+  - reg-names: names of the mapped memory regions listed in regs property in
+	       the same order.
+  - interrupts: CPU_DAI interrupt line, listed in the same order than the
+		CPU_DAI properties.
+  - dma: CPU_DAI DMA controller phandle and DMA request line, listed in the same
+	 order than the CPU_DAI properties.
+  - dma-names: identifier string for each DMA request line in the dmas property.
+
+- cpu-dai: sti-asoc-platform subnode that describes properties for a CPU-DAI instance.
+Required properties:
+  - dai-name: DAI name that describes the IP.
+  - uniperiph-id: internal SOC IP instance ID.
+  - version: IP version integrated in SOC.
+  - IP mode: IP working mode depending on associated codec.
+	"HDMI" connected to HDMI codec IP and IEC HDMI formats.
+	"SPDIF"connected to SPDIF codec and support SPDIF formats.
+	"PCM"  PCM standard mode for I2S or TDM bus.
+
+Optional properties:
+  - standby:  standby mode activation deactivation. this mode is specific to
+	      Uni player IP and allows to transmit bus clock and a pattern data
+	      while audio stream is stopped or paused.
+  - auto-suspend-delay: runtime auto suspend delay (in ms) before deactivating
+			stanby mode. Equivalent to the DAPM mechanism but for
+			CPU DAI.
+  - pinctrl-0: defined for CPU_DAI@1 and CPU_DAI@4 to describe I2S PIOs for
+	       external codecs connection.
+  - pinctrl-names: should contain only one value - "default".
+
+- sti-sas-codec: internal audio codec IPs driver
+Required properties:
+  - compatible: "st,sti<chip>-sas-codec" .
+	Should be chip "st,sti416-sas-codec" or "st,sti417-sas-codec"
+  - st,syscfg: phandle to boot-device system configuration registers.
+  - pinctrl-0: SPDIF PIO description.
+  - pinctrl-names: should contain only one value - "default".
+
+audio_controller: sti-asoc-platform {
+		#sound-dai-cells = <1>;
+		compatible = "st,sti-audio-platform";
+		st,syscfg = <&syscfg_core>;
+		clocks = <&clk_s_d0_flexgen CLK_PCM_0>, /*UPP 0*/
+			 <&clk_s_d0_flexgen CLK_PCM_1>, /*UPP 1*/
+			 <&clk_s_d0_flexgen CLK_PCM_2>, /*UPP 2*/
+			 <&clk_s_d0_flexgen CLK_SPDIFF>, /*UPP 3 */
+			 <0>, /*UPR 0: no clock*/
+			 <0>; /*UPR 1: no clock */
+		clock-names = "uni_p0", "uni_p1", "uni_p2", "uni_p3",
+			      "no_clock", "no_clock";
+		reg = <0x8D80000 0x158>, <0x8D81000  0x158>,
+		      <0x8D82000  0x158>, <0x8D85000  0x158>,
+		      <0x8D83000  0x158>, <0x8D84000  0x158>;
+		interrupts = <GIC_SPI 84 IRQ_TYPE_NONE>,
+			     <GIC_SPI 85 IRQ_TYPE_NONE>,
+			     <GIC_SPI 86 IRQ_TYPE_NONE>,
+			     <GIC_SPI 89 IRQ_TYPE_NONE>,
+			     <GIC_SPI 87 IRQ_TYPE_NONE>,
+			     <GIC_SPI 88 IRQ_TYPE_NONE>;
+
+		dmas = <&fdma0 2 0 1>, <&fdma0 3 0 1>,
+		       <&fdma0 4 0 1>, <&fdma0 7 0 1>,
+		       <&fdma0 5 0 1>, <&fdma0 6 0 1>;
+
+		dma-names = "tx-0", "tx-1",
+			    "tx-2", "tx-3",
+			    "rx-4", "rx-5";
+		cpu-dai@0 {
+				dai-name = "Uni Player #0 (HDMI)";
+				uniperiph-id = <0>;
+				version = <5>;
+				mode = "HDMI";
+		};
+
+		cpu-dai@1 {
+				dai-name = "Uni Player #1 (PIO)";
+				uniperiph-id = <1>;
+				version = <5>;
+				mode = "PCM";
+				pinctrl-names = "default";
+				pinctrl-0 = <&pinctrl_i2s_8ch_out>;
+		};
+		cpu-dai@2 {
+				dai-name = "Uni Player #2 (DAC)";
+				uniperiph-id = <2>;
+				version = <5>;
+				mode = "PCM";
+		};
+		cpu-dai@3 {
+				dai-name = "Uni Player #3 (SPDIF)";
+				uniperiph-id = <3>;
+				version = <5>;
+				mode = "SPDIF";
+		};
+		cpu-dai@4 {
+				dai-name = "Uni Reader #0 (PCM IN)";
+				version = <3>;
+				pinctrl-names = "default";
+				pinctrl-0 = <&pinctrl_i2s_8ch_in>;
+		};
+		cpu-dai@5 {
+				dai-name = "Uni Reader #1 (HDMI)";
+				version = <3>;
+		};
+	};
+
+	sti_sas_codec: sti-sas-codec {
+		compatible = "st,stih407-sas-codec";
+		#sound-dai-cells = <1>;
+		st,reg_audio = <&syscfg_core>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_spdif_out >;
+	};
+
+Example of audio card declaration:
+	sound {
+		compatible = "simple-audio-card";
+		simple-audio-card,name = "sti audio card";
+		status = "okay";
+
+		simple-audio-card,dai-link@0 {	/* DAC */
+			format = "i2s";
+			cpu {
+				sound-dai = <&audio_controller 2>;
+			};
+
+			codec {
+				sound-dai = <&sti_sasg_codec 1>;
+			};
+		};
+		simple-audio-card,dai-link@1 {	/* SPDIF */
+			format = "left_j";
+			cpu {
+				sound-dai = <&audio_controller 3>;
+			};
+
+			codec {
+				sound-dai = <&sti_sasg_codec 0>;
+			};
+		};
+	};