Unverified Commit 2d8fc973 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown
Browse files

ASoC: renesas, rsnd: switch to yaml base Documentation



This patch switches from .txt base to .yaml base Document.
It is still keeping detail explanations at .txt

Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: default avatarRob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/87blgcbaw4.wl-kuninori.morimoto.gx@renesas.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 97198614
Loading
Loading
Loading
Loading
+0 −520
Original line number Diff line number Diff line
@@ -253,523 +253,3 @@ This is example of TDM 6ch.
Driver can automatically switches TDM <-> stereo mode in this case.

see "Example: simple sound card for TDM"

=============================================
Required properties:
=============================================

- compatible			: "renesas,rcar_sound-<soctype>", fallbacks
				  "renesas,rcar_sound-gen1" if generation1, and
				  "renesas,rcar_sound-gen2" if generation2 (or RZ/G1)
				  "renesas,rcar_sound-gen3" if generation3 (or RZ/G2)
				  Examples with soctypes are:
				    - "renesas,rcar_sound-r8a7742" (RZ/G1H)
				    - "renesas,rcar_sound-r8a7743" (RZ/G1M)
				    - "renesas,rcar_sound-r8a7744" (RZ/G1N)
				    - "renesas,rcar_sound-r8a7745" (RZ/G1E)
				    - "renesas,rcar_sound-r8a77470" (RZ/G1C)
				    - "renesas,rcar_sound-r8a774a1" (RZ/G2M)
				    - "renesas,rcar_sound-r8a774b1" (RZ/G2N)
				    - "renesas,rcar_sound-r8a774c0" (RZ/G2E)
				    - "renesas,rcar_sound-r8a774e1" (RZ/G2H)
				    - "renesas,rcar_sound-r8a7778" (R-Car M1A)
				    - "renesas,rcar_sound-r8a7779" (R-Car H1)
				    - "renesas,rcar_sound-r8a7790" (R-Car H2)
				    - "renesas,rcar_sound-r8a7791" (R-Car M2-W)
				    - "renesas,rcar_sound-r8a7793" (R-Car M2-N)
				    - "renesas,rcar_sound-r8a7794" (R-Car E2)
				    - "renesas,rcar_sound-r8a7795" (R-Car H3)
				    - "renesas,rcar_sound-r8a7796" (R-Car M3-W)
				    - "renesas,rcar_sound-r8a77965" (R-Car M3-N)
				    - "renesas,rcar_sound-r8a77990" (R-Car E3)
				    - "renesas,rcar_sound-r8a77995" (R-Car D3)
- reg				: Should contain the register physical address.
				  required register is
				   SRU/ADG/SSI      if generation1
				   SRU/ADG/SSIU/SSI/AUDIO-DMAC-periperi if generation2/generation3
				   Select extended AUDIO-DMAC-periperi address if SoC has it,
				   otherwise select normal AUDIO-DMAC-periperi address.
- reg-names			: Should contain the register names.
				   scu/adg/ssi	if generation1
				   scu/adg/ssiu/ssi/audmapp if generation2/generation3
- rcar_sound,ssi		: Should contain SSI feature.
				  The number of SSI subnode should be same as HW.
				  see below for detail.
- rcar_sound,ssiu		: Should contain SSIU feature.
				  The number of SSIU subnode should be same as HW.
				  see below for detail.
- rcar_sound,src		: Should contain SRC feature.
				  The number of SRC subnode should be same as HW.
				  see below for detail.
- rcar_sound,ctu		: Should contain CTU feature.
				  The number of CTU subnode should be same as HW.
				  see below for detail.
- rcar_sound,mix		: Should contain MIX feature.
				  The number of MIX subnode should be same as HW.
				  see below for detail.
- rcar_sound,dvc		: Should contain DVC feature.
				  The number of DVC subnode should be same as HW.
				  see below for detail.
- rcar_sound,dai		: DAI contents.
				  The number of DAI subnode should be same as HW.
				  see below for detail.
- #sound-dai-cells		: it must be 0 if your system is using single DAI
				  it must be 1 if your system is using multi  DAI
- clocks			: References to SSI/SRC/MIX/CTU/DVC/AUDIO_CLK clocks.
- clock-names			: List of necessary clock names.
				  "ssi-all", "ssi.X", "src.X", "mix.X", "ctu.X",
				  "dvc.X", "clk_a", "clk_b", "clk_c", "clk_i"

Optional properties:
- #clock-cells			: it must be 0 if your system has audio_clkout
				  it must be 1 if your system has audio_clkout0/1/2/3
- clock-frequency		: for all audio_clkout0/1/2/3
- clkout-lr-asynchronous	: boolean property. it indicates that audio_clkoutn
				  is asynchronizes with lr-clock.
- resets			: References to SSI resets.
- reset-names			: List of valid reset names.
				  "ssi-all", "ssi.X"

SSI subnode properties:
- interrupts			: Should contain SSI interrupt for PIO transfer
- shared-pin			: if shared clock pin
- pio-transfer			: use PIO transfer mode
- no-busif			: BUSIF is not ussed when [mem -> SSI] via DMA case
- dma				: Should contain Audio DMAC entry
- dma-names			: SSI  case "rx"  (=playback), "tx"  (=capture)
				  Deprecated: see SSIU subnode properties
				  SSIU case "rxu" (=playback), "txu" (=capture)

SSIU subnode properties:
- dma				: Should contain Audio DMAC entry
- dma-names			: "rx" (=playback), "tx" (=capture)

SRC subnode properties:
- dma				: Should contain Audio DMAC entry
- dma-names			: "rx" (=playback), "tx" (=capture)

DVC subnode properties:
- dma				: Should contain Audio DMAC entry
- dma-names			: "tx" (=playback/capture)

DAI subnode properties:
- playback			: list of playback modules
- capture			: list of capture  modules


=============================================
Example:
=============================================

rcar_sound: sound@ec500000 {
	#sound-dai-cells = <1>;
	compatible = "renesas,rcar_sound-r8a7791", "renesas,rcar_sound-gen2";
	reg =	<0 0xec500000 0 0x1000>, /* SCU */
		<0 0xec5a0000 0 0x100>,  /* ADG */
		<0 0xec540000 0 0x1000>, /* SSIU */
		<0 0xec541000 0 0x1280>, /* SSI */
		<0 0xec740000 0 0x200>;  /* Audio DMAC peri peri*/
	reg-names = "scu", "adg", "ssiu", "ssi", "audmapp";

	clocks = <&mstp10_clks R8A7790_CLK_SSI_ALL>,
		<&mstp10_clks R8A7790_CLK_SSI9>, <&mstp10_clks R8A7790_CLK_SSI8>,
		<&mstp10_clks R8A7790_CLK_SSI7>, <&mstp10_clks R8A7790_CLK_SSI6>,
		<&mstp10_clks R8A7790_CLK_SSI5>, <&mstp10_clks R8A7790_CLK_SSI4>,
		<&mstp10_clks R8A7790_CLK_SSI3>, <&mstp10_clks R8A7790_CLK_SSI2>,
		<&mstp10_clks R8A7790_CLK_SSI1>, <&mstp10_clks R8A7790_CLK_SSI0>,
		<&mstp10_clks R8A7790_CLK_SCU_SRC9>, <&mstp10_clks R8A7790_CLK_SCU_SRC8>,
		<&mstp10_clks R8A7790_CLK_SCU_SRC7>, <&mstp10_clks R8A7790_CLK_SCU_SRC6>,
		<&mstp10_clks R8A7790_CLK_SCU_SRC5>, <&mstp10_clks R8A7790_CLK_SCU_SRC4>,
		<&mstp10_clks R8A7790_CLK_SCU_SRC3>, <&mstp10_clks R8A7790_CLK_SCU_SRC2>,
		<&mstp10_clks R8A7790_CLK_SCU_SRC1>, <&mstp10_clks R8A7790_CLK_SCU_SRC0>,
		<&mstp10_clks R8A7790_CLK_SCU_DVC0>, <&mstp10_clks R8A7790_CLK_SCU_DVC1>,
		<&audio_clk_a>, <&audio_clk_b>, <&audio_clk_c>, <&m2_clk>;
	clock-names = "ssi-all",
			"ssi.9", "ssi.8", "ssi.7", "ssi.6", "ssi.5",
			"ssi.4", "ssi.3", "ssi.2", "ssi.1", "ssi.0",
			"src.9", "src.8", "src.7", "src.6", "src.5",
			"src.4", "src.3", "src.2", "src.1", "src.0",
			"dvc.0", "dvc.1",
			"clk_a", "clk_b", "clk_c", "clk_i";

	rcar_sound,dvc {
		dvc0: dvc-0 {
			dmas = <&audma0 0xbc>;
			dma-names = "tx";
		};
		dvc1: dvc-1 {
			dmas = <&audma0 0xbe>;
			dma-names = "tx";
		};
	};

	rcar_sound,mix {
		mix0: mix-0 { };
		mix1: mix-1 { };
	};

	rcar_sound,ctu {
		ctu00: ctu-0 { };
		ctu01: ctu-1 { };
		ctu02: ctu-2 { };
		ctu03: ctu-3 { };
		ctu10: ctu-4 { };
		ctu11: ctu-5 { };
		ctu12: ctu-6 { };
		ctu13: ctu-7 { };
	};

	rcar_sound,src {
		src0: src-0 {
			interrupts = <0 352 IRQ_TYPE_LEVEL_HIGH>;
			dmas = <&audma0 0x85>, <&audma1 0x9a>;
			dma-names = "rx", "tx";
		};
		src1: src-1 {
			interrupts = <0 353 IRQ_TYPE_LEVEL_HIGH>;
			dmas = <&audma0 0x87>, <&audma1 0x9c>;
			dma-names = "rx", "tx";
		};
		src2: src-2 {
			interrupts = <0 354 IRQ_TYPE_LEVEL_HIGH>;
			dmas = <&audma0 0x89>, <&audma1 0x9e>;
			dma-names = "rx", "tx";
		};
		src3: src-3 {
			interrupts = <0 355 IRQ_TYPE_LEVEL_HIGH>;
			dmas = <&audma0 0x8b>, <&audma1 0xa0>;
			dma-names = "rx", "tx";
		};
		src4: src-4 {
			interrupts = <0 356 IRQ_TYPE_LEVEL_HIGH>;
			dmas = <&audma0 0x8d>, <&audma1 0xb0>;
			dma-names = "rx", "tx";
		};
		src5: src-5 {
			interrupts = <0 357 IRQ_TYPE_LEVEL_HIGH>;
			dmas = <&audma0 0x8f>, <&audma1 0xb2>;
			dma-names = "rx", "tx";
		};
		src6: src-6 {
			interrupts = <0 358 IRQ_TYPE_LEVEL_HIGH>;
			dmas = <&audma0 0x91>, <&audma1 0xb4>;
			dma-names = "rx", "tx";
		};
		src7: src-7 {
			interrupts = <0 359 IRQ_TYPE_LEVEL_HIGH>;
			dmas = <&audma0 0x93>, <&audma1 0xb6>;
			dma-names = "rx", "tx";
		};
		src8: src-8 {
			interrupts = <0 360 IRQ_TYPE_LEVEL_HIGH>;
			dmas = <&audma0 0x95>, <&audma1 0xb8>;
			dma-names = "rx", "tx";
		};
		src9: src-9 {
			interrupts = <0 361 IRQ_TYPE_LEVEL_HIGH>;
			dmas = <&audma0 0x97>, <&audma1 0xba>;
			dma-names = "rx", "tx";
		};
	};

	rcar_sound,ssiu {
		ssiu00: ssiu-0 {
			dmas = <&audma0 0x15>, <&audma1 0x16>;
			dma-names = "rx", "tx";
		};
		ssiu01: ssiu-1 {
			dmas = <&audma0 0x35>, <&audma1 0x36>;
			dma-names = "rx", "tx";
		};

		...

		ssiu95: ssiu-49 {
			dmas = <&audma0 0xA5>, <&audma1 0xA6>;
			dma-names = "rx", "tx";
		};
		ssiu96: ssiu-50 {
			dmas = <&audma0 0xA7>, <&audma1 0xA8>;
			dma-names = "rx", "tx";
		};
		ssiu97: ssiu-51 {
			dmas = <&audma0 0xA9>, <&audma1 0xAA>;
			dma-names = "rx", "tx";
		};
	};

	rcar_sound,ssi {
		ssi0: ssi-0 {
			interrupts = <0 370 IRQ_TYPE_LEVEL_HIGH>;
			dmas = <&audma0 0x01>, <&audma1 0x02>;
			dma-names = "rx", "tx";
		};
		ssi1: ssi-1 {
			interrupts = <0 371 IRQ_TYPE_LEVEL_HIGH>;
			dmas = <&audma0 0x03>, <&audma1 0x04>;
			dma-names = "rx", "tx";
		};

		...

		ssi8: ssi-8 {
			interrupts = <0 378 IRQ_TYPE_LEVEL_HIGH>;
			dmas = <&audma0 0x11>, <&audma1 0x12>;
			dma-names = "rx", "tx";
		};
		ssi9: ssi-9 {
			interrupts = <0 379 IRQ_TYPE_LEVEL_HIGH>;
			dmas = <&audma0 0x13>, <&audma1 0x14>;
			dma-names = "rx", "tx";
		};
	};

	rcar_sound,dai {
		dai0 {
			playback = <&ssi5 &src5>;
			capture  = <&ssi6>;
		};
		dai1 {
			playback = <&ssi3>;
		};
		dai2 {
			capture  = <&ssi4>;
		};
		dai3 {
			playback = <&ssi7>;
		};
		dai4 {
			capture  = <&ssi8>;
		};
	};
};

=============================================
Example: simple sound card
=============================================

	rsnd_ak4643: sound {
		compatible = "simple-audio-card";

		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 = <&rcar_sound>;
		};

		sndcodec: simple-audio-card,codec {
			sound-dai = <&ak4643>;
			clocks = <&audio_clock>;
		};
	};

&rcar_sound {
	pinctrl-0 = <&sound_pins &sound_clk_pins>;
	pinctrl-names = "default";

	/* Single DAI */
	#sound-dai-cells = <0>;


	rcar_sound,dai {
		dai0 {
			playback = <&ssi0 &src2 &dvc0>;
			capture  = <&ssi1 &src3 &dvc1>;
		};
	};
};

&ssi1 {
	shared-pin;
};

=============================================
Example: simple sound card for Asynchronous mode
=============================================

sound {
	compatible = "simple-scu-audio-card";
	...
	/*
	 * SRC Asynchronous mode setting
	 * Playback:
	 * All input data will be converted to 48kHz
	 * Capture:
	 * Inputed 48kHz data will be converted to
	 * system specified Hz
	 */
	simple-audio-card,convert-rate = <48000>;
	...
	simple-audio-card,cpu {
		sound-dai = <&rcar_sound>;
	};
	simple-audio-card,codec {
		...
	};
};

=============================================
Example: simple sound card for channel convert
=============================================

sound {
	compatible = "simple-scu-audio-card";
	...
	/*
	 * CTU setting
	 * All input data will be converted to 2ch
	 * as output data
	 */
	simple-audio-card,convert-channels = <2>;
	...
	simple-audio-card,cpu {
		sound-dai = <&rcar_sound>;
	};
	simple-audio-card,codec {
		...
	};
};

=============================================
Example: simple sound card for MIXer
=============================================

sound {
	compatible = "simple-scu-audio-card";
	...
	simple-audio-card,cpu@0 {
		sound-dai = <&rcar_sound 0>;
	};
	simple-audio-card,cpu@1 {
		sound-dai = <&rcar_sound 1>;
	};
	simple-audio-card,codec {
		...
	};
};

&rcar_sound {
	...
	rcar_sound,dai {
		dai0 {
			playback = <&src1 &ctu02 &mix0 &dvc0 &ssi0>;
		};
		dai1 {
			playback = <&src2 &ctu03 &mix0 &dvc0 &ssi0>;
		};
	};
};

=============================================
Example: simple sound card for TDM
=============================================

rsnd_tdm: sound {
	compatible = "simple-audio-card";

	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 = <&rcar_sound>;
		dai-tdm-slot-num = <6>;
	};

	sndcodec: simple-audio-card,codec {
		sound-dai = <&xxx>;
	};
};

=============================================
Example: simple sound card for TDM Split
=============================================

sound_card: sound {
	compatible = "audio-graph-scu-card";
	prefix = "xxxx";
	routing = "xxxx Playback", "DAI0 Playback",
		  "xxxx Playback", "DAI1 Playback",
		  "xxxx Playback", "DAI2 Playback",
		  "xxxx Playback", "DAI3 Playback";
	convert-channels = <8>; /* TDM Split */

	dais = <&rsnd_port0     /* playback ch1/ch2 */
		&rsnd_port1     /* playback ch3/ch4 */
		&rsnd_port2     /* playback ch5/ch6 */
		&rsnd_port3     /* playback ch7/ch8 */
		>;
};

audio-codec {
	...
	port {
		codec_0: endpoint@1 {
			remote-endpoint = <&rsnd_ep0>;
		};
		codec_1: endpoint@2 {
			remote-endpoint = <&rsnd_ep1>;
		};
		codec_2: endpoint@3 {
			remote-endpoint = <&rsnd_ep2>;
		};
		codec_3: endpoint@4 {
			remote-endpoint = <&rsnd_ep3>;
		};
	};
};

&rcar_sound {
	...
	ports {
		rsnd_port0: port@0 {
			rsnd_ep0: endpoint {
				remote-endpoint = <&codec_0>;
				...
				playback = <&ssiu30 &ssi3>;
			};
		};
		rsnd_port1: port@1 {
			rsnd_ep1: endpoint {
				remote-endpoint = <&codec_1>;
				...
				playback = <&ssiu31 &ssi3>;
			};
		};
		rsnd_port2: port@2 {
			rsnd_ep2: endpoint {
				remote-endpoint = <&codec_2>;
				...
				playback = <&ssiu32 &ssi3>;
			};
		};
		rsnd_port3: port@3 {
			rsnd_ep3: endpoint {
				remote-endpoint = <&codec_3>;
				...
				playback = <&ssiu33 &ssi3>;
			};
		};
	};
};

=============================================
Example: simple sound card for Multi channel
=============================================

&rcar_sound {
	pinctrl-0 = <&sound_pins &sound_clk_pins>;
	pinctrl-names = "default";

	/* Single DAI */
	#sound-dai-cells = <0>;


	rcar_sound,dai {
		dai0 {
			playback = <&ssi0 &ssi1 &ssi2 &src0 &dvc0>;
		};
	};
};
+450 −0

File added.

Preview size limit exceeded, changes collapsed.