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 86*0378bb96SKuninori MorimotoYou need to use "simple-scu-audio-card" sound card for it. 87f1511a14SKuninori Morimotoexample) 88f1511a14SKuninori Morimoto 89f1511a14SKuninori Morimoto sound { 90*0378bb96SKuninori 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 */ 100*0378bb96SKuninori Morimoto simple-audio-card,convert-rate = <48000>; 101f1511a14SKuninori Morimoto ... 102*0378bb96SKuninori Morimoto simple-audio-card,cpu { 103f1511a14SKuninori Morimoto sound-dai = <&rcar_sound>; 104f1511a14SKuninori Morimoto }; 105*0378bb96SKuninori 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 144*0378bb96SKuninori MorimotoYou need to use "simple-scu-audio-card" sound card for it. 145f1511a14SKuninori Morimotoexample) 146f1511a14SKuninori Morimoto 147f1511a14SKuninori Morimoto sound { 148*0378bb96SKuninori 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 */ 155*0378bb96SKuninori Morimoto simple-audio-card,convert-channels = <2>; 156f1511a14SKuninori Morimoto ... 157*0378bb96SKuninori Morimoto simple-audio-card,cpu { 158f1511a14SKuninori Morimoto sound-dai = <&rcar_sound>; 159f1511a14SKuninori Morimoto }; 160*0378bb96SKuninori 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 193*0378bb96SKuninori 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 { 200*0378bb96SKuninori Morimoto compatible = "simple-scu-audio-card"; 201f1511a14SKuninori Morimoto ... 202*0378bb96SKuninori Morimoto simple-audio-card,cpu@0 { 203f1511a14SKuninori Morimoto sound-dai = <&rcar_sound 0>; 204f1511a14SKuninori Morimoto }; 205*0378bb96SKuninori Morimoto simple-audio-card,cpu@1 { 206f1511a14SKuninori Morimoto sound-dai = <&rcar_sound 1>; 207f1511a14SKuninori Morimoto }; 208*0378bb96SKuninori 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 371209c0907SKuninori Morimoto 372209c0907SKuninori MorimotoOptional properties: 3732a46db4aSKuninori Morimoto- #clock-cells : it must be 0 if your system has audio_clkout 3742a46db4aSKuninori Morimoto it must be 1 if your system has audio_clkout0/1/2/3 3752a46db4aSKuninori Morimoto- clock-frequency : for all audio_clkout0/1/2/3 3767dc20319SKuninori Morimoto- clkout-lr-asynchronous : boolean property. it indicates that audio_clkoutn 3777dc20319SKuninori Morimoto is asynchronizes with lr-clock. 37890e8e50fSKuninori Morimoto 37990e8e50fSKuninori MorimotoSSI subnode properties: 38090e8e50fSKuninori Morimoto- interrupts : Should contain SSI interrupt for PIO transfer 38190e8e50fSKuninori Morimoto- shared-pin : if shared clock pin 382199e7688SKuninori Morimoto- pio-transfer : use PIO transfer mode 383d9288d0bSKuninori Morimoto- no-busif : BUSIF is not ussed when [mem -> SSI] via DMA case 384e80a2fb1SKuninori Morimoto- dma : Should contain Audio DMAC entry 385e80a2fb1SKuninori Morimoto- dma-names : SSI case "rx" (=playback), "tx" (=capture) 386e80a2fb1SKuninori Morimoto SSIU case "rxu" (=playback), "txu" (=capture) 38790e8e50fSKuninori Morimoto 3888bab0dd5SKuninori MorimotoSRC subnode properties: 389e80a2fb1SKuninori Morimoto- dma : Should contain Audio DMAC entry 390e80a2fb1SKuninori Morimoto- dma-names : "rx" (=playback), "tx" (=capture) 391e80a2fb1SKuninori Morimoto 392e80a2fb1SKuninori MorimotoDVC subnode properties: 393e80a2fb1SKuninori Morimoto- dma : Should contain Audio DMAC entry 394e80a2fb1SKuninori Morimoto- dma-names : "tx" (=playback/capture) 3958bab0dd5SKuninori Morimoto 39690e8e50fSKuninori MorimotoDAI subnode properties: 39790e8e50fSKuninori Morimoto- playback : list of playback modules 39890e8e50fSKuninori Morimoto- capture : list of capture modules 39990e8e50fSKuninori Morimoto 400f1511a14SKuninori Morimoto 401f1511a14SKuninori Morimoto============================================= 40290e8e50fSKuninori MorimotoExample: 403f1511a14SKuninori Morimoto============================================= 40490e8e50fSKuninori Morimoto 405596f74ecSGeert Uytterhoevenrcar_sound: sound@ec500000 { 40690e8e50fSKuninori Morimoto #sound-dai-cells = <1>; 40756ba98acSGeert Uytterhoeven compatible = "renesas,rcar_sound-r8a7791", "renesas,rcar_sound-gen2"; 40890e8e50fSKuninori Morimoto reg = <0 0xec500000 0 0x1000>, /* SCU */ 40990e8e50fSKuninori Morimoto <0 0xec5a0000 0 0x100>, /* ADG */ 41090e8e50fSKuninori Morimoto <0 0xec540000 0 0x1000>, /* SSIU */ 411d3b1c0baSKuninori Morimoto <0 0xec541000 0 0x1280>, /* SSI */ 412d3b1c0baSKuninori Morimoto <0 0xec740000 0 0x200>; /* Audio DMAC peri peri*/ 413d3b1c0baSKuninori Morimoto reg-names = "scu", "adg", "ssiu", "ssi", "audmapp"; 41490e8e50fSKuninori Morimoto 415bb02714fSKuninori Morimoto clocks = <&mstp10_clks R8A7790_CLK_SSI_ALL>, 416bb02714fSKuninori Morimoto <&mstp10_clks R8A7790_CLK_SSI9>, <&mstp10_clks R8A7790_CLK_SSI8>, 417bb02714fSKuninori Morimoto <&mstp10_clks R8A7790_CLK_SSI7>, <&mstp10_clks R8A7790_CLK_SSI6>, 418bb02714fSKuninori Morimoto <&mstp10_clks R8A7790_CLK_SSI5>, <&mstp10_clks R8A7790_CLK_SSI4>, 419bb02714fSKuninori Morimoto <&mstp10_clks R8A7790_CLK_SSI3>, <&mstp10_clks R8A7790_CLK_SSI2>, 420bb02714fSKuninori Morimoto <&mstp10_clks R8A7790_CLK_SSI1>, <&mstp10_clks R8A7790_CLK_SSI0>, 421bb02714fSKuninori Morimoto <&mstp10_clks R8A7790_CLK_SCU_SRC9>, <&mstp10_clks R8A7790_CLK_SCU_SRC8>, 422bb02714fSKuninori Morimoto <&mstp10_clks R8A7790_CLK_SCU_SRC7>, <&mstp10_clks R8A7790_CLK_SCU_SRC6>, 423bb02714fSKuninori Morimoto <&mstp10_clks R8A7790_CLK_SCU_SRC5>, <&mstp10_clks R8A7790_CLK_SCU_SRC4>, 424bb02714fSKuninori Morimoto <&mstp10_clks R8A7790_CLK_SCU_SRC3>, <&mstp10_clks R8A7790_CLK_SCU_SRC2>, 425bb02714fSKuninori Morimoto <&mstp10_clks R8A7790_CLK_SCU_SRC1>, <&mstp10_clks R8A7790_CLK_SCU_SRC0>, 426bb02714fSKuninori Morimoto <&mstp10_clks R8A7790_CLK_SCU_DVC0>, <&mstp10_clks R8A7790_CLK_SCU_DVC1>, 427bb02714fSKuninori Morimoto <&audio_clk_a>, <&audio_clk_b>, <&audio_clk_c>, <&m2_clk>; 428bb02714fSKuninori Morimoto clock-names = "ssi-all", 429bb02714fSKuninori Morimoto "ssi.9", "ssi.8", "ssi.7", "ssi.6", "ssi.5", 430bb02714fSKuninori Morimoto "ssi.4", "ssi.3", "ssi.2", "ssi.1", "ssi.0", 431bb02714fSKuninori Morimoto "src.9", "src.8", "src.7", "src.6", "src.5", 432bb02714fSKuninori Morimoto "src.4", "src.3", "src.2", "src.1", "src.0", 433bb02714fSKuninori Morimoto "dvc.0", "dvc.1", 434bb02714fSKuninori Morimoto "clk_a", "clk_b", "clk_c", "clk_i"; 435bb02714fSKuninori Morimoto 43634cb6123SKuninori Morimoto rcar_sound,dvc { 437e80a2fb1SKuninori Morimoto dvc0: dvc@0 { 438e80a2fb1SKuninori Morimoto dmas = <&audma0 0xbc>; 439e80a2fb1SKuninori Morimoto dma-names = "tx"; 440e80a2fb1SKuninori Morimoto }; 441e80a2fb1SKuninori Morimoto dvc1: dvc@1 { 442e80a2fb1SKuninori Morimoto dmas = <&audma0 0xbe>; 443e80a2fb1SKuninori Morimoto dma-names = "tx"; 444e80a2fb1SKuninori Morimoto }; 44534cb6123SKuninori Morimoto }; 44634cb6123SKuninori Morimoto 44770fb1052SKuninori Morimoto rcar_sound,mix { 44870fb1052SKuninori Morimoto mix0: mix@0 { }; 44970fb1052SKuninori Morimoto mix1: mix@1 { }; 45070fb1052SKuninori Morimoto }; 45170fb1052SKuninori Morimoto 4529269e3c3SKuninori Morimoto rcar_sound,ctu { 4539269e3c3SKuninori Morimoto ctu00: ctu@0 { }; 4549269e3c3SKuninori Morimoto ctu01: ctu@1 { }; 4559269e3c3SKuninori Morimoto ctu02: ctu@2 { }; 4569269e3c3SKuninori Morimoto ctu03: ctu@3 { }; 4579269e3c3SKuninori Morimoto ctu10: ctu@4 { }; 4589269e3c3SKuninori Morimoto ctu11: ctu@5 { }; 4599269e3c3SKuninori Morimoto ctu12: ctu@6 { }; 4609269e3c3SKuninori Morimoto ctu13: ctu@7 { }; 4619269e3c3SKuninori Morimoto }; 4629269e3c3SKuninori Morimoto 46390e8e50fSKuninori Morimoto rcar_sound,src { 4645cf4f686SKuninori Morimoto src0: src@0 { 4655cf4f686SKuninori Morimoto interrupts = <0 352 IRQ_TYPE_LEVEL_HIGH>; 466e80a2fb1SKuninori Morimoto dmas = <&audma0 0x85>, <&audma1 0x9a>; 467e80a2fb1SKuninori Morimoto dma-names = "rx", "tx"; 4685cf4f686SKuninori Morimoto }; 4695cf4f686SKuninori Morimoto src1: src@1 { 4705cf4f686SKuninori Morimoto interrupts = <0 353 IRQ_TYPE_LEVEL_HIGH>; 471e80a2fb1SKuninori Morimoto dmas = <&audma0 0x87>, <&audma1 0x9c>; 472e80a2fb1SKuninori Morimoto dma-names = "rx", "tx"; 4735cf4f686SKuninori Morimoto }; 4745cf4f686SKuninori Morimoto src2: src@2 { 4755cf4f686SKuninori Morimoto interrupts = <0 354 IRQ_TYPE_LEVEL_HIGH>; 476e80a2fb1SKuninori Morimoto dmas = <&audma0 0x89>, <&audma1 0x9e>; 477e80a2fb1SKuninori Morimoto dma-names = "rx", "tx"; 4785cf4f686SKuninori Morimoto }; 4795cf4f686SKuninori Morimoto src3: src@3 { 4805cf4f686SKuninori Morimoto interrupts = <0 355 IRQ_TYPE_LEVEL_HIGH>; 481e80a2fb1SKuninori Morimoto dmas = <&audma0 0x8b>, <&audma1 0xa0>; 482e80a2fb1SKuninori Morimoto dma-names = "rx", "tx"; 4835cf4f686SKuninori Morimoto }; 4845cf4f686SKuninori Morimoto src4: src@4 { 4855cf4f686SKuninori Morimoto interrupts = <0 356 IRQ_TYPE_LEVEL_HIGH>; 486e80a2fb1SKuninori Morimoto dmas = <&audma0 0x8d>, <&audma1 0xb0>; 487e80a2fb1SKuninori Morimoto dma-names = "rx", "tx"; 4885cf4f686SKuninori Morimoto }; 4895cf4f686SKuninori Morimoto src5: src@5 { 4905cf4f686SKuninori Morimoto interrupts = <0 357 IRQ_TYPE_LEVEL_HIGH>; 491e80a2fb1SKuninori Morimoto dmas = <&audma0 0x8f>, <&audma1 0xb2>; 492e80a2fb1SKuninori Morimoto dma-names = "rx", "tx"; 4935cf4f686SKuninori Morimoto }; 4945cf4f686SKuninori Morimoto src6: src@6 { 4955cf4f686SKuninori Morimoto interrupts = <0 358 IRQ_TYPE_LEVEL_HIGH>; 496e80a2fb1SKuninori Morimoto dmas = <&audma0 0x91>, <&audma1 0xb4>; 497e80a2fb1SKuninori Morimoto dma-names = "rx", "tx"; 4985cf4f686SKuninori Morimoto }; 4995cf4f686SKuninori Morimoto src7: src@7 { 5005cf4f686SKuninori Morimoto interrupts = <0 359 IRQ_TYPE_LEVEL_HIGH>; 501e80a2fb1SKuninori Morimoto dmas = <&audma0 0x93>, <&audma1 0xb6>; 502e80a2fb1SKuninori Morimoto dma-names = "rx", "tx"; 5035cf4f686SKuninori Morimoto }; 5045cf4f686SKuninori Morimoto src8: src@8 { 5055cf4f686SKuninori Morimoto interrupts = <0 360 IRQ_TYPE_LEVEL_HIGH>; 506e80a2fb1SKuninori Morimoto dmas = <&audma0 0x95>, <&audma1 0xb8>; 507e80a2fb1SKuninori Morimoto dma-names = "rx", "tx"; 5085cf4f686SKuninori Morimoto }; 5095cf4f686SKuninori Morimoto src9: src@9 { 5105cf4f686SKuninori Morimoto interrupts = <0 361 IRQ_TYPE_LEVEL_HIGH>; 511e80a2fb1SKuninori Morimoto dmas = <&audma0 0x97>, <&audma1 0xba>; 512e80a2fb1SKuninori Morimoto dma-names = "rx", "tx"; 5135cf4f686SKuninori Morimoto }; 51490e8e50fSKuninori Morimoto }; 51590e8e50fSKuninori Morimoto 51690e8e50fSKuninori Morimoto rcar_sound,ssi { 51790e8e50fSKuninori Morimoto ssi0: ssi@0 { 51890e8e50fSKuninori Morimoto interrupts = <0 370 IRQ_TYPE_LEVEL_HIGH>; 519e80a2fb1SKuninori Morimoto dmas = <&audma0 0x01>, <&audma1 0x02>, <&audma0 0x15>, <&audma1 0x16>; 520e80a2fb1SKuninori Morimoto dma-names = "rx", "tx", "rxu", "txu"; 52190e8e50fSKuninori Morimoto }; 52290e8e50fSKuninori Morimoto ssi1: ssi@1 { 52390e8e50fSKuninori Morimoto interrupts = <0 371 IRQ_TYPE_LEVEL_HIGH>; 524e80a2fb1SKuninori Morimoto dmas = <&audma0 0x03>, <&audma1 0x04>, <&audma0 0x49>, <&audma1 0x4a>; 525e80a2fb1SKuninori Morimoto dma-names = "rx", "tx", "rxu", "txu"; 52690e8e50fSKuninori Morimoto }; 52790e8e50fSKuninori Morimoto ssi2: ssi@2 { 52890e8e50fSKuninori Morimoto interrupts = <0 372 IRQ_TYPE_LEVEL_HIGH>; 529e80a2fb1SKuninori Morimoto dmas = <&audma0 0x05>, <&audma1 0x06>, <&audma0 0x63>, <&audma1 0x64>; 530e80a2fb1SKuninori Morimoto dma-names = "rx", "tx", "rxu", "txu"; 53190e8e50fSKuninori Morimoto }; 53290e8e50fSKuninori Morimoto ssi3: ssi@3 { 53390e8e50fSKuninori Morimoto interrupts = <0 373 IRQ_TYPE_LEVEL_HIGH>; 534e80a2fb1SKuninori Morimoto dmas = <&audma0 0x07>, <&audma1 0x08>, <&audma0 0x6f>, <&audma1 0x70>; 535e80a2fb1SKuninori Morimoto dma-names = "rx", "tx", "rxu", "txu"; 53690e8e50fSKuninori Morimoto }; 53790e8e50fSKuninori Morimoto ssi4: ssi@4 { 53890e8e50fSKuninori Morimoto interrupts = <0 374 IRQ_TYPE_LEVEL_HIGH>; 539e80a2fb1SKuninori Morimoto dmas = <&audma0 0x09>, <&audma1 0x0a>, <&audma0 0x71>, <&audma1 0x72>; 540e80a2fb1SKuninori Morimoto dma-names = "rx", "tx", "rxu", "txu"; 54190e8e50fSKuninori Morimoto }; 54290e8e50fSKuninori Morimoto ssi5: ssi@5 { 54390e8e50fSKuninori Morimoto interrupts = <0 375 IRQ_TYPE_LEVEL_HIGH>; 544e80a2fb1SKuninori Morimoto dmas = <&audma0 0x0b>, <&audma1 0x0c>, <&audma0 0x73>, <&audma1 0x74>; 545e80a2fb1SKuninori Morimoto dma-names = "rx", "tx", "rxu", "txu"; 54690e8e50fSKuninori Morimoto }; 54790e8e50fSKuninori Morimoto ssi6: ssi@6 { 54890e8e50fSKuninori Morimoto interrupts = <0 376 IRQ_TYPE_LEVEL_HIGH>; 549e80a2fb1SKuninori Morimoto dmas = <&audma0 0x0d>, <&audma1 0x0e>, <&audma0 0x75>, <&audma1 0x76>; 550e80a2fb1SKuninori Morimoto dma-names = "rx", "tx", "rxu", "txu"; 55190e8e50fSKuninori Morimoto }; 55290e8e50fSKuninori Morimoto ssi7: ssi@7 { 55390e8e50fSKuninori Morimoto interrupts = <0 377 IRQ_TYPE_LEVEL_HIGH>; 554e80a2fb1SKuninori Morimoto dmas = <&audma0 0x0f>, <&audma1 0x10>, <&audma0 0x79>, <&audma1 0x7a>; 555e80a2fb1SKuninori Morimoto dma-names = "rx", "tx", "rxu", "txu"; 55690e8e50fSKuninori Morimoto }; 55790e8e50fSKuninori Morimoto ssi8: ssi@8 { 55890e8e50fSKuninori Morimoto interrupts = <0 378 IRQ_TYPE_LEVEL_HIGH>; 559e80a2fb1SKuninori Morimoto dmas = <&audma0 0x11>, <&audma1 0x12>, <&audma0 0x7b>, <&audma1 0x7c>; 560e80a2fb1SKuninori Morimoto dma-names = "rx", "tx", "rxu", "txu"; 56190e8e50fSKuninori Morimoto }; 56290e8e50fSKuninori Morimoto ssi9: ssi@9 { 56390e8e50fSKuninori Morimoto interrupts = <0 379 IRQ_TYPE_LEVEL_HIGH>; 564e80a2fb1SKuninori Morimoto dmas = <&audma0 0x13>, <&audma1 0x14>, <&audma0 0x7d>, <&audma1 0x7e>; 565e80a2fb1SKuninori Morimoto dma-names = "rx", "tx", "rxu", "txu"; 56690e8e50fSKuninori Morimoto }; 56790e8e50fSKuninori Morimoto }; 56890e8e50fSKuninori Morimoto 56990e8e50fSKuninori Morimoto rcar_sound,dai { 57090e8e50fSKuninori Morimoto dai0 { 57190e8e50fSKuninori Morimoto playback = <&ssi5 &src5>; 57290e8e50fSKuninori Morimoto capture = <&ssi6>; 57390e8e50fSKuninori Morimoto }; 57490e8e50fSKuninori Morimoto dai1 { 57590e8e50fSKuninori Morimoto playback = <&ssi3>; 57690e8e50fSKuninori Morimoto }; 57790e8e50fSKuninori Morimoto dai2 { 57890e8e50fSKuninori Morimoto capture = <&ssi4>; 57990e8e50fSKuninori Morimoto }; 58090e8e50fSKuninori Morimoto dai3 { 58190e8e50fSKuninori Morimoto playback = <&ssi7>; 58290e8e50fSKuninori Morimoto }; 58390e8e50fSKuninori Morimoto dai4 { 58490e8e50fSKuninori Morimoto capture = <&ssi8>; 58590e8e50fSKuninori Morimoto }; 58690e8e50fSKuninori Morimoto }; 58790e8e50fSKuninori Morimoto}; 588f3f17d32SKuninori Morimoto 589f1511a14SKuninori Morimoto============================================= 590f3f17d32SKuninori MorimotoExample: simple sound card 591f1511a14SKuninori Morimoto============================================= 592f3f17d32SKuninori Morimoto 593f3f17d32SKuninori Morimoto rsnd_ak4643: sound { 594f3f17d32SKuninori Morimoto compatible = "simple-audio-card"; 595f3f17d32SKuninori Morimoto 596f3f17d32SKuninori Morimoto simple-audio-card,format = "left_j"; 597f3f17d32SKuninori Morimoto simple-audio-card,bitclock-master = <&sndcodec>; 598f3f17d32SKuninori Morimoto simple-audio-card,frame-master = <&sndcodec>; 599f3f17d32SKuninori Morimoto 600f3f17d32SKuninori Morimoto sndcpu: simple-audio-card,cpu { 601f3f17d32SKuninori Morimoto sound-dai = <&rcar_sound>; 602f3f17d32SKuninori Morimoto }; 603f3f17d32SKuninori Morimoto 604f3f17d32SKuninori Morimoto sndcodec: simple-audio-card,codec { 605f3f17d32SKuninori Morimoto sound-dai = <&ak4643>; 606f3f17d32SKuninori Morimoto clocks = <&audio_clock>; 607f3f17d32SKuninori Morimoto }; 608f3f17d32SKuninori Morimoto }; 609f3f17d32SKuninori Morimoto 610f3f17d32SKuninori Morimoto&rcar_sound { 611f3f17d32SKuninori Morimoto pinctrl-0 = <&sound_pins &sound_clk_pins>; 612f3f17d32SKuninori Morimoto pinctrl-names = "default"; 613f3f17d32SKuninori Morimoto 614f3f17d32SKuninori Morimoto /* Single DAI */ 615f3f17d32SKuninori Morimoto #sound-dai-cells = <0>; 616f3f17d32SKuninori Morimoto 617f3f17d32SKuninori Morimoto status = "okay"; 618f3f17d32SKuninori Morimoto 619f3f17d32SKuninori Morimoto rcar_sound,dai { 620f3f17d32SKuninori Morimoto dai0 { 621f3f17d32SKuninori Morimoto playback = <&ssi0 &src2 &dvc0>; 622f3f17d32SKuninori Morimoto capture = <&ssi1 &src3 &dvc1>; 623f3f17d32SKuninori Morimoto }; 624f3f17d32SKuninori Morimoto }; 625f3f17d32SKuninori Morimoto}; 626f3f17d32SKuninori Morimoto 627f3f17d32SKuninori Morimoto&ssi1 { 628f3f17d32SKuninori Morimoto shared-pin; 629f3f17d32SKuninori Morimoto}; 63044bf5361SKuninori Morimoto 631f1511a14SKuninori Morimoto============================================= 63244bf5361SKuninori MorimotoExample: simple sound card for TDM 633f1511a14SKuninori Morimoto============================================= 63444bf5361SKuninori Morimoto 63544bf5361SKuninori Morimoto rsnd_tdm: sound { 63644bf5361SKuninori Morimoto compatible = "simple-audio-card"; 63744bf5361SKuninori Morimoto 63844bf5361SKuninori Morimoto simple-audio-card,format = "left_j"; 63944bf5361SKuninori Morimoto simple-audio-card,bitclock-master = <&sndcodec>; 64044bf5361SKuninori Morimoto simple-audio-card,frame-master = <&sndcodec>; 64144bf5361SKuninori Morimoto 64244bf5361SKuninori Morimoto sndcpu: simple-audio-card,cpu { 64344bf5361SKuninori Morimoto sound-dai = <&rcar_sound>; 64444bf5361SKuninori Morimoto dai-tdm-slot-num = <6>; 64544bf5361SKuninori Morimoto }; 64644bf5361SKuninori Morimoto 64744bf5361SKuninori Morimoto sndcodec: simple-audio-card,codec { 64844bf5361SKuninori Morimoto sound-dai = <&xxx>; 64944bf5361SKuninori Morimoto }; 65044bf5361SKuninori Morimoto }; 651b4c83b17SKuninori Morimoto 652f1511a14SKuninori Morimoto============================================= 653b4c83b17SKuninori MorimotoExample: simple sound card for Multi channel 654f1511a14SKuninori Morimoto============================================= 655b4c83b17SKuninori Morimoto 656b4c83b17SKuninori Morimoto&rcar_sound { 657b4c83b17SKuninori Morimoto pinctrl-0 = <&sound_pins &sound_clk_pins>; 658b4c83b17SKuninori Morimoto pinctrl-names = "default"; 659b4c83b17SKuninori Morimoto 660b4c83b17SKuninori Morimoto /* Single DAI */ 661b4c83b17SKuninori Morimoto #sound-dai-cells = <0>; 662b4c83b17SKuninori Morimoto 663b4c83b17SKuninori Morimoto status = "okay"; 664b4c83b17SKuninori Morimoto 665b4c83b17SKuninori Morimoto rcar_sound,dai { 666b4c83b17SKuninori Morimoto dai0 { 667b4c83b17SKuninori Morimoto playback = <&ssi0 &ssi1 &ssi2 &src0 &dvc0>; 668b4c83b17SKuninori Morimoto }; 669b4c83b17SKuninori Morimoto }; 670b4c83b17SKuninori Morimoto}; 671