190e8e50fSKuninori MorimotoRenesas R-Car sound 290e8e50fSKuninori Morimoto 3f1511a14SKuninori Morimoto============================================= 4f1511a14SKuninori Morimoto* Modules 5f1511a14SKuninori Morimoto============================================= 6f1511a14SKuninori Morimoto 7f1511a14SKuninori MorimotoRenesas R-Car sound is constructed from below modules 8f1511a14SKuninori Morimoto(for Gen2 or later) 9f1511a14SKuninori Morimoto 10f1511a14SKuninori Morimoto SCU : Sampling Rate Converter Unit 11f1511a14SKuninori Morimoto - SRC : Sampling Rate Converter 12f1511a14SKuninori Morimoto - CMD 13f1511a14SKuninori Morimoto - CTU : Channel Transfer Unit 14f1511a14SKuninori Morimoto - MIX : Mixer 15f1511a14SKuninori Morimoto - DVC : Digital Volume and Mute Function 16f1511a14SKuninori Morimoto SSIU : Serial Sound Interface Unit 17f1511a14SKuninori Morimoto SSI : Serial Sound Interface 18f1511a14SKuninori Morimoto 19f1511a14SKuninori MorimotoSee detail of each module's channels, connection, limitation on datasheet 20f1511a14SKuninori Morimoto 21f1511a14SKuninori Morimoto============================================= 22f1511a14SKuninori Morimoto* Multi channel 23f1511a14SKuninori Morimoto============================================= 24f1511a14SKuninori Morimoto 25f1511a14SKuninori MorimotoMulti channel is supported by Multi-SSI, or TDM-SSI. 26f1511a14SKuninori Morimoto 27f1511a14SKuninori Morimoto Multi-SSI : 6ch case, you can use stereo x 3 SSI 28f1511a14SKuninori Morimoto TDM-SSI : 6ch case, you can use TDM 29f1511a14SKuninori Morimoto 30f1511a14SKuninori Morimoto============================================= 31f1511a14SKuninori Morimoto* Enable/Disable each modules 32f1511a14SKuninori Morimoto============================================= 33f1511a14SKuninori Morimoto 34f1511a14SKuninori MorimotoSee datasheet to check SRC/CTU/MIX/DVC connect-limitation. 35f1511a14SKuninori MorimotoDT controls enabling/disabling module. 36f1511a14SKuninori Morimoto${LINUX}/arch/arm/boot/dts/r8a7790-lager.dts can be good example. 37f1511a14SKuninori MorimotoThis is example of 38f1511a14SKuninori Morimoto 39f1511a14SKuninori MorimotoPlayback: [MEM] -> [SRC2] -> [DVC0] -> [SSIU0/SSI0] -> [codec] 40f1511a14SKuninori MorimotoCapture: [MEM] <- [DVC1] <- [SRC3] <- [SSIU1/SSI1] <- [codec] 41f1511a14SKuninori Morimoto 42f1511a14SKuninori Morimoto &rcar_sound { 43f1511a14SKuninori Morimoto ... 44f1511a14SKuninori Morimoto rcar_sound,dai { 45f1511a14SKuninori Morimoto dai0 { 46f1511a14SKuninori Morimoto playback = <&ssi0 &src2 &dvc0>; 47f1511a14SKuninori Morimoto capture = <&ssi1 &src3 &dvc1>; 48f1511a14SKuninori Morimoto }; 49f1511a14SKuninori Morimoto }; 50f1511a14SKuninori Morimoto }; 51f1511a14SKuninori Morimoto 52f1511a14SKuninori MorimotoYou can use below. 53f1511a14SKuninori Morimoto${LINUX}/arch/arm/boot/dts/r8a7790.dts can be good example. 54f1511a14SKuninori Morimoto 55f1511a14SKuninori Morimoto &src0 &ctu00 &mix0 &dvc0 &ssi0 56f1511a14SKuninori Morimoto &src1 &ctu01 &mix1 &dvc1 &ssi1 57f1511a14SKuninori Morimoto &src2 &ctu02 &ssi2 58f1511a14SKuninori Morimoto &src3 &ctu03 &ssi3 59f1511a14SKuninori Morimoto &src4 &ssi4 60f1511a14SKuninori Morimoto &src5 &ctu10 &ssi5 61f1511a14SKuninori Morimoto &src6 &ctu11 &ssi6 62f1511a14SKuninori Morimoto &src7 &ctu12 &ssi7 63f1511a14SKuninori Morimoto &src8 &ctu13 &ssi8 64f1511a14SKuninori Morimoto &src9 &ssi9 65f1511a14SKuninori Morimoto 66f1511a14SKuninori Morimoto============================================= 67f1511a14SKuninori Morimoto* SRC (Sampling Rate Converter) 68f1511a14SKuninori Morimoto============================================= 69f1511a14SKuninori Morimoto 70f1511a14SKuninori Morimoto [xx]Hz [yy]Hz 71f1511a14SKuninori Morimoto ------> [SRC] ------> 72f1511a14SKuninori Morimoto 73f1511a14SKuninori MorimotoSRC can convert [xx]Hz to [yy]Hz. Then, it has below 2 modes 74f1511a14SKuninori Morimoto 75f1511a14SKuninori Morimoto Asynchronous mode: input data / output data are based on different clocks. 76f1511a14SKuninori Morimoto you can use this mode on Playback / Capture 77f1511a14SKuninori Morimoto Synchronous mode: input data / output data are based on same clocks. 78f1511a14SKuninori Morimoto This mode will be used if system doesn't have its input clock, 79f1511a14SKuninori Morimoto for example digital TV case. 80f1511a14SKuninori Morimoto you can use this mode on Playback 81f1511a14SKuninori Morimoto 82f1511a14SKuninori Morimoto------------------ 83f1511a14SKuninori Morimoto** Asynchronous mode 84f1511a14SKuninori Morimoto------------------ 85f1511a14SKuninori Morimoto 860378bb96SKuninori MorimotoYou need to use "simple-scu-audio-card" sound card for it. 87f1511a14SKuninori Morimotoexample) 88f1511a14SKuninori Morimoto 89f1511a14SKuninori Morimoto sound { 900378bb96SKuninori Morimoto compatible = "simple-scu-audio-card"; 91f1511a14SKuninori Morimoto ... 92f1511a14SKuninori Morimoto /* 93f1511a14SKuninori Morimoto * SRC Asynchronous mode setting 94f1511a14SKuninori Morimoto * Playback: 95f1511a14SKuninori Morimoto * All input data will be converted to 48kHz 96f1511a14SKuninori Morimoto * Capture: 97f1511a14SKuninori Morimoto * Inputed 48kHz data will be converted to 98f1511a14SKuninori Morimoto * system specified Hz 99f1511a14SKuninori Morimoto */ 1000378bb96SKuninori Morimoto simple-audio-card,convert-rate = <48000>; 101f1511a14SKuninori Morimoto ... 1020378bb96SKuninori Morimoto simple-audio-card,cpu { 103f1511a14SKuninori Morimoto sound-dai = <&rcar_sound>; 104f1511a14SKuninori Morimoto }; 1050378bb96SKuninori Morimoto simple-audio-card,codec { 106f1511a14SKuninori Morimoto ... 107f1511a14SKuninori Morimoto }; 108f1511a14SKuninori Morimoto }; 109f1511a14SKuninori Morimoto 110f1511a14SKuninori Morimoto------------------ 111f1511a14SKuninori Morimoto** Synchronous mode 112f1511a14SKuninori Morimoto------------------ 113f1511a14SKuninori Morimoto 114f1511a14SKuninori Morimoto > amixer set "SRC Out Rate" on 115f1511a14SKuninori Morimoto > aplay xxxx.wav 116f1511a14SKuninori Morimoto > amixer set "SRC Out Rate" 48000 117f1511a14SKuninori Morimoto > amixer set "SRC Out Rate" 44100 118f1511a14SKuninori Morimoto 119f1511a14SKuninori Morimoto============================================= 120f1511a14SKuninori Morimoto* CTU (Channel Transfer Unit) 121f1511a14SKuninori Morimoto============================================= 122f1511a14SKuninori Morimoto 123f1511a14SKuninori Morimoto [xx]ch [yy]ch 124f1511a14SKuninori Morimoto ------> [CTU] --------> 125f1511a14SKuninori Morimoto 126f1511a14SKuninori MorimotoCTU can convert [xx]ch to [yy]ch, or exchange outputed channel. 127f1511a14SKuninori MorimotoCTU conversion needs matrix settings. 128f1511a14SKuninori MorimotoFor more detail information, see below 129f1511a14SKuninori Morimoto 130f1511a14SKuninori Morimoto Renesas R-Car datasheet 131f1511a14SKuninori Morimoto - Sampling Rate Converter Unit (SCU) 132f1511a14SKuninori Morimoto - SCU Operation 133f1511a14SKuninori Morimoto - CMD Block 134f1511a14SKuninori Morimoto - Functional Blocks in CMD 135f1511a14SKuninori Morimoto 136f1511a14SKuninori Morimoto Renesas R-Car datasheet 137f1511a14SKuninori Morimoto - Sampling Rate Converter Unit (SCU) 138f1511a14SKuninori Morimoto - Register Description 139f1511a14SKuninori Morimoto - CTUn Scale Value exx Register (CTUn_SVxxR) 140f1511a14SKuninori Morimoto 141f1511a14SKuninori Morimoto ${LINUX}/sound/soc/sh/rcar/ctu.c 142f1511a14SKuninori Morimoto - comment of header 143f1511a14SKuninori Morimoto 1440378bb96SKuninori MorimotoYou need to use "simple-scu-audio-card" sound card for it. 145f1511a14SKuninori Morimotoexample) 146f1511a14SKuninori Morimoto 147f1511a14SKuninori Morimoto sound { 1480378bb96SKuninori Morimoto compatible = "simple-scu-audio-card"; 149f1511a14SKuninori Morimoto ... 150f1511a14SKuninori Morimoto /* 151f1511a14SKuninori Morimoto * CTU setting 152f1511a14SKuninori Morimoto * All input data will be converted to 2ch 153f1511a14SKuninori Morimoto * as output data 154f1511a14SKuninori Morimoto */ 1550378bb96SKuninori Morimoto simple-audio-card,convert-channels = <2>; 156f1511a14SKuninori Morimoto ... 1570378bb96SKuninori Morimoto simple-audio-card,cpu { 158f1511a14SKuninori Morimoto sound-dai = <&rcar_sound>; 159f1511a14SKuninori Morimoto }; 1600378bb96SKuninori Morimoto simple-audio-card,codec { 161f1511a14SKuninori Morimoto ... 162f1511a14SKuninori Morimoto }; 163f1511a14SKuninori Morimoto }; 164f1511a14SKuninori Morimoto 165f1511a14SKuninori MorimotoEx) Exchange output channel 166f1511a14SKuninori Morimoto Input -> Output 167f1511a14SKuninori Morimoto 1ch -> 0ch 168f1511a14SKuninori Morimoto 0ch -> 1ch 169f1511a14SKuninori Morimoto 170f1511a14SKuninori Morimoto example of using matrix 171f1511a14SKuninori Morimoto output 0ch = (input 0ch x 0) + (input 1ch x 1) 172f1511a14SKuninori Morimoto output 1ch = (input 0ch x 1) + (input 1ch x 0) 173f1511a14SKuninori Morimoto 174f1511a14SKuninori Morimoto amixer set "CTU Reset" on 175f1511a14SKuninori Morimoto amixer set "CTU Pass" 9,10 176f1511a14SKuninori Morimoto amixer set "CTU SV0" 0,4194304 177f1511a14SKuninori Morimoto amixer set "CTU SV1" 4194304,0 178f1511a14SKuninori Morimoto 179f1511a14SKuninori Morimoto example of changing connection 180f1511a14SKuninori Morimoto amixer set "CTU Reset" on 181f1511a14SKuninori Morimoto amixer set "CTU Pass" 2,1 182f1511a14SKuninori Morimoto 183f1511a14SKuninori Morimoto============================================= 184f1511a14SKuninori Morimoto* MIX (Mixer) 185f1511a14SKuninori Morimoto============================================= 186f1511a14SKuninori Morimoto 187f1511a14SKuninori MorimotoMIX merges 2 sounds path. You can see 2 sound interface on system, 188f1511a14SKuninori Morimotoand these sounds will be merged by MIX. 189f1511a14SKuninori Morimoto 190f1511a14SKuninori Morimoto aplay -D plughw:0,0 xxxx.wav & 191f1511a14SKuninori Morimoto aplay -D plughw:0,1 yyyy.wav 192f1511a14SKuninori Morimoto 1930378bb96SKuninori MorimotoYou need to use "simple-scu-audio-card" sound card for it. 194f1511a14SKuninori MorimotoEx) 195f1511a14SKuninori Morimoto [MEM] -> [SRC1] -> [CTU02] -+-> [MIX0] -> [DVC0] -> [SSI0] 196f1511a14SKuninori Morimoto | 197f1511a14SKuninori Morimoto [MEM] -> [SRC2] -> [CTU03] -+ 198f1511a14SKuninori Morimoto 199f1511a14SKuninori Morimoto sound { 2000378bb96SKuninori Morimoto compatible = "simple-scu-audio-card"; 201f1511a14SKuninori Morimoto ... 2020378bb96SKuninori Morimoto simple-audio-card,cpu@0 { 203f1511a14SKuninori Morimoto sound-dai = <&rcar_sound 0>; 204f1511a14SKuninori Morimoto }; 2050378bb96SKuninori Morimoto simple-audio-card,cpu@1 { 206f1511a14SKuninori Morimoto sound-dai = <&rcar_sound 1>; 207f1511a14SKuninori Morimoto }; 2080378bb96SKuninori Morimoto simple-audio-card,codec { 209f1511a14SKuninori Morimoto ... 210f1511a14SKuninori Morimoto }; 211f1511a14SKuninori Morimoto }; 212f1511a14SKuninori Morimoto 213f1511a14SKuninori Morimoto &rcar_sound { 214f1511a14SKuninori Morimoto ... 215f1511a14SKuninori Morimoto rcar_sound,dai { 216f1511a14SKuninori Morimoto dai0 { 217f1511a14SKuninori Morimoto playback = <&src1 &ctu02 &mix0 &dvc0 &ssi0>; 218f1511a14SKuninori Morimoto }; 219f1511a14SKuninori Morimoto dai1 { 220f1511a14SKuninori Morimoto playback = <&src2 &ctu03 &mix0 &dvc0 &ssi0>; 221f1511a14SKuninori Morimoto }; 222f1511a14SKuninori Morimoto }; 223f1511a14SKuninori Morimoto }; 224f1511a14SKuninori Morimoto 225f1511a14SKuninori Morimoto============================================= 226f1511a14SKuninori Morimoto* DVC (Digital Volume and Mute Function) 227f1511a14SKuninori Morimoto============================================= 228f1511a14SKuninori Morimoto 229f1511a14SKuninori MorimotoDVC controls Playback/Capture volume. 230f1511a14SKuninori Morimoto 231f1511a14SKuninori MorimotoPlayback Volume 232f1511a14SKuninori Morimoto amixer set "DVC Out" 100% 233f1511a14SKuninori Morimoto 234f1511a14SKuninori MorimotoCapture Volume 235f1511a14SKuninori Morimoto amixer set "DVC In" 100% 236f1511a14SKuninori Morimoto 237f1511a14SKuninori MorimotoPlayback Mute 238f1511a14SKuninori Morimoto amixer set "DVC Out Mute" on 239f1511a14SKuninori Morimoto 240f1511a14SKuninori MorimotoCapture Mute 241f1511a14SKuninori Morimoto amixer set "DVC In Mute" on 242f1511a14SKuninori Morimoto 243f1511a14SKuninori MorimotoVolume Ramp 244f1511a14SKuninori Morimoto amixer set "DVC Out Ramp Up Rate" "0.125 dB/64 steps" 245f1511a14SKuninori Morimoto amixer set "DVC Out Ramp Down Rate" "0.125 dB/512 steps" 246f1511a14SKuninori Morimoto amixer set "DVC Out Ramp" on 247f1511a14SKuninori Morimoto aplay xxx.wav & 248f1511a14SKuninori Morimoto amixer set "DVC Out" 80% // Volume Down 249f1511a14SKuninori Morimoto amixer set "DVC Out" 100% // Volume Up 250f1511a14SKuninori Morimoto 251f1511a14SKuninori Morimoto============================================= 252f1511a14SKuninori Morimoto* SSIU (Serial Sound Interface Unit) 253f1511a14SKuninori Morimoto============================================= 254f1511a14SKuninori Morimoto 255f1511a14SKuninori MorimotoThere is no DT settings for SSIU, because SSIU will be automatically 256f1511a14SKuninori Morimotoselected via SSI. 257f1511a14SKuninori MorimotoSSIU can avoid some under/over run error, because it has some buffer. 258f1511a14SKuninori MorimotoBut you can't use it if SSI was PIO mode. 259f1511a14SKuninori MorimotoIn DMA mode, you can select not to use SSIU by using "no-busif" on DT. 260f1511a14SKuninori Morimoto 261f1511a14SKuninori Morimoto &ssi0 { 262f1511a14SKuninori Morimoto no-busif; 263f1511a14SKuninori Morimoto }; 264f1511a14SKuninori Morimoto 265f1511a14SKuninori Morimoto============================================= 266f1511a14SKuninori Morimoto* SSI (Serial Sound Interface) 267f1511a14SKuninori Morimoto============================================= 268f1511a14SKuninori Morimoto 269f1511a14SKuninori Morimoto** PIO mode 270f1511a14SKuninori Morimoto 271f1511a14SKuninori MorimotoYou can use PIO mode which is for connection check by using. 272f1511a14SKuninori MorimotoNote: The system will drop non-SSI modules in PIO mode 273f1511a14SKuninori Morimotoeven though if DT is selecting other modules. 274f1511a14SKuninori Morimoto 275f1511a14SKuninori Morimoto &ssi0 { 276f1511a14SKuninori Morimoto pio-transfer 277f1511a14SKuninori Morimoto }; 278f1511a14SKuninori Morimoto 279f1511a14SKuninori Morimoto** DMA mode without SSIU 280f1511a14SKuninori Morimoto 281f1511a14SKuninori MorimotoYou can use DMA without SSIU. 282f1511a14SKuninori MorimotoNote: under/over run, or noise are likely to occur 283f1511a14SKuninori Morimoto 284f1511a14SKuninori Morimoto &ssi0 { 285f1511a14SKuninori Morimoto no-busif; 286f1511a14SKuninori Morimoto }; 287f1511a14SKuninori Morimoto 288f1511a14SKuninori Morimoto** PIN sharing 289f1511a14SKuninori Morimoto 290f1511a14SKuninori MorimotoEach SSI can share WS pin. It is based on platform. 291f1511a14SKuninori MorimotoThis is example if SSI1 want to share WS pin with SSI0 292f1511a14SKuninori Morimoto 293f1511a14SKuninori Morimoto &ssi1 { 294f1511a14SKuninori Morimoto shared-pin; 295f1511a14SKuninori Morimoto }; 296f1511a14SKuninori Morimoto 297f1511a14SKuninori Morimoto** Multi-SSI 298f1511a14SKuninori Morimoto 299f1511a14SKuninori MorimotoYou can use Multi-SSI. 300f1511a14SKuninori MorimotoThis is example of SSI0/SSI1/SSI2 (= for 6ch) 301f1511a14SKuninori Morimoto 302f1511a14SKuninori Morimoto &rcar_sound { 303f1511a14SKuninori Morimoto ... 304f1511a14SKuninori Morimoto rcar_sound,dai { 305f1511a14SKuninori Morimoto dai0 { 306f1511a14SKuninori Morimoto playback = <&ssi0 &ssi1 &ssi2 &src0 &dvc0>; 307f1511a14SKuninori Morimoto }; 308f1511a14SKuninori Morimoto }; 309f1511a14SKuninori Morimoto }; 310f1511a14SKuninori Morimoto 311f1511a14SKuninori Morimoto** TDM-SSI 312f1511a14SKuninori Morimoto 313f1511a14SKuninori MorimotoYou can use TDM with SSI. 314f1511a14SKuninori MorimotoThis is example of TDM 6ch. 315f1511a14SKuninori MorimotoDriver can automatically switches TDM <-> stereo mode in this case. 316f1511a14SKuninori Morimoto 317f1511a14SKuninori Morimoto rsnd_tdm: sound { 318f1511a14SKuninori Morimoto compatible = "simple-audio-card"; 319f1511a14SKuninori Morimoto ... 320f1511a14SKuninori Morimoto simple-audio-card,cpu { 321f1511a14SKuninori Morimoto /* system can use TDM 6ch */ 322f1511a14SKuninori Morimoto dai-tdm-slot-num = <6>; 323f1511a14SKuninori Morimoto sound-dai = <&rcar_sound>; 324f1511a14SKuninori Morimoto }; 325f1511a14SKuninori Morimoto simple-audio-card,codec { 326f1511a14SKuninori Morimoto ... 327f1511a14SKuninori Morimoto }; 328f1511a14SKuninori Morimoto }; 329f1511a14SKuninori Morimoto 330f1511a14SKuninori Morimoto 331f1511a14SKuninori Morimoto============================================= 33290e8e50fSKuninori MorimotoRequired properties: 333f1511a14SKuninori Morimoto============================================= 334f1511a14SKuninori Morimoto 33556ba98acSGeert Uytterhoeven- compatible : "renesas,rcar_sound-<soctype>", fallbacks 33656ba98acSGeert Uytterhoeven "renesas,rcar_sound-gen1" if generation1, and 33790e8e50fSKuninori Morimoto "renesas,rcar_sound-gen2" if generation2 338ac37a45bSKuninori Morimoto "renesas,rcar_sound-gen3" if generation3 33956ba98acSGeert Uytterhoeven Examples with soctypes are: 3407667f716SGeert Uytterhoeven - "renesas,rcar_sound-r8a7778" (R-Car M1A) 3414eb404d0SSimon Horman - "renesas,rcar_sound-r8a7779" (R-Car H1) 34256ba98acSGeert Uytterhoeven - "renesas,rcar_sound-r8a7790" (R-Car H2) 34356ba98acSGeert Uytterhoeven - "renesas,rcar_sound-r8a7791" (R-Car M2-W) 3444eb404d0SSimon Horman - "renesas,rcar_sound-r8a7793" (R-Car M2-N) 3454eb404d0SSimon Horman - "renesas,rcar_sound-r8a7794" (R-Car E2) 346ac37a45bSKuninori Morimoto - "renesas,rcar_sound-r8a7795" (R-Car H3) 34790e8e50fSKuninori Morimoto- reg : Should contain the register physical address. 34890e8e50fSKuninori Morimoto required register is 34990e8e50fSKuninori Morimoto SRU/ADG/SSI if generation1 35090e8e50fSKuninori Morimoto SRU/ADG/SSIU/SSI if generation2 3518bab0dd5SKuninori Morimoto- rcar_sound,ssi : Should contain SSI feature. 3528bab0dd5SKuninori Morimoto The number of SSI subnode should be same as HW. 3538bab0dd5SKuninori Morimoto see below for detail. 3548bab0dd5SKuninori Morimoto- rcar_sound,src : Should contain SRC feature. 3558bab0dd5SKuninori Morimoto The number of SRC subnode should be same as HW. 3568bab0dd5SKuninori Morimoto see below for detail. 3579269e3c3SKuninori Morimoto- rcar_sound,ctu : Should contain CTU feature. 3589269e3c3SKuninori Morimoto The number of CTU subnode should be same as HW. 3599269e3c3SKuninori Morimoto see below for detail. 36070fb1052SKuninori Morimoto- rcar_sound,mix : Should contain MIX feature. 36170fb1052SKuninori Morimoto The number of MIX subnode should be same as HW. 36270fb1052SKuninori Morimoto see below for detail. 36334cb6123SKuninori Morimoto- rcar_sound,dvc : Should contain DVC feature. 36434cb6123SKuninori Morimoto The number of DVC subnode should be same as HW. 36534cb6123SKuninori Morimoto see below for detail. 3668bab0dd5SKuninori Morimoto- rcar_sound,dai : DAI contents. 3678bab0dd5SKuninori Morimoto The number of DAI subnode should be same as HW. 3688bab0dd5SKuninori Morimoto see below for detail. 369e3d2cec8SKuninori Morimoto- #sound-dai-cells : it must be 0 if your system is using single DAI 370e3d2cec8SKuninori Morimoto it must be 1 if your system is using multi DAI 371*5b3889f8SKuninori Morimoto- clocks : References to SSI/SRC/MIX/CTU/DVC/AUDIO_CLK clocks. 372*5b3889f8SKuninori Morimoto- clock-names : List of necessary clock names. 373*5b3889f8SKuninori Morimoto "ssi-all", "ssi.X", "src.X", "mix.X", "ctu.X", 374*5b3889f8SKuninori Morimoto "dvc.X", "clk_a", "clk_b", "clk_c", "clk_i" 375209c0907SKuninori Morimoto 376209c0907SKuninori MorimotoOptional properties: 3772a46db4aSKuninori Morimoto- #clock-cells : it must be 0 if your system has audio_clkout 3782a46db4aSKuninori Morimoto it must be 1 if your system has audio_clkout0/1/2/3 3792a46db4aSKuninori Morimoto- clock-frequency : for all audio_clkout0/1/2/3 3807dc20319SKuninori Morimoto- clkout-lr-asynchronous : boolean property. it indicates that audio_clkoutn 3817dc20319SKuninori Morimoto is asynchronizes with lr-clock. 38290e8e50fSKuninori Morimoto 38390e8e50fSKuninori MorimotoSSI subnode properties: 38490e8e50fSKuninori Morimoto- interrupts : Should contain SSI interrupt for PIO transfer 38590e8e50fSKuninori Morimoto- shared-pin : if shared clock pin 386199e7688SKuninori Morimoto- pio-transfer : use PIO transfer mode 387d9288d0bSKuninori Morimoto- no-busif : BUSIF is not ussed when [mem -> SSI] via DMA case 388e80a2fb1SKuninori Morimoto- dma : Should contain Audio DMAC entry 389e80a2fb1SKuninori Morimoto- dma-names : SSI case "rx" (=playback), "tx" (=capture) 390e80a2fb1SKuninori Morimoto SSIU case "rxu" (=playback), "txu" (=capture) 39190e8e50fSKuninori Morimoto 3928bab0dd5SKuninori MorimotoSRC subnode properties: 393e80a2fb1SKuninori Morimoto- dma : Should contain Audio DMAC entry 394e80a2fb1SKuninori Morimoto- dma-names : "rx" (=playback), "tx" (=capture) 395e80a2fb1SKuninori Morimoto 396e80a2fb1SKuninori MorimotoDVC subnode properties: 397e80a2fb1SKuninori Morimoto- dma : Should contain Audio DMAC entry 398e80a2fb1SKuninori Morimoto- dma-names : "tx" (=playback/capture) 3998bab0dd5SKuninori Morimoto 40090e8e50fSKuninori MorimotoDAI subnode properties: 40190e8e50fSKuninori Morimoto- playback : list of playback modules 40290e8e50fSKuninori Morimoto- capture : list of capture modules 40390e8e50fSKuninori Morimoto 404f1511a14SKuninori Morimoto 405f1511a14SKuninori Morimoto============================================= 40690e8e50fSKuninori MorimotoExample: 407f1511a14SKuninori Morimoto============================================= 40890e8e50fSKuninori Morimoto 409596f74ecSGeert Uytterhoevenrcar_sound: sound@ec500000 { 41090e8e50fSKuninori Morimoto #sound-dai-cells = <1>; 41156ba98acSGeert Uytterhoeven compatible = "renesas,rcar_sound-r8a7791", "renesas,rcar_sound-gen2"; 41290e8e50fSKuninori Morimoto reg = <0 0xec500000 0 0x1000>, /* SCU */ 41390e8e50fSKuninori Morimoto <0 0xec5a0000 0 0x100>, /* ADG */ 41490e8e50fSKuninori Morimoto <0 0xec540000 0 0x1000>, /* SSIU */ 415d3b1c0baSKuninori Morimoto <0 0xec541000 0 0x1280>, /* SSI */ 416d3b1c0baSKuninori Morimoto <0 0xec740000 0 0x200>; /* Audio DMAC peri peri*/ 417d3b1c0baSKuninori Morimoto reg-names = "scu", "adg", "ssiu", "ssi", "audmapp"; 41890e8e50fSKuninori Morimoto 419bb02714fSKuninori Morimoto clocks = <&mstp10_clks R8A7790_CLK_SSI_ALL>, 420bb02714fSKuninori Morimoto <&mstp10_clks R8A7790_CLK_SSI9>, <&mstp10_clks R8A7790_CLK_SSI8>, 421bb02714fSKuninori Morimoto <&mstp10_clks R8A7790_CLK_SSI7>, <&mstp10_clks R8A7790_CLK_SSI6>, 422bb02714fSKuninori Morimoto <&mstp10_clks R8A7790_CLK_SSI5>, <&mstp10_clks R8A7790_CLK_SSI4>, 423bb02714fSKuninori Morimoto <&mstp10_clks R8A7790_CLK_SSI3>, <&mstp10_clks R8A7790_CLK_SSI2>, 424bb02714fSKuninori Morimoto <&mstp10_clks R8A7790_CLK_SSI1>, <&mstp10_clks R8A7790_CLK_SSI0>, 425bb02714fSKuninori Morimoto <&mstp10_clks R8A7790_CLK_SCU_SRC9>, <&mstp10_clks R8A7790_CLK_SCU_SRC8>, 426bb02714fSKuninori Morimoto <&mstp10_clks R8A7790_CLK_SCU_SRC7>, <&mstp10_clks R8A7790_CLK_SCU_SRC6>, 427bb02714fSKuninori Morimoto <&mstp10_clks R8A7790_CLK_SCU_SRC5>, <&mstp10_clks R8A7790_CLK_SCU_SRC4>, 428bb02714fSKuninori Morimoto <&mstp10_clks R8A7790_CLK_SCU_SRC3>, <&mstp10_clks R8A7790_CLK_SCU_SRC2>, 429bb02714fSKuninori Morimoto <&mstp10_clks R8A7790_CLK_SCU_SRC1>, <&mstp10_clks R8A7790_CLK_SCU_SRC0>, 430bb02714fSKuninori Morimoto <&mstp10_clks R8A7790_CLK_SCU_DVC0>, <&mstp10_clks R8A7790_CLK_SCU_DVC1>, 431bb02714fSKuninori Morimoto <&audio_clk_a>, <&audio_clk_b>, <&audio_clk_c>, <&m2_clk>; 432bb02714fSKuninori Morimoto clock-names = "ssi-all", 433bb02714fSKuninori Morimoto "ssi.9", "ssi.8", "ssi.7", "ssi.6", "ssi.5", 434bb02714fSKuninori Morimoto "ssi.4", "ssi.3", "ssi.2", "ssi.1", "ssi.0", 435bb02714fSKuninori Morimoto "src.9", "src.8", "src.7", "src.6", "src.5", 436bb02714fSKuninori Morimoto "src.4", "src.3", "src.2", "src.1", "src.0", 437bb02714fSKuninori Morimoto "dvc.0", "dvc.1", 438bb02714fSKuninori Morimoto "clk_a", "clk_b", "clk_c", "clk_i"; 439bb02714fSKuninori Morimoto 44034cb6123SKuninori Morimoto rcar_sound,dvc { 441e80a2fb1SKuninori Morimoto dvc0: dvc@0 { 442e80a2fb1SKuninori Morimoto dmas = <&audma0 0xbc>; 443e80a2fb1SKuninori Morimoto dma-names = "tx"; 444e80a2fb1SKuninori Morimoto }; 445e80a2fb1SKuninori Morimoto dvc1: dvc@1 { 446e80a2fb1SKuninori Morimoto dmas = <&audma0 0xbe>; 447e80a2fb1SKuninori Morimoto dma-names = "tx"; 448e80a2fb1SKuninori Morimoto }; 44934cb6123SKuninori Morimoto }; 45034cb6123SKuninori Morimoto 45170fb1052SKuninori Morimoto rcar_sound,mix { 45270fb1052SKuninori Morimoto mix0: mix@0 { }; 45370fb1052SKuninori Morimoto mix1: mix@1 { }; 45470fb1052SKuninori Morimoto }; 45570fb1052SKuninori Morimoto 4569269e3c3SKuninori Morimoto rcar_sound,ctu { 4579269e3c3SKuninori Morimoto ctu00: ctu@0 { }; 4589269e3c3SKuninori Morimoto ctu01: ctu@1 { }; 4599269e3c3SKuninori Morimoto ctu02: ctu@2 { }; 4609269e3c3SKuninori Morimoto ctu03: ctu@3 { }; 4619269e3c3SKuninori Morimoto ctu10: ctu@4 { }; 4629269e3c3SKuninori Morimoto ctu11: ctu@5 { }; 4639269e3c3SKuninori Morimoto ctu12: ctu@6 { }; 4649269e3c3SKuninori Morimoto ctu13: ctu@7 { }; 4659269e3c3SKuninori Morimoto }; 4669269e3c3SKuninori Morimoto 46790e8e50fSKuninori Morimoto rcar_sound,src { 4685cf4f686SKuninori Morimoto src0: src@0 { 4695cf4f686SKuninori Morimoto interrupts = <0 352 IRQ_TYPE_LEVEL_HIGH>; 470e80a2fb1SKuninori Morimoto dmas = <&audma0 0x85>, <&audma1 0x9a>; 471e80a2fb1SKuninori Morimoto dma-names = "rx", "tx"; 4725cf4f686SKuninori Morimoto }; 4735cf4f686SKuninori Morimoto src1: src@1 { 4745cf4f686SKuninori Morimoto interrupts = <0 353 IRQ_TYPE_LEVEL_HIGH>; 475e80a2fb1SKuninori Morimoto dmas = <&audma0 0x87>, <&audma1 0x9c>; 476e80a2fb1SKuninori Morimoto dma-names = "rx", "tx"; 4775cf4f686SKuninori Morimoto }; 4785cf4f686SKuninori Morimoto src2: src@2 { 4795cf4f686SKuninori Morimoto interrupts = <0 354 IRQ_TYPE_LEVEL_HIGH>; 480e80a2fb1SKuninori Morimoto dmas = <&audma0 0x89>, <&audma1 0x9e>; 481e80a2fb1SKuninori Morimoto dma-names = "rx", "tx"; 4825cf4f686SKuninori Morimoto }; 4835cf4f686SKuninori Morimoto src3: src@3 { 4845cf4f686SKuninori Morimoto interrupts = <0 355 IRQ_TYPE_LEVEL_HIGH>; 485e80a2fb1SKuninori Morimoto dmas = <&audma0 0x8b>, <&audma1 0xa0>; 486e80a2fb1SKuninori Morimoto dma-names = "rx", "tx"; 4875cf4f686SKuninori Morimoto }; 4885cf4f686SKuninori Morimoto src4: src@4 { 4895cf4f686SKuninori Morimoto interrupts = <0 356 IRQ_TYPE_LEVEL_HIGH>; 490e80a2fb1SKuninori Morimoto dmas = <&audma0 0x8d>, <&audma1 0xb0>; 491e80a2fb1SKuninori Morimoto dma-names = "rx", "tx"; 4925cf4f686SKuninori Morimoto }; 4935cf4f686SKuninori Morimoto src5: src@5 { 4945cf4f686SKuninori Morimoto interrupts = <0 357 IRQ_TYPE_LEVEL_HIGH>; 495e80a2fb1SKuninori Morimoto dmas = <&audma0 0x8f>, <&audma1 0xb2>; 496e80a2fb1SKuninori Morimoto dma-names = "rx", "tx"; 4975cf4f686SKuninori Morimoto }; 4985cf4f686SKuninori Morimoto src6: src@6 { 4995cf4f686SKuninori Morimoto interrupts = <0 358 IRQ_TYPE_LEVEL_HIGH>; 500e80a2fb1SKuninori Morimoto dmas = <&audma0 0x91>, <&audma1 0xb4>; 501e80a2fb1SKuninori Morimoto dma-names = "rx", "tx"; 5025cf4f686SKuninori Morimoto }; 5035cf4f686SKuninori Morimoto src7: src@7 { 5045cf4f686SKuninori Morimoto interrupts = <0 359 IRQ_TYPE_LEVEL_HIGH>; 505e80a2fb1SKuninori Morimoto dmas = <&audma0 0x93>, <&audma1 0xb6>; 506e80a2fb1SKuninori Morimoto dma-names = "rx", "tx"; 5075cf4f686SKuninori Morimoto }; 5085cf4f686SKuninori Morimoto src8: src@8 { 5095cf4f686SKuninori Morimoto interrupts = <0 360 IRQ_TYPE_LEVEL_HIGH>; 510e80a2fb1SKuninori Morimoto dmas = <&audma0 0x95>, <&audma1 0xb8>; 511e80a2fb1SKuninori Morimoto dma-names = "rx", "tx"; 5125cf4f686SKuninori Morimoto }; 5135cf4f686SKuninori Morimoto src9: src@9 { 5145cf4f686SKuninori Morimoto interrupts = <0 361 IRQ_TYPE_LEVEL_HIGH>; 515e80a2fb1SKuninori Morimoto dmas = <&audma0 0x97>, <&audma1 0xba>; 516e80a2fb1SKuninori Morimoto dma-names = "rx", "tx"; 5175cf4f686SKuninori Morimoto }; 51890e8e50fSKuninori Morimoto }; 51990e8e50fSKuninori Morimoto 52090e8e50fSKuninori Morimoto rcar_sound,ssi { 52190e8e50fSKuninori Morimoto ssi0: ssi@0 { 52290e8e50fSKuninori Morimoto interrupts = <0 370 IRQ_TYPE_LEVEL_HIGH>; 523e80a2fb1SKuninori Morimoto dmas = <&audma0 0x01>, <&audma1 0x02>, <&audma0 0x15>, <&audma1 0x16>; 524e80a2fb1SKuninori Morimoto dma-names = "rx", "tx", "rxu", "txu"; 52590e8e50fSKuninori Morimoto }; 52690e8e50fSKuninori Morimoto ssi1: ssi@1 { 52790e8e50fSKuninori Morimoto interrupts = <0 371 IRQ_TYPE_LEVEL_HIGH>; 528e80a2fb1SKuninori Morimoto dmas = <&audma0 0x03>, <&audma1 0x04>, <&audma0 0x49>, <&audma1 0x4a>; 529e80a2fb1SKuninori Morimoto dma-names = "rx", "tx", "rxu", "txu"; 53090e8e50fSKuninori Morimoto }; 53190e8e50fSKuninori Morimoto ssi2: ssi@2 { 53290e8e50fSKuninori Morimoto interrupts = <0 372 IRQ_TYPE_LEVEL_HIGH>; 533e80a2fb1SKuninori Morimoto dmas = <&audma0 0x05>, <&audma1 0x06>, <&audma0 0x63>, <&audma1 0x64>; 534e80a2fb1SKuninori Morimoto dma-names = "rx", "tx", "rxu", "txu"; 53590e8e50fSKuninori Morimoto }; 53690e8e50fSKuninori Morimoto ssi3: ssi@3 { 53790e8e50fSKuninori Morimoto interrupts = <0 373 IRQ_TYPE_LEVEL_HIGH>; 538e80a2fb1SKuninori Morimoto dmas = <&audma0 0x07>, <&audma1 0x08>, <&audma0 0x6f>, <&audma1 0x70>; 539e80a2fb1SKuninori Morimoto dma-names = "rx", "tx", "rxu", "txu"; 54090e8e50fSKuninori Morimoto }; 54190e8e50fSKuninori Morimoto ssi4: ssi@4 { 54290e8e50fSKuninori Morimoto interrupts = <0 374 IRQ_TYPE_LEVEL_HIGH>; 543e80a2fb1SKuninori Morimoto dmas = <&audma0 0x09>, <&audma1 0x0a>, <&audma0 0x71>, <&audma1 0x72>; 544e80a2fb1SKuninori Morimoto dma-names = "rx", "tx", "rxu", "txu"; 54590e8e50fSKuninori Morimoto }; 54690e8e50fSKuninori Morimoto ssi5: ssi@5 { 54790e8e50fSKuninori Morimoto interrupts = <0 375 IRQ_TYPE_LEVEL_HIGH>; 548e80a2fb1SKuninori Morimoto dmas = <&audma0 0x0b>, <&audma1 0x0c>, <&audma0 0x73>, <&audma1 0x74>; 549e80a2fb1SKuninori Morimoto dma-names = "rx", "tx", "rxu", "txu"; 55090e8e50fSKuninori Morimoto }; 55190e8e50fSKuninori Morimoto ssi6: ssi@6 { 55290e8e50fSKuninori Morimoto interrupts = <0 376 IRQ_TYPE_LEVEL_HIGH>; 553e80a2fb1SKuninori Morimoto dmas = <&audma0 0x0d>, <&audma1 0x0e>, <&audma0 0x75>, <&audma1 0x76>; 554e80a2fb1SKuninori Morimoto dma-names = "rx", "tx", "rxu", "txu"; 55590e8e50fSKuninori Morimoto }; 55690e8e50fSKuninori Morimoto ssi7: ssi@7 { 55790e8e50fSKuninori Morimoto interrupts = <0 377 IRQ_TYPE_LEVEL_HIGH>; 558e80a2fb1SKuninori Morimoto dmas = <&audma0 0x0f>, <&audma1 0x10>, <&audma0 0x79>, <&audma1 0x7a>; 559e80a2fb1SKuninori Morimoto dma-names = "rx", "tx", "rxu", "txu"; 56090e8e50fSKuninori Morimoto }; 56190e8e50fSKuninori Morimoto ssi8: ssi@8 { 56290e8e50fSKuninori Morimoto interrupts = <0 378 IRQ_TYPE_LEVEL_HIGH>; 563e80a2fb1SKuninori Morimoto dmas = <&audma0 0x11>, <&audma1 0x12>, <&audma0 0x7b>, <&audma1 0x7c>; 564e80a2fb1SKuninori Morimoto dma-names = "rx", "tx", "rxu", "txu"; 56590e8e50fSKuninori Morimoto }; 56690e8e50fSKuninori Morimoto ssi9: ssi@9 { 56790e8e50fSKuninori Morimoto interrupts = <0 379 IRQ_TYPE_LEVEL_HIGH>; 568e80a2fb1SKuninori Morimoto dmas = <&audma0 0x13>, <&audma1 0x14>, <&audma0 0x7d>, <&audma1 0x7e>; 569e80a2fb1SKuninori Morimoto dma-names = "rx", "tx", "rxu", "txu"; 57090e8e50fSKuninori Morimoto }; 57190e8e50fSKuninori Morimoto }; 57290e8e50fSKuninori Morimoto 57390e8e50fSKuninori Morimoto rcar_sound,dai { 57490e8e50fSKuninori Morimoto dai0 { 57590e8e50fSKuninori Morimoto playback = <&ssi5 &src5>; 57690e8e50fSKuninori Morimoto capture = <&ssi6>; 57790e8e50fSKuninori Morimoto }; 57890e8e50fSKuninori Morimoto dai1 { 57990e8e50fSKuninori Morimoto playback = <&ssi3>; 58090e8e50fSKuninori Morimoto }; 58190e8e50fSKuninori Morimoto dai2 { 58290e8e50fSKuninori Morimoto capture = <&ssi4>; 58390e8e50fSKuninori Morimoto }; 58490e8e50fSKuninori Morimoto dai3 { 58590e8e50fSKuninori Morimoto playback = <&ssi7>; 58690e8e50fSKuninori Morimoto }; 58790e8e50fSKuninori Morimoto dai4 { 58890e8e50fSKuninori Morimoto capture = <&ssi8>; 58990e8e50fSKuninori Morimoto }; 59090e8e50fSKuninori Morimoto }; 59190e8e50fSKuninori Morimoto}; 592f3f17d32SKuninori Morimoto 593f1511a14SKuninori Morimoto============================================= 594f3f17d32SKuninori MorimotoExample: simple sound card 595f1511a14SKuninori Morimoto============================================= 596f3f17d32SKuninori Morimoto 597f3f17d32SKuninori Morimoto rsnd_ak4643: sound { 598f3f17d32SKuninori Morimoto compatible = "simple-audio-card"; 599f3f17d32SKuninori Morimoto 600f3f17d32SKuninori Morimoto simple-audio-card,format = "left_j"; 601f3f17d32SKuninori Morimoto simple-audio-card,bitclock-master = <&sndcodec>; 602f3f17d32SKuninori Morimoto simple-audio-card,frame-master = <&sndcodec>; 603f3f17d32SKuninori Morimoto 604f3f17d32SKuninori Morimoto sndcpu: simple-audio-card,cpu { 605f3f17d32SKuninori Morimoto sound-dai = <&rcar_sound>; 606f3f17d32SKuninori Morimoto }; 607f3f17d32SKuninori Morimoto 608f3f17d32SKuninori Morimoto sndcodec: simple-audio-card,codec { 609f3f17d32SKuninori Morimoto sound-dai = <&ak4643>; 610f3f17d32SKuninori Morimoto clocks = <&audio_clock>; 611f3f17d32SKuninori Morimoto }; 612f3f17d32SKuninori Morimoto }; 613f3f17d32SKuninori Morimoto 614f3f17d32SKuninori Morimoto&rcar_sound { 615f3f17d32SKuninori Morimoto pinctrl-0 = <&sound_pins &sound_clk_pins>; 616f3f17d32SKuninori Morimoto pinctrl-names = "default"; 617f3f17d32SKuninori Morimoto 618f3f17d32SKuninori Morimoto /* Single DAI */ 619f3f17d32SKuninori Morimoto #sound-dai-cells = <0>; 620f3f17d32SKuninori Morimoto 621f3f17d32SKuninori Morimoto status = "okay"; 622f3f17d32SKuninori Morimoto 623f3f17d32SKuninori Morimoto rcar_sound,dai { 624f3f17d32SKuninori Morimoto dai0 { 625f3f17d32SKuninori Morimoto playback = <&ssi0 &src2 &dvc0>; 626f3f17d32SKuninori Morimoto capture = <&ssi1 &src3 &dvc1>; 627f3f17d32SKuninori Morimoto }; 628f3f17d32SKuninori Morimoto }; 629f3f17d32SKuninori Morimoto}; 630f3f17d32SKuninori Morimoto 631f3f17d32SKuninori Morimoto&ssi1 { 632f3f17d32SKuninori Morimoto shared-pin; 633f3f17d32SKuninori Morimoto}; 63444bf5361SKuninori Morimoto 635f1511a14SKuninori Morimoto============================================= 63644bf5361SKuninori MorimotoExample: simple sound card for TDM 637f1511a14SKuninori Morimoto============================================= 63844bf5361SKuninori Morimoto 63944bf5361SKuninori Morimoto rsnd_tdm: sound { 64044bf5361SKuninori Morimoto compatible = "simple-audio-card"; 64144bf5361SKuninori Morimoto 64244bf5361SKuninori Morimoto simple-audio-card,format = "left_j"; 64344bf5361SKuninori Morimoto simple-audio-card,bitclock-master = <&sndcodec>; 64444bf5361SKuninori Morimoto simple-audio-card,frame-master = <&sndcodec>; 64544bf5361SKuninori Morimoto 64644bf5361SKuninori Morimoto sndcpu: simple-audio-card,cpu { 64744bf5361SKuninori Morimoto sound-dai = <&rcar_sound>; 64844bf5361SKuninori Morimoto dai-tdm-slot-num = <6>; 64944bf5361SKuninori Morimoto }; 65044bf5361SKuninori Morimoto 65144bf5361SKuninori Morimoto sndcodec: simple-audio-card,codec { 65244bf5361SKuninori Morimoto sound-dai = <&xxx>; 65344bf5361SKuninori Morimoto }; 65444bf5361SKuninori Morimoto }; 655b4c83b17SKuninori Morimoto 656f1511a14SKuninori Morimoto============================================= 657b4c83b17SKuninori MorimotoExample: simple sound card for Multi channel 658f1511a14SKuninori Morimoto============================================= 659b4c83b17SKuninori Morimoto 660b4c83b17SKuninori Morimoto&rcar_sound { 661b4c83b17SKuninori Morimoto pinctrl-0 = <&sound_pins &sound_clk_pins>; 662b4c83b17SKuninori Morimoto pinctrl-names = "default"; 663b4c83b17SKuninori Morimoto 664b4c83b17SKuninori Morimoto /* Single DAI */ 665b4c83b17SKuninori Morimoto #sound-dai-cells = <0>; 666b4c83b17SKuninori Morimoto 667b4c83b17SKuninori Morimoto status = "okay"; 668b4c83b17SKuninori Morimoto 669b4c83b17SKuninori Morimoto rcar_sound,dai { 670b4c83b17SKuninori Morimoto dai0 { 671b4c83b17SKuninori Morimoto playback = <&ssi0 &ssi1 &ssi2 &src0 &dvc0>; 672b4c83b17SKuninori Morimoto }; 673b4c83b17SKuninori Morimoto }; 674b4c83b17SKuninori Morimoto}; 675