105e85d4eSArnaud PouliquenSTMicroelectronics sti ASoC cards 205e85d4eSArnaud Pouliquen 305e85d4eSArnaud PouliquenThe sti ASoC Sound Card can be used, for all sti SoCs using internal sti-sas 405e85d4eSArnaud Pouliquencodec or external codecs. 505e85d4eSArnaud Pouliquen 605e85d4eSArnaud Pouliquensti sound drivers allows to expose sti SoC audio interface through the 705e85d4eSArnaud Pouliquengeneric ASoC simple card. For details about sound card declaration please refer to 8*d985becfSMauro Carvalho ChehabDocumentation/devicetree/bindings/sound/simple-card.yaml. 905e85d4eSArnaud Pouliquen 1005e85d4eSArnaud Pouliquen1) sti-uniperiph-dai: audio dai device. 1105e85d4eSArnaud Pouliquen--------------------------------------- 1205e85d4eSArnaud Pouliquen 1305e85d4eSArnaud PouliquenRequired properties: 1404adc084SArnaud Pouliquen - compatible: "st,stih407-uni-player-hdmi", "st,stih407-uni-player-pcm-out", 1504adc084SArnaud Pouliquen "st,stih407-uni-player-dac", "st,stih407-uni-player-spdif", 1604adc084SArnaud Pouliquen "st,stih407-uni-reader-pcm_in", "st,stih407-uni-reader-hdmi", 1705e85d4eSArnaud Pouliquen 1805e85d4eSArnaud Pouliquen - st,syscfg: phandle to boot-device system configuration registers 1905e85d4eSArnaud Pouliquen 2005e85d4eSArnaud Pouliquen - clock-names: name of the clocks listed in clocks property in the same order 2105e85d4eSArnaud Pouliquen 2205e85d4eSArnaud Pouliquen - reg: CPU DAI IP Base address and size entries, listed in same 2305e85d4eSArnaud Pouliquen order than the CPU_DAI properties. 2405e85d4eSArnaud Pouliquen 2505e85d4eSArnaud Pouliquen - reg-names: names of the mapped memory regions listed in regs property in 2605e85d4eSArnaud Pouliquen the same order. 2705e85d4eSArnaud Pouliquen 2805e85d4eSArnaud Pouliquen - interrupts: CPU_DAI interrupt line, listed in the same order than the 2905e85d4eSArnaud Pouliquen CPU_DAI properties. 3005e85d4eSArnaud Pouliquen 3105e85d4eSArnaud Pouliquen - dma: CPU_DAI DMA controller phandle and DMA request line, listed in the same 3205e85d4eSArnaud Pouliquen order than the CPU_DAI properties. 3305e85d4eSArnaud Pouliquen 3405e85d4eSArnaud Pouliquen - dma-names: identifier string for each DMA request line in the dmas property. 3505e85d4eSArnaud Pouliquen "tx" for "st,sti-uni-player" compatibility 3605e85d4eSArnaud Pouliquen "rx" for "st,sti-uni-reader" compatibility 3705e85d4eSArnaud Pouliquen 3805e85d4eSArnaud PouliquenRequired properties ("st,sti-uni-player" compatibility only): 3905e85d4eSArnaud Pouliquen - clocks: CPU_DAI IP clock source, listed in the same order than the 4005e85d4eSArnaud Pouliquen CPU_DAI properties. 4105e85d4eSArnaud Pouliquen 4205e85d4eSArnaud PouliquenOptional properties: 4305e85d4eSArnaud Pouliquen - pinctrl-0: defined for CPU_DAI@1 and CPU_DAI@4 to describe I2S PIOs for 4405e85d4eSArnaud Pouliquen external codecs connection. 4505e85d4eSArnaud Pouliquen 4605e85d4eSArnaud Pouliquen - pinctrl-names: should contain only one value - "default". 4705e85d4eSArnaud Pouliquen 4804adc084SArnaud Pouliquen - st,tdm-mode: to declare to set TDM mode for unireader and uniplayer IPs. 4904adc084SArnaud Pouliquen Only compartible with IPs in charge of the external I2S/TDM bus. 5004adc084SArnaud Pouliquen Should be declared depending on associated codec. 5104adc084SArnaud Pouliquen 5205e85d4eSArnaud PouliquenExample: 5305e85d4eSArnaud Pouliquen 54afc3bca4SRob Herring sti_uni_player1: sti-uni-player@8d81000 { 5504adc084SArnaud Pouliquen compatible = "st,stih407-uni-player-hdmi"; 56ee4c879bSMoise Gergaud #sound-dai-cells = <0>; 57ee4c879bSMoise Gergaud st,syscfg = <&syscfg_core>; 58ee4c879bSMoise Gergaud clocks = <&clk_s_d0_flexgen CLK_PCM_1>; 59ee4c879bSMoise Gergaud reg = <0x8D81000 0x158>; 60ee4c879bSMoise Gergaud interrupts = <GIC_SPI 85 IRQ_TYPE_NONE>; 61ee4c879bSMoise Gergaud dmas = <&fdma0 3 0 1>; 62ee4c879bSMoise Gergaud dma-names = "tx"; 6304adc084SArnaud Pouliquen st,tdm-mode = <1>; 64ee4c879bSMoise Gergaud }; 65ee4c879bSMoise Gergaud 66afc3bca4SRob Herring sti_uni_player2: sti-uni-player@8d82000 { 6704adc084SArnaud Pouliquen compatible = "st,stih407-uni-player-pcm-out"; 6805e85d4eSArnaud Pouliquen #sound-dai-cells = <0>; 6905e85d4eSArnaud Pouliquen st,syscfg = <&syscfg_core>; 7005e85d4eSArnaud Pouliquen clocks = <&clk_s_d0_flexgen CLK_PCM_2>; 7105e85d4eSArnaud Pouliquen reg = <0x8D82000 0x158>; 7205e85d4eSArnaud Pouliquen interrupts = <GIC_SPI 86 IRQ_TYPE_NONE>; 7305e85d4eSArnaud Pouliquen dmas = <&fdma0 4 0 1>; 7405e85d4eSArnaud Pouliquen dma-names = "tx"; 7505e85d4eSArnaud Pouliquen }; 7605e85d4eSArnaud Pouliquen 77afc3bca4SRob Herring sti_uni_player3: sti-uni-player@8d85000 { 7804adc084SArnaud Pouliquen compatible = "st,stih407-uni-player-spdif"; 7905e85d4eSArnaud Pouliquen #sound-dai-cells = <0>; 8005e85d4eSArnaud Pouliquen st,syscfg = <&syscfg_core>; 8105e85d4eSArnaud Pouliquen clocks = <&clk_s_d0_flexgen CLK_SPDIFF>; 8205e85d4eSArnaud Pouliquen reg = <0x8D85000 0x158>; 8305e85d4eSArnaud Pouliquen interrupts = <GIC_SPI 89 IRQ_TYPE_NONE>; 8405e85d4eSArnaud Pouliquen dmas = <&fdma0 7 0 1>; 8505e85d4eSArnaud Pouliquen dma-names = "tx"; 8605e85d4eSArnaud Pouliquen }; 8705e85d4eSArnaud Pouliquen 88afc3bca4SRob Herring sti_uni_reader1: sti-uni-reader@8d84000 { 8904adc084SArnaud Pouliquen compatible = "st,stih407-uni-reader-hdmi"; 9005e85d4eSArnaud Pouliquen #sound-dai-cells = <0>; 9105e85d4eSArnaud Pouliquen st,syscfg = <&syscfg_core>; 9205e85d4eSArnaud Pouliquen reg = <0x8D84000 0x158>; 9305e85d4eSArnaud Pouliquen interrupts = <GIC_SPI 88 IRQ_TYPE_NONE>; 9405e85d4eSArnaud Pouliquen dmas = <&fdma0 6 0 1>; 9505e85d4eSArnaud Pouliquen dma-names = "rx"; 9605e85d4eSArnaud Pouliquen }; 9705e85d4eSArnaud Pouliquen 9805e85d4eSArnaud Pouliquen2) sti-sas-codec: internal audio codec IPs driver 9905e85d4eSArnaud Pouliquen------------------------------------------------- 10005e85d4eSArnaud Pouliquen 10105e85d4eSArnaud PouliquenRequired properties: 10205e85d4eSArnaud Pouliquen - compatible: "st,sti<chip>-sas-codec" . 10305e85d4eSArnaud Pouliquen Should be chip "st,stih416-sas-codec" or "st,stih407-sas-codec" 10405e85d4eSArnaud Pouliquen 10505e85d4eSArnaud Pouliquen - st,syscfg: phandle to boot-device system configuration registers. 10605e85d4eSArnaud Pouliquen 10705e85d4eSArnaud Pouliquen - pinctrl-0: SPDIF PIO description. 10805e85d4eSArnaud Pouliquen 10905e85d4eSArnaud Pouliquen - pinctrl-names: should contain only one value - "default". 11005e85d4eSArnaud Pouliquen 11105e85d4eSArnaud PouliquenExample: 11205e85d4eSArnaud Pouliquen sti_sas_codec: sti-sas-codec { 11305e85d4eSArnaud Pouliquen compatible = "st,stih407-sas-codec"; 11405e85d4eSArnaud Pouliquen #sound-dai-cells = <1>; 11505e85d4eSArnaud Pouliquen st,reg_audio = <&syscfg_core>; 11605e85d4eSArnaud Pouliquen pinctrl-names = "default"; 11705e85d4eSArnaud Pouliquen pinctrl-0 = <&pinctrl_spdif_out >; 11805e85d4eSArnaud Pouliquen }; 11905e85d4eSArnaud Pouliquen 12005e85d4eSArnaud PouliquenExample of audio card declaration: 12105e85d4eSArnaud Pouliquen sound { 12205e85d4eSArnaud Pouliquen compatible = "simple-audio-card"; 12305e85d4eSArnaud Pouliquen simple-audio-card,name = "sti audio card"; 12405e85d4eSArnaud Pouliquen 12505e85d4eSArnaud Pouliquen simple-audio-card,dai-link@0 { 12605e85d4eSArnaud Pouliquen /* DAC */ 12705e85d4eSArnaud Pouliquen format = "i2s"; 12805e85d4eSArnaud Pouliquen dai-tdm-slot-width = <32>; 12905e85d4eSArnaud Pouliquen cpu { 13005e85d4eSArnaud Pouliquen sound-dai = <&sti_uni_player2>; 13105e85d4eSArnaud Pouliquen }; 13205e85d4eSArnaud Pouliquen 13305e85d4eSArnaud Pouliquen codec { 13405e85d4eSArnaud Pouliquen sound-dai = <&sti_sasg_codec 1>; 13505e85d4eSArnaud Pouliquen }; 13605e85d4eSArnaud Pouliquen }; 13705e85d4eSArnaud Pouliquen simple-audio-card,dai-link@1 { 13805e85d4eSArnaud Pouliquen /* SPDIF */ 13905e85d4eSArnaud Pouliquen format = "left_j"; 14005e85d4eSArnaud Pouliquen cpu { 14105e85d4eSArnaud Pouliquen sound-dai = <&sti_uni_player3>; 14205e85d4eSArnaud Pouliquen }; 14305e85d4eSArnaud Pouliquen 14405e85d4eSArnaud Pouliquen codec { 14505e85d4eSArnaud Pouliquen sound-dai = <&sti_sasg_codec 0>; 14605e85d4eSArnaud Pouliquen }; 14705e85d4eSArnaud Pouliquen }; 148ee4c879bSMoise Gergaud simple-audio-card,dai-link@2 { 149ee4c879bSMoise Gergaud /* TDM playback */ 150ee4c879bSMoise Gergaud format = "left_j"; 151ee4c879bSMoise Gergaud frame-inversion = <1>; 152ee4c879bSMoise Gergaud cpu { 153ee4c879bSMoise Gergaud sound-dai = <&sti_uni_player1>; 154ee4c879bSMoise Gergaud dai-tdm-slot-num = <16>; 155ee4c879bSMoise Gergaud dai-tdm-slot-width = <16>; 156ee4c879bSMoise Gergaud dai-tdm-slot-tx-mask = 157ee4c879bSMoise Gergaud <1 1 1 1 0 0 0 0 0 0 1 1 0 0 1 1>; 158ee4c879bSMoise Gergaud }; 159ee4c879bSMoise Gergaud 160ee4c879bSMoise Gergaud codec { 161ee4c879bSMoise Gergaud sound-dai = <&sti_sasg_codec 3>; 162ee4c879bSMoise Gergaud }; 163ee4c879bSMoise Gergaud }; 16405e85d4eSArnaud Pouliquen }; 165