18c2ecf20Sopenharmony_ciSTMicroelectronics sti ASoC cards
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ciThe sti ASoC Sound Card can be used, for all sti SoCs using internal sti-sas
48c2ecf20Sopenharmony_cicodec or external codecs.
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_cisti sound drivers allows to expose sti SoC audio interface through the
78c2ecf20Sopenharmony_cigeneric ASoC simple card. For details about sound card declaration please refer to
88c2ecf20Sopenharmony_ciDocumentation/devicetree/bindings/sound/simple-card.yaml.
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci1) sti-uniperiph-dai: audio dai device.
118c2ecf20Sopenharmony_ci---------------------------------------
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ciRequired properties:
148c2ecf20Sopenharmony_ci  - compatible: "st,stih407-uni-player-hdmi", "st,stih407-uni-player-pcm-out",
158c2ecf20Sopenharmony_ci		"st,stih407-uni-player-dac", "st,stih407-uni-player-spdif",
168c2ecf20Sopenharmony_ci		"st,stih407-uni-reader-pcm_in", "st,stih407-uni-reader-hdmi",
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci  - st,syscfg: phandle to boot-device system configuration registers
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci  - clock-names: name of the clocks listed in clocks property in the same order
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci  - reg: CPU DAI IP Base address and size entries, listed  in same
238c2ecf20Sopenharmony_ci	 order than the CPU_DAI properties.
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci  - reg-names: names of the mapped memory regions listed in regs property in
268c2ecf20Sopenharmony_ci	       the same order.
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci  - interrupts: CPU_DAI interrupt line, listed in the same order than the
298c2ecf20Sopenharmony_ci		CPU_DAI properties.
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ci  - dma: CPU_DAI DMA controller phandle and DMA request line, listed in the same
328c2ecf20Sopenharmony_ci	 order than the CPU_DAI properties.
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci  - dma-names: identifier string for each DMA request line in the dmas property.
358c2ecf20Sopenharmony_ci	"tx" for "st,sti-uni-player" compatibility
368c2ecf20Sopenharmony_ci	"rx" for "st,sti-uni-reader" compatibility
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ciRequired properties ("st,sti-uni-player" compatibility only):
398c2ecf20Sopenharmony_ci  - clocks: CPU_DAI IP clock source, listed in the same order than the
408c2ecf20Sopenharmony_ci	    CPU_DAI properties.
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ciOptional properties:
438c2ecf20Sopenharmony_ci  - pinctrl-0: defined for CPU_DAI@1 and CPU_DAI@4 to describe I2S PIOs for
448c2ecf20Sopenharmony_ci	       external codecs connection.
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci  - pinctrl-names: should contain only one value - "default".
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ci  - st,tdm-mode: to declare to set TDM mode for unireader and uniplayer IPs.
498c2ecf20Sopenharmony_ci	Only compartible with IPs in charge of the external I2S/TDM bus.
508c2ecf20Sopenharmony_ci	Should be declared depending on associated codec.
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ciExample:
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_ci	sti_uni_player1: sti-uni-player@8d81000 {
558c2ecf20Sopenharmony_ci		compatible = "st,stih407-uni-player-hdmi";
568c2ecf20Sopenharmony_ci		#sound-dai-cells = <0>;
578c2ecf20Sopenharmony_ci		st,syscfg = <&syscfg_core>;
588c2ecf20Sopenharmony_ci		clocks = <&clk_s_d0_flexgen CLK_PCM_1>;
598c2ecf20Sopenharmony_ci		reg = <0x8D81000 0x158>;
608c2ecf20Sopenharmony_ci		interrupts = <GIC_SPI 85 IRQ_TYPE_NONE>;
618c2ecf20Sopenharmony_ci		dmas = <&fdma0 3 0 1>;
628c2ecf20Sopenharmony_ci		dma-names = "tx";
638c2ecf20Sopenharmony_ci		st,tdm-mode = <1>;
648c2ecf20Sopenharmony_ci	};
658c2ecf20Sopenharmony_ci
668c2ecf20Sopenharmony_ci	sti_uni_player2: sti-uni-player@8d82000 {
678c2ecf20Sopenharmony_ci		compatible = "st,stih407-uni-player-pcm-out";
688c2ecf20Sopenharmony_ci		#sound-dai-cells = <0>;
698c2ecf20Sopenharmony_ci		st,syscfg = <&syscfg_core>;
708c2ecf20Sopenharmony_ci		clocks = <&clk_s_d0_flexgen CLK_PCM_2>;
718c2ecf20Sopenharmony_ci		reg = <0x8D82000 0x158>;
728c2ecf20Sopenharmony_ci		interrupts = <GIC_SPI 86 IRQ_TYPE_NONE>;
738c2ecf20Sopenharmony_ci		dmas = <&fdma0 4 0 1>;
748c2ecf20Sopenharmony_ci		dma-names = "tx";
758c2ecf20Sopenharmony_ci	};
768c2ecf20Sopenharmony_ci
778c2ecf20Sopenharmony_ci	sti_uni_player3: sti-uni-player@8d85000 {
788c2ecf20Sopenharmony_ci		compatible = "st,stih407-uni-player-spdif";
798c2ecf20Sopenharmony_ci		#sound-dai-cells = <0>;
808c2ecf20Sopenharmony_ci		st,syscfg = <&syscfg_core>;
818c2ecf20Sopenharmony_ci		clocks = <&clk_s_d0_flexgen CLK_SPDIFF>;
828c2ecf20Sopenharmony_ci		reg = <0x8D85000 0x158>;
838c2ecf20Sopenharmony_ci		interrupts = <GIC_SPI 89 IRQ_TYPE_NONE>;
848c2ecf20Sopenharmony_ci		dmas = <&fdma0 7 0 1>;
858c2ecf20Sopenharmony_ci		dma-names = "tx";
868c2ecf20Sopenharmony_ci	};
878c2ecf20Sopenharmony_ci
888c2ecf20Sopenharmony_ci	sti_uni_reader1: sti-uni-reader@8d84000 {
898c2ecf20Sopenharmony_ci		compatible = "st,stih407-uni-reader-hdmi";
908c2ecf20Sopenharmony_ci		#sound-dai-cells = <0>;
918c2ecf20Sopenharmony_ci		st,syscfg = <&syscfg_core>;
928c2ecf20Sopenharmony_ci		reg = <0x8D84000 0x158>;
938c2ecf20Sopenharmony_ci		interrupts = <GIC_SPI 88 IRQ_TYPE_NONE>;
948c2ecf20Sopenharmony_ci		dmas = <&fdma0 6 0 1>;
958c2ecf20Sopenharmony_ci		dma-names = "rx";
968c2ecf20Sopenharmony_ci	};
978c2ecf20Sopenharmony_ci
988c2ecf20Sopenharmony_ci2) sti-sas-codec: internal audio codec IPs driver
998c2ecf20Sopenharmony_ci-------------------------------------------------
1008c2ecf20Sopenharmony_ci
1018c2ecf20Sopenharmony_ciRequired properties:
1028c2ecf20Sopenharmony_ci  - compatible: "st,sti<chip>-sas-codec" .
1038c2ecf20Sopenharmony_ci	Should be chip "st,stih416-sas-codec" or "st,stih407-sas-codec"
1048c2ecf20Sopenharmony_ci
1058c2ecf20Sopenharmony_ci  - st,syscfg: phandle to boot-device system configuration registers.
1068c2ecf20Sopenharmony_ci
1078c2ecf20Sopenharmony_ci  - pinctrl-0: SPDIF PIO description.
1088c2ecf20Sopenharmony_ci
1098c2ecf20Sopenharmony_ci  - pinctrl-names: should contain only one value - "default".
1108c2ecf20Sopenharmony_ci
1118c2ecf20Sopenharmony_ciExample:
1128c2ecf20Sopenharmony_ci	sti_sas_codec: sti-sas-codec {
1138c2ecf20Sopenharmony_ci		compatible = "st,stih407-sas-codec";
1148c2ecf20Sopenharmony_ci		#sound-dai-cells = <1>;
1158c2ecf20Sopenharmony_ci		st,reg_audio = <&syscfg_core>;
1168c2ecf20Sopenharmony_ci		pinctrl-names = "default";
1178c2ecf20Sopenharmony_ci		pinctrl-0 = <&pinctrl_spdif_out >;
1188c2ecf20Sopenharmony_ci	};
1198c2ecf20Sopenharmony_ci
1208c2ecf20Sopenharmony_ciExample of audio card declaration:
1218c2ecf20Sopenharmony_ci	sound {
1228c2ecf20Sopenharmony_ci		compatible = "simple-audio-card";
1238c2ecf20Sopenharmony_ci		simple-audio-card,name = "sti audio card";
1248c2ecf20Sopenharmony_ci
1258c2ecf20Sopenharmony_ci		simple-audio-card,dai-link@0 {
1268c2ecf20Sopenharmony_ci			/* DAC */
1278c2ecf20Sopenharmony_ci			format = "i2s";
1288c2ecf20Sopenharmony_ci			dai-tdm-slot-width = <32>;
1298c2ecf20Sopenharmony_ci			cpu {
1308c2ecf20Sopenharmony_ci				sound-dai = <&sti_uni_player2>;
1318c2ecf20Sopenharmony_ci			};
1328c2ecf20Sopenharmony_ci
1338c2ecf20Sopenharmony_ci			codec {
1348c2ecf20Sopenharmony_ci				sound-dai = <&sti_sasg_codec 1>;
1358c2ecf20Sopenharmony_ci			};
1368c2ecf20Sopenharmony_ci		};
1378c2ecf20Sopenharmony_ci		simple-audio-card,dai-link@1 {
1388c2ecf20Sopenharmony_ci			/* SPDIF */
1398c2ecf20Sopenharmony_ci			format = "left_j";
1408c2ecf20Sopenharmony_ci			cpu {
1418c2ecf20Sopenharmony_ci				sound-dai = <&sti_uni_player3>;
1428c2ecf20Sopenharmony_ci			};
1438c2ecf20Sopenharmony_ci
1448c2ecf20Sopenharmony_ci			codec {
1458c2ecf20Sopenharmony_ci				sound-dai = <&sti_sasg_codec 0>;
1468c2ecf20Sopenharmony_ci			};
1478c2ecf20Sopenharmony_ci		};
1488c2ecf20Sopenharmony_ci		simple-audio-card,dai-link@2 {
1498c2ecf20Sopenharmony_ci			/* TDM playback  */
1508c2ecf20Sopenharmony_ci			format = "left_j";
1518c2ecf20Sopenharmony_ci			frame-inversion = <1>;
1528c2ecf20Sopenharmony_ci			cpu {
1538c2ecf20Sopenharmony_ci				sound-dai = <&sti_uni_player1>;
1548c2ecf20Sopenharmony_ci				dai-tdm-slot-num = <16>;
1558c2ecf20Sopenharmony_ci				dai-tdm-slot-width = <16>;
1568c2ecf20Sopenharmony_ci				dai-tdm-slot-tx-mask =
1578c2ecf20Sopenharmony_ci					<1 1 1 1 0 0 0 0 0 0 1 1 0 0 1 1>;
1588c2ecf20Sopenharmony_ci			};
1598c2ecf20Sopenharmony_ci
1608c2ecf20Sopenharmony_ci			codec {
1618c2ecf20Sopenharmony_ci				sound-dai = <&sti_sasg_codec 3>;
1628c2ecf20Sopenharmony_ci			};
1638c2ecf20Sopenharmony_ci		};
1648c2ecf20Sopenharmony_ci	};
165