190e8e50fSKuninori MorimotoRenesas R-Car sound 290e8e50fSKuninori Morimoto 3*f1511a14SKuninori Morimoto============================================= 4*f1511a14SKuninori Morimoto* Modules 5*f1511a14SKuninori Morimoto============================================= 6*f1511a14SKuninori Morimoto 7*f1511a14SKuninori MorimotoRenesas R-Car sound is constructed from below modules 8*f1511a14SKuninori Morimoto(for Gen2 or later) 9*f1511a14SKuninori Morimoto 10*f1511a14SKuninori Morimoto SCU : Sampling Rate Converter Unit 11*f1511a14SKuninori Morimoto - SRC : Sampling Rate Converter 12*f1511a14SKuninori Morimoto - CMD 13*f1511a14SKuninori Morimoto - CTU : Channel Transfer Unit 14*f1511a14SKuninori Morimoto - MIX : Mixer 15*f1511a14SKuninori Morimoto - DVC : Digital Volume and Mute Function 16*f1511a14SKuninori Morimoto SSIU : Serial Sound Interface Unit 17*f1511a14SKuninori Morimoto SSI : Serial Sound Interface 18*f1511a14SKuninori Morimoto 19*f1511a14SKuninori MorimotoSee detail of each module's channels, connection, limitation on datasheet 20*f1511a14SKuninori Morimoto 21*f1511a14SKuninori Morimoto============================================= 22*f1511a14SKuninori Morimoto* Multi channel 23*f1511a14SKuninori Morimoto============================================= 24*f1511a14SKuninori Morimoto 25*f1511a14SKuninori MorimotoMulti channel is supported by Multi-SSI, or TDM-SSI. 26*f1511a14SKuninori Morimoto 27*f1511a14SKuninori Morimoto Multi-SSI : 6ch case, you can use stereo x 3 SSI 28*f1511a14SKuninori Morimoto TDM-SSI : 6ch case, you can use TDM 29*f1511a14SKuninori Morimoto 30*f1511a14SKuninori Morimoto============================================= 31*f1511a14SKuninori Morimoto* Enable/Disable each modules 32*f1511a14SKuninori Morimoto============================================= 33*f1511a14SKuninori Morimoto 34*f1511a14SKuninori MorimotoSee datasheet to check SRC/CTU/MIX/DVC connect-limitation. 35*f1511a14SKuninori MorimotoDT controls enabling/disabling module. 36*f1511a14SKuninori Morimoto${LINUX}/arch/arm/boot/dts/r8a7790-lager.dts can be good example. 37*f1511a14SKuninori MorimotoThis is example of 38*f1511a14SKuninori Morimoto 39*f1511a14SKuninori MorimotoPlayback: [MEM] -> [SRC2] -> [DVC0] -> [SSIU0/SSI0] -> [codec] 40*f1511a14SKuninori MorimotoCapture: [MEM] <- [DVC1] <- [SRC3] <- [SSIU1/SSI1] <- [codec] 41*f1511a14SKuninori Morimoto 42*f1511a14SKuninori Morimoto &rcar_sound { 43*f1511a14SKuninori Morimoto ... 44*f1511a14SKuninori Morimoto rcar_sound,dai { 45*f1511a14SKuninori Morimoto dai0 { 46*f1511a14SKuninori Morimoto playback = <&ssi0 &src2 &dvc0>; 47*f1511a14SKuninori Morimoto capture = <&ssi1 &src3 &dvc1>; 48*f1511a14SKuninori Morimoto }; 49*f1511a14SKuninori Morimoto }; 50*f1511a14SKuninori Morimoto }; 51*f1511a14SKuninori Morimoto 52*f1511a14SKuninori MorimotoYou can use below. 53*f1511a14SKuninori Morimoto${LINUX}/arch/arm/boot/dts/r8a7790.dts can be good example. 54*f1511a14SKuninori Morimoto 55*f1511a14SKuninori Morimoto &src0 &ctu00 &mix0 &dvc0 &ssi0 56*f1511a14SKuninori Morimoto &src1 &ctu01 &mix1 &dvc1 &ssi1 57*f1511a14SKuninori Morimoto &src2 &ctu02 &ssi2 58*f1511a14SKuninori Morimoto &src3 &ctu03 &ssi3 59*f1511a14SKuninori Morimoto &src4 &ssi4 60*f1511a14SKuninori Morimoto &src5 &ctu10 &ssi5 61*f1511a14SKuninori Morimoto &src6 &ctu11 &ssi6 62*f1511a14SKuninori Morimoto &src7 &ctu12 &ssi7 63*f1511a14SKuninori Morimoto &src8 &ctu13 &ssi8 64*f1511a14SKuninori Morimoto &src9 &ssi9 65*f1511a14SKuninori Morimoto 66*f1511a14SKuninori Morimoto============================================= 67*f1511a14SKuninori Morimoto* SRC (Sampling Rate Converter) 68*f1511a14SKuninori Morimoto============================================= 69*f1511a14SKuninori Morimoto 70*f1511a14SKuninori Morimoto [xx]Hz [yy]Hz 71*f1511a14SKuninori Morimoto ------> [SRC] ------> 72*f1511a14SKuninori Morimoto 73*f1511a14SKuninori MorimotoSRC can convert [xx]Hz to [yy]Hz. Then, it has below 2 modes 74*f1511a14SKuninori Morimoto 75*f1511a14SKuninori Morimoto Asynchronous mode: input data / output data are based on different clocks. 76*f1511a14SKuninori Morimoto you can use this mode on Playback / Capture 77*f1511a14SKuninori Morimoto Synchronous mode: input data / output data are based on same clocks. 78*f1511a14SKuninori Morimoto This mode will be used if system doesn't have its input clock, 79*f1511a14SKuninori Morimoto for example digital TV case. 80*f1511a14SKuninori Morimoto you can use this mode on Playback 81*f1511a14SKuninori Morimoto 82*f1511a14SKuninori Morimoto------------------ 83*f1511a14SKuninori Morimoto** Asynchronous mode 84*f1511a14SKuninori Morimoto------------------ 85*f1511a14SKuninori Morimoto 86*f1511a14SKuninori MorimotoYou need to use "renesas,rsrc-card" sound card for it. 87*f1511a14SKuninori Morimotoexample) 88*f1511a14SKuninori Morimoto 89*f1511a14SKuninori Morimoto sound { 90*f1511a14SKuninori Morimoto compatible = "renesas,rsrc-card"; 91*f1511a14SKuninori Morimoto ... 92*f1511a14SKuninori Morimoto /* 93*f1511a14SKuninori Morimoto * SRC Asynchronous mode setting 94*f1511a14SKuninori Morimoto * Playback: 95*f1511a14SKuninori Morimoto * All input data will be converted to 48kHz 96*f1511a14SKuninori Morimoto * Capture: 97*f1511a14SKuninori Morimoto * Inputed 48kHz data will be converted to 98*f1511a14SKuninori Morimoto * system specified Hz 99*f1511a14SKuninori Morimoto */ 100*f1511a14SKuninori Morimoto convert-rate = <48000>; 101*f1511a14SKuninori Morimoto ... 102*f1511a14SKuninori Morimoto cpu { 103*f1511a14SKuninori Morimoto sound-dai = <&rcar_sound>; 104*f1511a14SKuninori Morimoto }; 105*f1511a14SKuninori Morimoto codec { 106*f1511a14SKuninori Morimoto ... 107*f1511a14SKuninori Morimoto }; 108*f1511a14SKuninori Morimoto }; 109*f1511a14SKuninori Morimoto 110*f1511a14SKuninori Morimoto------------------ 111*f1511a14SKuninori Morimoto** Synchronous mode 112*f1511a14SKuninori Morimoto------------------ 113*f1511a14SKuninori Morimoto 114*f1511a14SKuninori Morimoto > amixer set "SRC Out Rate" on 115*f1511a14SKuninori Morimoto > aplay xxxx.wav 116*f1511a14SKuninori Morimoto > amixer set "SRC Out Rate" 48000 117*f1511a14SKuninori Morimoto > amixer set "SRC Out Rate" 44100 118*f1511a14SKuninori Morimoto 119*f1511a14SKuninori Morimoto============================================= 120*f1511a14SKuninori Morimoto* CTU (Channel Transfer Unit) 121*f1511a14SKuninori Morimoto============================================= 122*f1511a14SKuninori Morimoto 123*f1511a14SKuninori Morimoto [xx]ch [yy]ch 124*f1511a14SKuninori Morimoto ------> [CTU] --------> 125*f1511a14SKuninori Morimoto 126*f1511a14SKuninori MorimotoCTU can convert [xx]ch to [yy]ch, or exchange outputed channel. 127*f1511a14SKuninori MorimotoCTU conversion needs matrix settings. 128*f1511a14SKuninori MorimotoFor more detail information, see below 129*f1511a14SKuninori Morimoto 130*f1511a14SKuninori Morimoto Renesas R-Car datasheet 131*f1511a14SKuninori Morimoto - Sampling Rate Converter Unit (SCU) 132*f1511a14SKuninori Morimoto - SCU Operation 133*f1511a14SKuninori Morimoto - CMD Block 134*f1511a14SKuninori Morimoto - Functional Blocks in CMD 135*f1511a14SKuninori Morimoto 136*f1511a14SKuninori Morimoto Renesas R-Car datasheet 137*f1511a14SKuninori Morimoto - Sampling Rate Converter Unit (SCU) 138*f1511a14SKuninori Morimoto - Register Description 139*f1511a14SKuninori Morimoto - CTUn Scale Value exx Register (CTUn_SVxxR) 140*f1511a14SKuninori Morimoto 141*f1511a14SKuninori Morimoto ${LINUX}/sound/soc/sh/rcar/ctu.c 142*f1511a14SKuninori Morimoto - comment of header 143*f1511a14SKuninori Morimoto 144*f1511a14SKuninori MorimotoYou need to use "renesas,rsrc-card" sound card for it. 145*f1511a14SKuninori Morimotoexample) 146*f1511a14SKuninori Morimoto 147*f1511a14SKuninori Morimoto sound { 148*f1511a14SKuninori Morimoto compatible = "renesas,rsrc-card"; 149*f1511a14SKuninori Morimoto ... 150*f1511a14SKuninori Morimoto /* 151*f1511a14SKuninori Morimoto * CTU setting 152*f1511a14SKuninori Morimoto * All input data will be converted to 2ch 153*f1511a14SKuninori Morimoto * as output data 154*f1511a14SKuninori Morimoto */ 155*f1511a14SKuninori Morimoto convert-channels = <2>; 156*f1511a14SKuninori Morimoto ... 157*f1511a14SKuninori Morimoto cpu { 158*f1511a14SKuninori Morimoto sound-dai = <&rcar_sound>; 159*f1511a14SKuninori Morimoto }; 160*f1511a14SKuninori Morimoto codec { 161*f1511a14SKuninori Morimoto ... 162*f1511a14SKuninori Morimoto }; 163*f1511a14SKuninori Morimoto }; 164*f1511a14SKuninori Morimoto 165*f1511a14SKuninori MorimotoEx) Exchange output channel 166*f1511a14SKuninori Morimoto Input -> Output 167*f1511a14SKuninori Morimoto 1ch -> 0ch 168*f1511a14SKuninori Morimoto 0ch -> 1ch 169*f1511a14SKuninori Morimoto 170*f1511a14SKuninori Morimoto example of using matrix 171*f1511a14SKuninori Morimoto output 0ch = (input 0ch x 0) + (input 1ch x 1) 172*f1511a14SKuninori Morimoto output 1ch = (input 0ch x 1) + (input 1ch x 0) 173*f1511a14SKuninori Morimoto 174*f1511a14SKuninori Morimoto amixer set "CTU Reset" on 175*f1511a14SKuninori Morimoto amixer set "CTU Pass" 9,10 176*f1511a14SKuninori Morimoto amixer set "CTU SV0" 0,4194304 177*f1511a14SKuninori Morimoto amixer set "CTU SV1" 4194304,0 178*f1511a14SKuninori Morimoto 179*f1511a14SKuninori Morimoto example of changing connection 180*f1511a14SKuninori Morimoto amixer set "CTU Reset" on 181*f1511a14SKuninori Morimoto amixer set "CTU Pass" 2,1 182*f1511a14SKuninori Morimoto 183*f1511a14SKuninori Morimoto============================================= 184*f1511a14SKuninori Morimoto* MIX (Mixer) 185*f1511a14SKuninori Morimoto============================================= 186*f1511a14SKuninori Morimoto 187*f1511a14SKuninori MorimotoMIX merges 2 sounds path. You can see 2 sound interface on system, 188*f1511a14SKuninori Morimotoand these sounds will be merged by MIX. 189*f1511a14SKuninori Morimoto 190*f1511a14SKuninori Morimoto aplay -D plughw:0,0 xxxx.wav & 191*f1511a14SKuninori Morimoto aplay -D plughw:0,1 yyyy.wav 192*f1511a14SKuninori Morimoto 193*f1511a14SKuninori MorimotoYou need to use "renesas,rsrc-card" sound card for it. 194*f1511a14SKuninori MorimotoEx) 195*f1511a14SKuninori Morimoto [MEM] -> [SRC1] -> [CTU02] -+-> [MIX0] -> [DVC0] -> [SSI0] 196*f1511a14SKuninori Morimoto | 197*f1511a14SKuninori Morimoto [MEM] -> [SRC2] -> [CTU03] -+ 198*f1511a14SKuninori Morimoto 199*f1511a14SKuninori Morimoto sound { 200*f1511a14SKuninori Morimoto compatible = "renesas,rsrc-card"; 201*f1511a14SKuninori Morimoto ... 202*f1511a14SKuninori Morimoto cpu@0 { 203*f1511a14SKuninori Morimoto sound-dai = <&rcar_sound 0>; 204*f1511a14SKuninori Morimoto }; 205*f1511a14SKuninori Morimoto cpu@1 { 206*f1511a14SKuninori Morimoto sound-dai = <&rcar_sound 1>; 207*f1511a14SKuninori Morimoto }; 208*f1511a14SKuninori Morimoto codec { 209*f1511a14SKuninori Morimoto ... 210*f1511a14SKuninori Morimoto }; 211*f1511a14SKuninori Morimoto }; 212*f1511a14SKuninori Morimoto 213*f1511a14SKuninori Morimoto &rcar_sound { 214*f1511a14SKuninori Morimoto ... 215*f1511a14SKuninori Morimoto rcar_sound,dai { 216*f1511a14SKuninori Morimoto dai0 { 217*f1511a14SKuninori Morimoto playback = <&src1 &ctu02 &mix0 &dvc0 &ssi0>; 218*f1511a14SKuninori Morimoto }; 219*f1511a14SKuninori Morimoto dai1 { 220*f1511a14SKuninori Morimoto playback = <&src2 &ctu03 &mix0 &dvc0 &ssi0>; 221*f1511a14SKuninori Morimoto }; 222*f1511a14SKuninori Morimoto }; 223*f1511a14SKuninori Morimoto }; 224*f1511a14SKuninori Morimoto 225*f1511a14SKuninori Morimoto============================================= 226*f1511a14SKuninori Morimoto* DVC (Digital Volume and Mute Function) 227*f1511a14SKuninori Morimoto============================================= 228*f1511a14SKuninori Morimoto 229*f1511a14SKuninori MorimotoDVC controls Playback/Capture volume. 230*f1511a14SKuninori Morimoto 231*f1511a14SKuninori MorimotoPlayback Volume 232*f1511a14SKuninori Morimoto amixer set "DVC Out" 100% 233*f1511a14SKuninori Morimoto 234*f1511a14SKuninori MorimotoCapture Volume 235*f1511a14SKuninori Morimoto amixer set "DVC In" 100% 236*f1511a14SKuninori Morimoto 237*f1511a14SKuninori MorimotoPlayback Mute 238*f1511a14SKuninori Morimoto amixer set "DVC Out Mute" on 239*f1511a14SKuninori Morimoto 240*f1511a14SKuninori MorimotoCapture Mute 241*f1511a14SKuninori Morimoto amixer set "DVC In Mute" on 242*f1511a14SKuninori Morimoto 243*f1511a14SKuninori MorimotoVolume Ramp 244*f1511a14SKuninori Morimoto amixer set "DVC Out Ramp Up Rate" "0.125 dB/64 steps" 245*f1511a14SKuninori Morimoto amixer set "DVC Out Ramp Down Rate" "0.125 dB/512 steps" 246*f1511a14SKuninori Morimoto amixer set "DVC Out Ramp" on 247*f1511a14SKuninori Morimoto aplay xxx.wav & 248*f1511a14SKuninori Morimoto amixer set "DVC Out" 80% // Volume Down 249*f1511a14SKuninori Morimoto amixer set "DVC Out" 100% // Volume Up 250*f1511a14SKuninori Morimoto 251*f1511a14SKuninori Morimoto============================================= 252*f1511a14SKuninori Morimoto* SSIU (Serial Sound Interface Unit) 253*f1511a14SKuninori Morimoto============================================= 254*f1511a14SKuninori Morimoto 255*f1511a14SKuninori MorimotoThere is no DT settings for SSIU, because SSIU will be automatically 256*f1511a14SKuninori Morimotoselected via SSI. 257*f1511a14SKuninori MorimotoSSIU can avoid some under/over run error, because it has some buffer. 258*f1511a14SKuninori MorimotoBut you can't use it if SSI was PIO mode. 259*f1511a14SKuninori MorimotoIn DMA mode, you can select not to use SSIU by using "no-busif" on DT. 260*f1511a14SKuninori Morimoto 261*f1511a14SKuninori Morimoto &ssi0 { 262*f1511a14SKuninori Morimoto no-busif; 263*f1511a14SKuninori Morimoto }; 264*f1511a14SKuninori Morimoto 265*f1511a14SKuninori Morimoto============================================= 266*f1511a14SKuninori Morimoto* SSI (Serial Sound Interface) 267*f1511a14SKuninori Morimoto============================================= 268*f1511a14SKuninori Morimoto 269*f1511a14SKuninori Morimoto** PIO mode 270*f1511a14SKuninori Morimoto 271*f1511a14SKuninori MorimotoYou can use PIO mode which is for connection check by using. 272*f1511a14SKuninori MorimotoNote: The system will drop non-SSI modules in PIO mode 273*f1511a14SKuninori Morimotoeven though if DT is selecting other modules. 274*f1511a14SKuninori Morimoto 275*f1511a14SKuninori Morimoto &ssi0 { 276*f1511a14SKuninori Morimoto pio-transfer 277*f1511a14SKuninori Morimoto }; 278*f1511a14SKuninori Morimoto 279*f1511a14SKuninori Morimoto** DMA mode without SSIU 280*f1511a14SKuninori Morimoto 281*f1511a14SKuninori MorimotoYou can use DMA without SSIU. 282*f1511a14SKuninori MorimotoNote: under/over run, or noise are likely to occur 283*f1511a14SKuninori Morimoto 284*f1511a14SKuninori Morimoto &ssi0 { 285*f1511a14SKuninori Morimoto no-busif; 286*f1511a14SKuninori Morimoto }; 287*f1511a14SKuninori Morimoto 288*f1511a14SKuninori Morimoto** PIN sharing 289*f1511a14SKuninori Morimoto 290*f1511a14SKuninori MorimotoEach SSI can share WS pin. It is based on platform. 291*f1511a14SKuninori MorimotoThis is example if SSI1 want to share WS pin with SSI0 292*f1511a14SKuninori Morimoto 293*f1511a14SKuninori Morimoto &ssi1 { 294*f1511a14SKuninori Morimoto shared-pin; 295*f1511a14SKuninori Morimoto }; 296*f1511a14SKuninori Morimoto 297*f1511a14SKuninori Morimoto** Multi-SSI 298*f1511a14SKuninori Morimoto 299*f1511a14SKuninori MorimotoYou can use Multi-SSI. 300*f1511a14SKuninori MorimotoThis is example of SSI0/SSI1/SSI2 (= for 6ch) 301*f1511a14SKuninori Morimoto 302*f1511a14SKuninori Morimoto &rcar_sound { 303*f1511a14SKuninori Morimoto ... 304*f1511a14SKuninori Morimoto rcar_sound,dai { 305*f1511a14SKuninori Morimoto dai0 { 306*f1511a14SKuninori Morimoto playback = <&ssi0 &ssi1 &ssi2 &src0 &dvc0>; 307*f1511a14SKuninori Morimoto }; 308*f1511a14SKuninori Morimoto }; 309*f1511a14SKuninori Morimoto }; 310*f1511a14SKuninori Morimoto 311*f1511a14SKuninori Morimoto** TDM-SSI 312*f1511a14SKuninori Morimoto 313*f1511a14SKuninori MorimotoYou can use TDM with SSI. 314*f1511a14SKuninori MorimotoThis is example of TDM 6ch. 315*f1511a14SKuninori MorimotoDriver can automatically switches TDM <-> stereo mode in this case. 316*f1511a14SKuninori Morimoto 317*f1511a14SKuninori Morimoto rsnd_tdm: sound { 318*f1511a14SKuninori Morimoto compatible = "simple-audio-card"; 319*f1511a14SKuninori Morimoto ... 320*f1511a14SKuninori Morimoto simple-audio-card,cpu { 321*f1511a14SKuninori Morimoto /* system can use TDM 6ch */ 322*f1511a14SKuninori Morimoto dai-tdm-slot-num = <6>; 323*f1511a14SKuninori Morimoto sound-dai = <&rcar_sound>; 324*f1511a14SKuninori Morimoto }; 325*f1511a14SKuninori Morimoto simple-audio-card,codec { 326*f1511a14SKuninori Morimoto ... 327*f1511a14SKuninori Morimoto }; 328*f1511a14SKuninori Morimoto }; 329*f1511a14SKuninori Morimoto 330*f1511a14SKuninori Morimoto 331*f1511a14SKuninori Morimoto============================================= 33290e8e50fSKuninori MorimotoRequired properties: 333*f1511a14SKuninori Morimoto============================================= 334*f1511a14SKuninori 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 37690e8e50fSKuninori Morimoto 37790e8e50fSKuninori MorimotoSSI subnode properties: 37890e8e50fSKuninori Morimoto- interrupts : Should contain SSI interrupt for PIO transfer 37990e8e50fSKuninori Morimoto- shared-pin : if shared clock pin 380199e7688SKuninori Morimoto- pio-transfer : use PIO transfer mode 381d9288d0bSKuninori Morimoto- no-busif : BUSIF is not ussed when [mem -> SSI] via DMA case 382e80a2fb1SKuninori Morimoto- dma : Should contain Audio DMAC entry 383e80a2fb1SKuninori Morimoto- dma-names : SSI case "rx" (=playback), "tx" (=capture) 384e80a2fb1SKuninori Morimoto SSIU case "rxu" (=playback), "txu" (=capture) 38590e8e50fSKuninori Morimoto 3868bab0dd5SKuninori MorimotoSRC subnode properties: 387e80a2fb1SKuninori Morimoto- dma : Should contain Audio DMAC entry 388e80a2fb1SKuninori Morimoto- dma-names : "rx" (=playback), "tx" (=capture) 389e80a2fb1SKuninori Morimoto 390e80a2fb1SKuninori MorimotoDVC subnode properties: 391e80a2fb1SKuninori Morimoto- dma : Should contain Audio DMAC entry 392e80a2fb1SKuninori Morimoto- dma-names : "tx" (=playback/capture) 3938bab0dd5SKuninori Morimoto 39490e8e50fSKuninori MorimotoDAI subnode properties: 39590e8e50fSKuninori Morimoto- playback : list of playback modules 39690e8e50fSKuninori Morimoto- capture : list of capture modules 39790e8e50fSKuninori Morimoto 398*f1511a14SKuninori Morimoto 399*f1511a14SKuninori Morimoto============================================= 40090e8e50fSKuninori MorimotoExample: 401*f1511a14SKuninori Morimoto============================================= 40290e8e50fSKuninori Morimoto 403596f74ecSGeert Uytterhoevenrcar_sound: sound@ec500000 { 40490e8e50fSKuninori Morimoto #sound-dai-cells = <1>; 40556ba98acSGeert Uytterhoeven compatible = "renesas,rcar_sound-r8a7791", "renesas,rcar_sound-gen2"; 40690e8e50fSKuninori Morimoto reg = <0 0xec500000 0 0x1000>, /* SCU */ 40790e8e50fSKuninori Morimoto <0 0xec5a0000 0 0x100>, /* ADG */ 40890e8e50fSKuninori Morimoto <0 0xec540000 0 0x1000>, /* SSIU */ 409d3b1c0baSKuninori Morimoto <0 0xec541000 0 0x1280>, /* SSI */ 410d3b1c0baSKuninori Morimoto <0 0xec740000 0 0x200>; /* Audio DMAC peri peri*/ 411d3b1c0baSKuninori Morimoto reg-names = "scu", "adg", "ssiu", "ssi", "audmapp"; 41290e8e50fSKuninori Morimoto 413bb02714fSKuninori Morimoto clocks = <&mstp10_clks R8A7790_CLK_SSI_ALL>, 414bb02714fSKuninori Morimoto <&mstp10_clks R8A7790_CLK_SSI9>, <&mstp10_clks R8A7790_CLK_SSI8>, 415bb02714fSKuninori Morimoto <&mstp10_clks R8A7790_CLK_SSI7>, <&mstp10_clks R8A7790_CLK_SSI6>, 416bb02714fSKuninori Morimoto <&mstp10_clks R8A7790_CLK_SSI5>, <&mstp10_clks R8A7790_CLK_SSI4>, 417bb02714fSKuninori Morimoto <&mstp10_clks R8A7790_CLK_SSI3>, <&mstp10_clks R8A7790_CLK_SSI2>, 418bb02714fSKuninori Morimoto <&mstp10_clks R8A7790_CLK_SSI1>, <&mstp10_clks R8A7790_CLK_SSI0>, 419bb02714fSKuninori Morimoto <&mstp10_clks R8A7790_CLK_SCU_SRC9>, <&mstp10_clks R8A7790_CLK_SCU_SRC8>, 420bb02714fSKuninori Morimoto <&mstp10_clks R8A7790_CLK_SCU_SRC7>, <&mstp10_clks R8A7790_CLK_SCU_SRC6>, 421bb02714fSKuninori Morimoto <&mstp10_clks R8A7790_CLK_SCU_SRC5>, <&mstp10_clks R8A7790_CLK_SCU_SRC4>, 422bb02714fSKuninori Morimoto <&mstp10_clks R8A7790_CLK_SCU_SRC3>, <&mstp10_clks R8A7790_CLK_SCU_SRC2>, 423bb02714fSKuninori Morimoto <&mstp10_clks R8A7790_CLK_SCU_SRC1>, <&mstp10_clks R8A7790_CLK_SCU_SRC0>, 424bb02714fSKuninori Morimoto <&mstp10_clks R8A7790_CLK_SCU_DVC0>, <&mstp10_clks R8A7790_CLK_SCU_DVC1>, 425bb02714fSKuninori Morimoto <&audio_clk_a>, <&audio_clk_b>, <&audio_clk_c>, <&m2_clk>; 426bb02714fSKuninori Morimoto clock-names = "ssi-all", 427bb02714fSKuninori Morimoto "ssi.9", "ssi.8", "ssi.7", "ssi.6", "ssi.5", 428bb02714fSKuninori Morimoto "ssi.4", "ssi.3", "ssi.2", "ssi.1", "ssi.0", 429bb02714fSKuninori Morimoto "src.9", "src.8", "src.7", "src.6", "src.5", 430bb02714fSKuninori Morimoto "src.4", "src.3", "src.2", "src.1", "src.0", 431bb02714fSKuninori Morimoto "dvc.0", "dvc.1", 432bb02714fSKuninori Morimoto "clk_a", "clk_b", "clk_c", "clk_i"; 433bb02714fSKuninori Morimoto 43434cb6123SKuninori Morimoto rcar_sound,dvc { 435e80a2fb1SKuninori Morimoto dvc0: dvc@0 { 436e80a2fb1SKuninori Morimoto dmas = <&audma0 0xbc>; 437e80a2fb1SKuninori Morimoto dma-names = "tx"; 438e80a2fb1SKuninori Morimoto }; 439e80a2fb1SKuninori Morimoto dvc1: dvc@1 { 440e80a2fb1SKuninori Morimoto dmas = <&audma0 0xbe>; 441e80a2fb1SKuninori Morimoto dma-names = "tx"; 442e80a2fb1SKuninori Morimoto }; 44334cb6123SKuninori Morimoto }; 44434cb6123SKuninori Morimoto 44570fb1052SKuninori Morimoto rcar_sound,mix { 44670fb1052SKuninori Morimoto mix0: mix@0 { }; 44770fb1052SKuninori Morimoto mix1: mix@1 { }; 44870fb1052SKuninori Morimoto }; 44970fb1052SKuninori Morimoto 4509269e3c3SKuninori Morimoto rcar_sound,ctu { 4519269e3c3SKuninori Morimoto ctu00: ctu@0 { }; 4529269e3c3SKuninori Morimoto ctu01: ctu@1 { }; 4539269e3c3SKuninori Morimoto ctu02: ctu@2 { }; 4549269e3c3SKuninori Morimoto ctu03: ctu@3 { }; 4559269e3c3SKuninori Morimoto ctu10: ctu@4 { }; 4569269e3c3SKuninori Morimoto ctu11: ctu@5 { }; 4579269e3c3SKuninori Morimoto ctu12: ctu@6 { }; 4589269e3c3SKuninori Morimoto ctu13: ctu@7 { }; 4599269e3c3SKuninori Morimoto }; 4609269e3c3SKuninori Morimoto 46190e8e50fSKuninori Morimoto rcar_sound,src { 4625cf4f686SKuninori Morimoto src0: src@0 { 4635cf4f686SKuninori Morimoto interrupts = <0 352 IRQ_TYPE_LEVEL_HIGH>; 464e80a2fb1SKuninori Morimoto dmas = <&audma0 0x85>, <&audma1 0x9a>; 465e80a2fb1SKuninori Morimoto dma-names = "rx", "tx"; 4665cf4f686SKuninori Morimoto }; 4675cf4f686SKuninori Morimoto src1: src@1 { 4685cf4f686SKuninori Morimoto interrupts = <0 353 IRQ_TYPE_LEVEL_HIGH>; 469e80a2fb1SKuninori Morimoto dmas = <&audma0 0x87>, <&audma1 0x9c>; 470e80a2fb1SKuninori Morimoto dma-names = "rx", "tx"; 4715cf4f686SKuninori Morimoto }; 4725cf4f686SKuninori Morimoto src2: src@2 { 4735cf4f686SKuninori Morimoto interrupts = <0 354 IRQ_TYPE_LEVEL_HIGH>; 474e80a2fb1SKuninori Morimoto dmas = <&audma0 0x89>, <&audma1 0x9e>; 475e80a2fb1SKuninori Morimoto dma-names = "rx", "tx"; 4765cf4f686SKuninori Morimoto }; 4775cf4f686SKuninori Morimoto src3: src@3 { 4785cf4f686SKuninori Morimoto interrupts = <0 355 IRQ_TYPE_LEVEL_HIGH>; 479e80a2fb1SKuninori Morimoto dmas = <&audma0 0x8b>, <&audma1 0xa0>; 480e80a2fb1SKuninori Morimoto dma-names = "rx", "tx"; 4815cf4f686SKuninori Morimoto }; 4825cf4f686SKuninori Morimoto src4: src@4 { 4835cf4f686SKuninori Morimoto interrupts = <0 356 IRQ_TYPE_LEVEL_HIGH>; 484e80a2fb1SKuninori Morimoto dmas = <&audma0 0x8d>, <&audma1 0xb0>; 485e80a2fb1SKuninori Morimoto dma-names = "rx", "tx"; 4865cf4f686SKuninori Morimoto }; 4875cf4f686SKuninori Morimoto src5: src@5 { 4885cf4f686SKuninori Morimoto interrupts = <0 357 IRQ_TYPE_LEVEL_HIGH>; 489e80a2fb1SKuninori Morimoto dmas = <&audma0 0x8f>, <&audma1 0xb2>; 490e80a2fb1SKuninori Morimoto dma-names = "rx", "tx"; 4915cf4f686SKuninori Morimoto }; 4925cf4f686SKuninori Morimoto src6: src@6 { 4935cf4f686SKuninori Morimoto interrupts = <0 358 IRQ_TYPE_LEVEL_HIGH>; 494e80a2fb1SKuninori Morimoto dmas = <&audma0 0x91>, <&audma1 0xb4>; 495e80a2fb1SKuninori Morimoto dma-names = "rx", "tx"; 4965cf4f686SKuninori Morimoto }; 4975cf4f686SKuninori Morimoto src7: src@7 { 4985cf4f686SKuninori Morimoto interrupts = <0 359 IRQ_TYPE_LEVEL_HIGH>; 499e80a2fb1SKuninori Morimoto dmas = <&audma0 0x93>, <&audma1 0xb6>; 500e80a2fb1SKuninori Morimoto dma-names = "rx", "tx"; 5015cf4f686SKuninori Morimoto }; 5025cf4f686SKuninori Morimoto src8: src@8 { 5035cf4f686SKuninori Morimoto interrupts = <0 360 IRQ_TYPE_LEVEL_HIGH>; 504e80a2fb1SKuninori Morimoto dmas = <&audma0 0x95>, <&audma1 0xb8>; 505e80a2fb1SKuninori Morimoto dma-names = "rx", "tx"; 5065cf4f686SKuninori Morimoto }; 5075cf4f686SKuninori Morimoto src9: src@9 { 5085cf4f686SKuninori Morimoto interrupts = <0 361 IRQ_TYPE_LEVEL_HIGH>; 509e80a2fb1SKuninori Morimoto dmas = <&audma0 0x97>, <&audma1 0xba>; 510e80a2fb1SKuninori Morimoto dma-names = "rx", "tx"; 5115cf4f686SKuninori Morimoto }; 51290e8e50fSKuninori Morimoto }; 51390e8e50fSKuninori Morimoto 51490e8e50fSKuninori Morimoto rcar_sound,ssi { 51590e8e50fSKuninori Morimoto ssi0: ssi@0 { 51690e8e50fSKuninori Morimoto interrupts = <0 370 IRQ_TYPE_LEVEL_HIGH>; 517e80a2fb1SKuninori Morimoto dmas = <&audma0 0x01>, <&audma1 0x02>, <&audma0 0x15>, <&audma1 0x16>; 518e80a2fb1SKuninori Morimoto dma-names = "rx", "tx", "rxu", "txu"; 51990e8e50fSKuninori Morimoto }; 52090e8e50fSKuninori Morimoto ssi1: ssi@1 { 52190e8e50fSKuninori Morimoto interrupts = <0 371 IRQ_TYPE_LEVEL_HIGH>; 522e80a2fb1SKuninori Morimoto dmas = <&audma0 0x03>, <&audma1 0x04>, <&audma0 0x49>, <&audma1 0x4a>; 523e80a2fb1SKuninori Morimoto dma-names = "rx", "tx", "rxu", "txu"; 52490e8e50fSKuninori Morimoto }; 52590e8e50fSKuninori Morimoto ssi2: ssi@2 { 52690e8e50fSKuninori Morimoto interrupts = <0 372 IRQ_TYPE_LEVEL_HIGH>; 527e80a2fb1SKuninori Morimoto dmas = <&audma0 0x05>, <&audma1 0x06>, <&audma0 0x63>, <&audma1 0x64>; 528e80a2fb1SKuninori Morimoto dma-names = "rx", "tx", "rxu", "txu"; 52990e8e50fSKuninori Morimoto }; 53090e8e50fSKuninori Morimoto ssi3: ssi@3 { 53190e8e50fSKuninori Morimoto interrupts = <0 373 IRQ_TYPE_LEVEL_HIGH>; 532e80a2fb1SKuninori Morimoto dmas = <&audma0 0x07>, <&audma1 0x08>, <&audma0 0x6f>, <&audma1 0x70>; 533e80a2fb1SKuninori Morimoto dma-names = "rx", "tx", "rxu", "txu"; 53490e8e50fSKuninori Morimoto }; 53590e8e50fSKuninori Morimoto ssi4: ssi@4 { 53690e8e50fSKuninori Morimoto interrupts = <0 374 IRQ_TYPE_LEVEL_HIGH>; 537e80a2fb1SKuninori Morimoto dmas = <&audma0 0x09>, <&audma1 0x0a>, <&audma0 0x71>, <&audma1 0x72>; 538e80a2fb1SKuninori Morimoto dma-names = "rx", "tx", "rxu", "txu"; 53990e8e50fSKuninori Morimoto }; 54090e8e50fSKuninori Morimoto ssi5: ssi@5 { 54190e8e50fSKuninori Morimoto interrupts = <0 375 IRQ_TYPE_LEVEL_HIGH>; 542e80a2fb1SKuninori Morimoto dmas = <&audma0 0x0b>, <&audma1 0x0c>, <&audma0 0x73>, <&audma1 0x74>; 543e80a2fb1SKuninori Morimoto dma-names = "rx", "tx", "rxu", "txu"; 54490e8e50fSKuninori Morimoto }; 54590e8e50fSKuninori Morimoto ssi6: ssi@6 { 54690e8e50fSKuninori Morimoto interrupts = <0 376 IRQ_TYPE_LEVEL_HIGH>; 547e80a2fb1SKuninori Morimoto dmas = <&audma0 0x0d>, <&audma1 0x0e>, <&audma0 0x75>, <&audma1 0x76>; 548e80a2fb1SKuninori Morimoto dma-names = "rx", "tx", "rxu", "txu"; 54990e8e50fSKuninori Morimoto }; 55090e8e50fSKuninori Morimoto ssi7: ssi@7 { 55190e8e50fSKuninori Morimoto interrupts = <0 377 IRQ_TYPE_LEVEL_HIGH>; 552e80a2fb1SKuninori Morimoto dmas = <&audma0 0x0f>, <&audma1 0x10>, <&audma0 0x79>, <&audma1 0x7a>; 553e80a2fb1SKuninori Morimoto dma-names = "rx", "tx", "rxu", "txu"; 55490e8e50fSKuninori Morimoto }; 55590e8e50fSKuninori Morimoto ssi8: ssi@8 { 55690e8e50fSKuninori Morimoto interrupts = <0 378 IRQ_TYPE_LEVEL_HIGH>; 557e80a2fb1SKuninori Morimoto dmas = <&audma0 0x11>, <&audma1 0x12>, <&audma0 0x7b>, <&audma1 0x7c>; 558e80a2fb1SKuninori Morimoto dma-names = "rx", "tx", "rxu", "txu"; 55990e8e50fSKuninori Morimoto }; 56090e8e50fSKuninori Morimoto ssi9: ssi@9 { 56190e8e50fSKuninori Morimoto interrupts = <0 379 IRQ_TYPE_LEVEL_HIGH>; 562e80a2fb1SKuninori Morimoto dmas = <&audma0 0x13>, <&audma1 0x14>, <&audma0 0x7d>, <&audma1 0x7e>; 563e80a2fb1SKuninori Morimoto dma-names = "rx", "tx", "rxu", "txu"; 56490e8e50fSKuninori Morimoto }; 56590e8e50fSKuninori Morimoto }; 56690e8e50fSKuninori Morimoto 56790e8e50fSKuninori Morimoto rcar_sound,dai { 56890e8e50fSKuninori Morimoto dai0 { 56990e8e50fSKuninori Morimoto playback = <&ssi5 &src5>; 57090e8e50fSKuninori Morimoto capture = <&ssi6>; 57190e8e50fSKuninori Morimoto }; 57290e8e50fSKuninori Morimoto dai1 { 57390e8e50fSKuninori Morimoto playback = <&ssi3>; 57490e8e50fSKuninori Morimoto }; 57590e8e50fSKuninori Morimoto dai2 { 57690e8e50fSKuninori Morimoto capture = <&ssi4>; 57790e8e50fSKuninori Morimoto }; 57890e8e50fSKuninori Morimoto dai3 { 57990e8e50fSKuninori Morimoto playback = <&ssi7>; 58090e8e50fSKuninori Morimoto }; 58190e8e50fSKuninori Morimoto dai4 { 58290e8e50fSKuninori Morimoto capture = <&ssi8>; 58390e8e50fSKuninori Morimoto }; 58490e8e50fSKuninori Morimoto }; 58590e8e50fSKuninori Morimoto}; 586f3f17d32SKuninori Morimoto 587*f1511a14SKuninori Morimoto============================================= 588f3f17d32SKuninori MorimotoExample: simple sound card 589*f1511a14SKuninori Morimoto============================================= 590f3f17d32SKuninori Morimoto 591f3f17d32SKuninori Morimoto rsnd_ak4643: sound { 592f3f17d32SKuninori Morimoto compatible = "simple-audio-card"; 593f3f17d32SKuninori Morimoto 594f3f17d32SKuninori Morimoto simple-audio-card,format = "left_j"; 595f3f17d32SKuninori Morimoto simple-audio-card,bitclock-master = <&sndcodec>; 596f3f17d32SKuninori Morimoto simple-audio-card,frame-master = <&sndcodec>; 597f3f17d32SKuninori Morimoto 598f3f17d32SKuninori Morimoto sndcpu: simple-audio-card,cpu { 599f3f17d32SKuninori Morimoto sound-dai = <&rcar_sound>; 600f3f17d32SKuninori Morimoto }; 601f3f17d32SKuninori Morimoto 602f3f17d32SKuninori Morimoto sndcodec: simple-audio-card,codec { 603f3f17d32SKuninori Morimoto sound-dai = <&ak4643>; 604f3f17d32SKuninori Morimoto clocks = <&audio_clock>; 605f3f17d32SKuninori Morimoto }; 606f3f17d32SKuninori Morimoto }; 607f3f17d32SKuninori Morimoto 608f3f17d32SKuninori Morimoto&rcar_sound { 609f3f17d32SKuninori Morimoto pinctrl-0 = <&sound_pins &sound_clk_pins>; 610f3f17d32SKuninori Morimoto pinctrl-names = "default"; 611f3f17d32SKuninori Morimoto 612f3f17d32SKuninori Morimoto /* Single DAI */ 613f3f17d32SKuninori Morimoto #sound-dai-cells = <0>; 614f3f17d32SKuninori Morimoto 615f3f17d32SKuninori Morimoto status = "okay"; 616f3f17d32SKuninori Morimoto 617f3f17d32SKuninori Morimoto rcar_sound,dai { 618f3f17d32SKuninori Morimoto dai0 { 619f3f17d32SKuninori Morimoto playback = <&ssi0 &src2 &dvc0>; 620f3f17d32SKuninori Morimoto capture = <&ssi1 &src3 &dvc1>; 621f3f17d32SKuninori Morimoto }; 622f3f17d32SKuninori Morimoto }; 623f3f17d32SKuninori Morimoto}; 624f3f17d32SKuninori Morimoto 625f3f17d32SKuninori Morimoto&ssi1 { 626f3f17d32SKuninori Morimoto shared-pin; 627f3f17d32SKuninori Morimoto}; 62844bf5361SKuninori Morimoto 629*f1511a14SKuninori Morimoto============================================= 63044bf5361SKuninori MorimotoExample: simple sound card for TDM 631*f1511a14SKuninori Morimoto============================================= 63244bf5361SKuninori Morimoto 63344bf5361SKuninori Morimoto rsnd_tdm: sound { 63444bf5361SKuninori Morimoto compatible = "simple-audio-card"; 63544bf5361SKuninori Morimoto 63644bf5361SKuninori Morimoto simple-audio-card,format = "left_j"; 63744bf5361SKuninori Morimoto simple-audio-card,bitclock-master = <&sndcodec>; 63844bf5361SKuninori Morimoto simple-audio-card,frame-master = <&sndcodec>; 63944bf5361SKuninori Morimoto 64044bf5361SKuninori Morimoto sndcpu: simple-audio-card,cpu { 64144bf5361SKuninori Morimoto sound-dai = <&rcar_sound>; 64244bf5361SKuninori Morimoto dai-tdm-slot-num = <6>; 64344bf5361SKuninori Morimoto }; 64444bf5361SKuninori Morimoto 64544bf5361SKuninori Morimoto sndcodec: simple-audio-card,codec { 64644bf5361SKuninori Morimoto sound-dai = <&xxx>; 64744bf5361SKuninori Morimoto }; 64844bf5361SKuninori Morimoto }; 649b4c83b17SKuninori Morimoto 650*f1511a14SKuninori Morimoto============================================= 651b4c83b17SKuninori MorimotoExample: simple sound card for Multi channel 652*f1511a14SKuninori Morimoto============================================= 653b4c83b17SKuninori Morimoto 654b4c83b17SKuninori Morimoto&rcar_sound { 655b4c83b17SKuninori Morimoto pinctrl-0 = <&sound_pins &sound_clk_pins>; 656b4c83b17SKuninori Morimoto pinctrl-names = "default"; 657b4c83b17SKuninori Morimoto 658b4c83b17SKuninori Morimoto /* Single DAI */ 659b4c83b17SKuninori Morimoto #sound-dai-cells = <0>; 660b4c83b17SKuninori Morimoto 661b4c83b17SKuninori Morimoto status = "okay"; 662b4c83b17SKuninori Morimoto 663b4c83b17SKuninori Morimoto rcar_sound,dai { 664b4c83b17SKuninori Morimoto dai0 { 665b4c83b17SKuninori Morimoto playback = <&ssi0 &ssi1 &ssi2 &src0 &dvc0>; 666b4c83b17SKuninori Morimoto }; 667b4c83b17SKuninori Morimoto }; 668b4c83b17SKuninori Morimoto}; 669