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