1*c66ec88fSEmmanuel VadotSTMicroelectronics sti ASoC cards 2*c66ec88fSEmmanuel Vadot 3*c66ec88fSEmmanuel VadotThe sti ASoC Sound Card can be used, for all sti SoCs using internal sti-sas 4*c66ec88fSEmmanuel Vadotcodec or external codecs. 5*c66ec88fSEmmanuel Vadot 6*c66ec88fSEmmanuel Vadotsti sound drivers allows to expose sti SoC audio interface through the 7*c66ec88fSEmmanuel Vadotgeneric ASoC simple card. For details about sound card declaration please refer to 8*c66ec88fSEmmanuel VadotDocumentation/devicetree/bindings/sound/simple-card.yaml. 9*c66ec88fSEmmanuel Vadot 10*c66ec88fSEmmanuel Vadot1) sti-uniperiph-dai: audio dai device. 11*c66ec88fSEmmanuel Vadot--------------------------------------- 12*c66ec88fSEmmanuel Vadot 13*c66ec88fSEmmanuel VadotRequired properties: 14*c66ec88fSEmmanuel Vadot - compatible: "st,stih407-uni-player-hdmi", "st,stih407-uni-player-pcm-out", 15*c66ec88fSEmmanuel Vadot "st,stih407-uni-player-dac", "st,stih407-uni-player-spdif", 16*c66ec88fSEmmanuel Vadot "st,stih407-uni-reader-pcm_in", "st,stih407-uni-reader-hdmi", 17*c66ec88fSEmmanuel Vadot 18*c66ec88fSEmmanuel Vadot - st,syscfg: phandle to boot-device system configuration registers 19*c66ec88fSEmmanuel Vadot 20*c66ec88fSEmmanuel Vadot - clock-names: name of the clocks listed in clocks property in the same order 21*c66ec88fSEmmanuel Vadot 22*c66ec88fSEmmanuel Vadot - reg: CPU DAI IP Base address and size entries, listed in same 23*c66ec88fSEmmanuel Vadot order than the CPU_DAI properties. 24*c66ec88fSEmmanuel Vadot 25*c66ec88fSEmmanuel Vadot - reg-names: names of the mapped memory regions listed in regs property in 26*c66ec88fSEmmanuel Vadot the same order. 27*c66ec88fSEmmanuel Vadot 28*c66ec88fSEmmanuel Vadot - interrupts: CPU_DAI interrupt line, listed in the same order than the 29*c66ec88fSEmmanuel Vadot CPU_DAI properties. 30*c66ec88fSEmmanuel Vadot 31*c66ec88fSEmmanuel Vadot - dma: CPU_DAI DMA controller phandle and DMA request line, listed in the same 32*c66ec88fSEmmanuel Vadot order than the CPU_DAI properties. 33*c66ec88fSEmmanuel Vadot 34*c66ec88fSEmmanuel Vadot - dma-names: identifier string for each DMA request line in the dmas property. 35*c66ec88fSEmmanuel Vadot "tx" for "st,sti-uni-player" compatibility 36*c66ec88fSEmmanuel Vadot "rx" for "st,sti-uni-reader" compatibility 37*c66ec88fSEmmanuel Vadot 38*c66ec88fSEmmanuel VadotRequired properties ("st,sti-uni-player" compatibility only): 39*c66ec88fSEmmanuel Vadot - clocks: CPU_DAI IP clock source, listed in the same order than the 40*c66ec88fSEmmanuel Vadot CPU_DAI properties. 41*c66ec88fSEmmanuel Vadot 42*c66ec88fSEmmanuel VadotOptional properties: 43*c66ec88fSEmmanuel Vadot - pinctrl-0: defined for CPU_DAI@1 and CPU_DAI@4 to describe I2S PIOs for 44*c66ec88fSEmmanuel Vadot external codecs connection. 45*c66ec88fSEmmanuel Vadot 46*c66ec88fSEmmanuel Vadot - pinctrl-names: should contain only one value - "default". 47*c66ec88fSEmmanuel Vadot 48*c66ec88fSEmmanuel Vadot - st,tdm-mode: to declare to set TDM mode for unireader and uniplayer IPs. 49*c66ec88fSEmmanuel Vadot Only compartible with IPs in charge of the external I2S/TDM bus. 50*c66ec88fSEmmanuel Vadot Should be declared depending on associated codec. 51*c66ec88fSEmmanuel Vadot 52*c66ec88fSEmmanuel VadotExample: 53*c66ec88fSEmmanuel Vadot 54*c66ec88fSEmmanuel Vadot sti_uni_player1: sti-uni-player@8d81000 { 55*c66ec88fSEmmanuel Vadot compatible = "st,stih407-uni-player-hdmi"; 56*c66ec88fSEmmanuel Vadot #sound-dai-cells = <0>; 57*c66ec88fSEmmanuel Vadot st,syscfg = <&syscfg_core>; 58*c66ec88fSEmmanuel Vadot clocks = <&clk_s_d0_flexgen CLK_PCM_1>; 59*c66ec88fSEmmanuel Vadot reg = <0x8D81000 0x158>; 60*c66ec88fSEmmanuel Vadot interrupts = <GIC_SPI 85 IRQ_TYPE_NONE>; 61*c66ec88fSEmmanuel Vadot dmas = <&fdma0 3 0 1>; 62*c66ec88fSEmmanuel Vadot dma-names = "tx"; 63*c66ec88fSEmmanuel Vadot st,tdm-mode = <1>; 64*c66ec88fSEmmanuel Vadot }; 65*c66ec88fSEmmanuel Vadot 66*c66ec88fSEmmanuel Vadot sti_uni_player2: sti-uni-player@8d82000 { 67*c66ec88fSEmmanuel Vadot compatible = "st,stih407-uni-player-pcm-out"; 68*c66ec88fSEmmanuel Vadot #sound-dai-cells = <0>; 69*c66ec88fSEmmanuel Vadot st,syscfg = <&syscfg_core>; 70*c66ec88fSEmmanuel Vadot clocks = <&clk_s_d0_flexgen CLK_PCM_2>; 71*c66ec88fSEmmanuel Vadot reg = <0x8D82000 0x158>; 72*c66ec88fSEmmanuel Vadot interrupts = <GIC_SPI 86 IRQ_TYPE_NONE>; 73*c66ec88fSEmmanuel Vadot dmas = <&fdma0 4 0 1>; 74*c66ec88fSEmmanuel Vadot dma-names = "tx"; 75*c66ec88fSEmmanuel Vadot }; 76*c66ec88fSEmmanuel Vadot 77*c66ec88fSEmmanuel Vadot sti_uni_player3: sti-uni-player@8d85000 { 78*c66ec88fSEmmanuel Vadot compatible = "st,stih407-uni-player-spdif"; 79*c66ec88fSEmmanuel Vadot #sound-dai-cells = <0>; 80*c66ec88fSEmmanuel Vadot st,syscfg = <&syscfg_core>; 81*c66ec88fSEmmanuel Vadot clocks = <&clk_s_d0_flexgen CLK_SPDIFF>; 82*c66ec88fSEmmanuel Vadot reg = <0x8D85000 0x158>; 83*c66ec88fSEmmanuel Vadot interrupts = <GIC_SPI 89 IRQ_TYPE_NONE>; 84*c66ec88fSEmmanuel Vadot dmas = <&fdma0 7 0 1>; 85*c66ec88fSEmmanuel Vadot dma-names = "tx"; 86*c66ec88fSEmmanuel Vadot }; 87*c66ec88fSEmmanuel Vadot 88*c66ec88fSEmmanuel Vadot sti_uni_reader1: sti-uni-reader@8d84000 { 89*c66ec88fSEmmanuel Vadot compatible = "st,stih407-uni-reader-hdmi"; 90*c66ec88fSEmmanuel Vadot #sound-dai-cells = <0>; 91*c66ec88fSEmmanuel Vadot st,syscfg = <&syscfg_core>; 92*c66ec88fSEmmanuel Vadot reg = <0x8D84000 0x158>; 93*c66ec88fSEmmanuel Vadot interrupts = <GIC_SPI 88 IRQ_TYPE_NONE>; 94*c66ec88fSEmmanuel Vadot dmas = <&fdma0 6 0 1>; 95*c66ec88fSEmmanuel Vadot dma-names = "rx"; 96*c66ec88fSEmmanuel Vadot }; 97*c66ec88fSEmmanuel Vadot 98*c66ec88fSEmmanuel Vadot2) sti-sas-codec: internal audio codec IPs driver 99*c66ec88fSEmmanuel Vadot------------------------------------------------- 100*c66ec88fSEmmanuel Vadot 101*c66ec88fSEmmanuel VadotRequired properties: 102*c66ec88fSEmmanuel Vadot - compatible: "st,sti<chip>-sas-codec" . 103*c66ec88fSEmmanuel Vadot Should be chip "st,stih416-sas-codec" or "st,stih407-sas-codec" 104*c66ec88fSEmmanuel Vadot 105*c66ec88fSEmmanuel Vadot - st,syscfg: phandle to boot-device system configuration registers. 106*c66ec88fSEmmanuel Vadot 107*c66ec88fSEmmanuel Vadot - pinctrl-0: SPDIF PIO description. 108*c66ec88fSEmmanuel Vadot 109*c66ec88fSEmmanuel Vadot - pinctrl-names: should contain only one value - "default". 110*c66ec88fSEmmanuel Vadot 111*c66ec88fSEmmanuel VadotExample: 112*c66ec88fSEmmanuel Vadot sti_sas_codec: sti-sas-codec { 113*c66ec88fSEmmanuel Vadot compatible = "st,stih407-sas-codec"; 114*c66ec88fSEmmanuel Vadot #sound-dai-cells = <1>; 115*c66ec88fSEmmanuel Vadot st,reg_audio = <&syscfg_core>; 116*c66ec88fSEmmanuel Vadot pinctrl-names = "default"; 117*c66ec88fSEmmanuel Vadot pinctrl-0 = <&pinctrl_spdif_out >; 118*c66ec88fSEmmanuel Vadot }; 119*c66ec88fSEmmanuel Vadot 120*c66ec88fSEmmanuel VadotExample of audio card declaration: 121*c66ec88fSEmmanuel Vadot sound { 122*c66ec88fSEmmanuel Vadot compatible = "simple-audio-card"; 123*c66ec88fSEmmanuel Vadot simple-audio-card,name = "sti audio card"; 124*c66ec88fSEmmanuel Vadot 125*c66ec88fSEmmanuel Vadot simple-audio-card,dai-link@0 { 126*c66ec88fSEmmanuel Vadot /* DAC */ 127*c66ec88fSEmmanuel Vadot format = "i2s"; 128*c66ec88fSEmmanuel Vadot dai-tdm-slot-width = <32>; 129*c66ec88fSEmmanuel Vadot cpu { 130*c66ec88fSEmmanuel Vadot sound-dai = <&sti_uni_player2>; 131*c66ec88fSEmmanuel Vadot }; 132*c66ec88fSEmmanuel Vadot 133*c66ec88fSEmmanuel Vadot codec { 134*c66ec88fSEmmanuel Vadot sound-dai = <&sti_sasg_codec 1>; 135*c66ec88fSEmmanuel Vadot }; 136*c66ec88fSEmmanuel Vadot }; 137*c66ec88fSEmmanuel Vadot simple-audio-card,dai-link@1 { 138*c66ec88fSEmmanuel Vadot /* SPDIF */ 139*c66ec88fSEmmanuel Vadot format = "left_j"; 140*c66ec88fSEmmanuel Vadot cpu { 141*c66ec88fSEmmanuel Vadot sound-dai = <&sti_uni_player3>; 142*c66ec88fSEmmanuel Vadot }; 143*c66ec88fSEmmanuel Vadot 144*c66ec88fSEmmanuel Vadot codec { 145*c66ec88fSEmmanuel Vadot sound-dai = <&sti_sasg_codec 0>; 146*c66ec88fSEmmanuel Vadot }; 147*c66ec88fSEmmanuel Vadot }; 148*c66ec88fSEmmanuel Vadot simple-audio-card,dai-link@2 { 149*c66ec88fSEmmanuel Vadot /* TDM playback */ 150*c66ec88fSEmmanuel Vadot format = "left_j"; 151*c66ec88fSEmmanuel Vadot frame-inversion = <1>; 152*c66ec88fSEmmanuel Vadot cpu { 153*c66ec88fSEmmanuel Vadot sound-dai = <&sti_uni_player1>; 154*c66ec88fSEmmanuel Vadot dai-tdm-slot-num = <16>; 155*c66ec88fSEmmanuel Vadot dai-tdm-slot-width = <16>; 156*c66ec88fSEmmanuel Vadot dai-tdm-slot-tx-mask = 157*c66ec88fSEmmanuel Vadot <1 1 1 1 0 0 0 0 0 0 1 1 0 0 1 1>; 158*c66ec88fSEmmanuel Vadot }; 159*c66ec88fSEmmanuel Vadot 160*c66ec88fSEmmanuel Vadot codec { 161*c66ec88fSEmmanuel Vadot sound-dai = <&sti_sasg_codec 3>; 162*c66ec88fSEmmanuel Vadot }; 163*c66ec88fSEmmanuel Vadot }; 164*c66ec88fSEmmanuel Vadot }; 165