Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 /*
0003  * audio-graph-card2-custom-sample.dtsi
0004  *
0005  * Copyright (C) 2020 Renesas Electronics Corp.
0006  * Copyright (C) 2020 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
0007  *
0008  * This sample indicates how to use audio-graph-card2 and its
0009  * custom driver. "audio-graph-card2-custom-sample" is the custome driver
0010  * which is using audio-graph-card2.
0011  *
0012  * You can easily use this sample by adding below line on your DT file,
0013  * and add new CONFIG to your .config.
0014  *
0015  *      #include "../../../../../sound/soc/generic/audio-graph-card2-custom-sample.dtsi"
0016  *
0017  *      CONFIG_SND_AUDIO_GRAPH_CARD2
0018  *      CONFIG_SND_AUDIO_GRAPH_CARD2_CUSTOM_SAMPLE
0019  *      CONFIG_SND_TEST_COMPONENT
0020  *
0021  *
0022  * You can indicate more detail each device behavior as debug if you modify
0023  * "compatible" on each test-component. see below
0024  *
0025  *      test_cpu {
0026  *      -       compatible = "test-cpu";
0027  *      +       compatible = "test-cpu-verbose";
0028  *              ...
0029  *      };
0030  *
0031  *      test_codec {
0032  *      -       compatible = "test-codec";
0033  *      +       compatible = "test-codec-verbose";
0034  *              ...
0035  *      };
0036  *
0037  */
0038 / {
0039         /*
0040          * @ : used at links
0041          *
0042          * [Normal]
0043          *      cpu0 <-@-----------------> codec0
0044          *
0045          * [Multi-CPU/Codec]
0046          *              +-+             +-+
0047          *      cpu1 <--| |<-@--------->| |-> codec1
0048          *      cpu2 <--| |             | |-> codec2
0049          *              +-+             +-+
0050          *
0051          * [DPCM]
0052          *      FE              BE
0053          *                ****
0054          *      cpu3 <-@--*  *--@-> codec3
0055          *      cpu4 <-@--*  *
0056          *                ****
0057          *
0058          * [DPCM-Multi]
0059          *
0060          * --NOTE--
0061          * Multi-FE is not supported by ASoC.
0062          *
0063          *      FE              BE
0064          *                ****      +-+
0065          *      cpu5 <-@--*  *--@-> | | -> codec4
0066          *      cpu6 <-@--*  *      | | -> codec5
0067          *                ****      +-+
0068          *
0069          * [Codec2Codec]
0070          *                         +-@-> codec6
0071          *                         |
0072          *                         +---> codec7
0073          *
0074          * [Codec2Codec-Multi]
0075          *
0076          * --NOTE--
0077          * Multi connect N:M is not supported by ASoC.
0078          *
0079          *                              +-+
0080          *                         +-@->| |-> codec8
0081          *                         |    | |-> codec9
0082          *                         |    +-+
0083          *                         |    +-+
0084          *                         +--->| |-> codec10
0085          *                              | |-> codec11
0086          *                              +-+
0087          */
0088         audio-graph-card2-custom-sample {
0089                 /*
0090                  * You can use audio-graph-card2 directly by using
0091                  *
0092                  * compatible = "audio-graph-card2";
0093                  */
0094                 compatible = "audio-graph-card2-custom-sample";
0095 
0096                         /* for [DPCM]              */
0097                         /* BE                   FE */
0098                 routing = "TC DAI3 Playback",   "DAI3 Playback",
0099                           "TC DAI3 Playback",   "DAI4 Playback",
0100                           "DAI3 Capture",       "TC DAI3 Capture",
0101                           "DAI4 Capture",       "TC DAI3 Capture",
0102                         /* for [DPCM-Multi]        */
0103                         /* BE                   FE */
0104                           "TC DAI4 Playback",   "DAI5 Playback",
0105                           "TC DAI5 Playback",   "DAI5 Playback",
0106                           "TC DAI4 Playback",   "DAI6 Playback",
0107                           "TC DAI5 Playback",   "DAI6 Playback",
0108                           "DAI5 Capture",       "TC DAI4 Capture",
0109                           "DAI5 Capture",       "TC DAI5 Capture",
0110                           "DAI6 Capture",       "TC DAI4 Capture",
0111                           "DAI6 Capture",       "TC DAI5 Capture",
0112                         /* for [Codec2Codec] */
0113                           "TC OUT",             "TC DAI7 Playback",
0114                           "TC DAI6 Capture",    "TC IN",
0115                         /* for [Codec2Codec-Multi] */
0116                           "TC OUT",             "TC DAI10 Playback",
0117                           "TC DAI8 Capture",    "TC IN",
0118                           "TC OUT",             "TC DAI11 Playback",
0119                           "TC DAI9 Capture",    "TC IN";
0120 
0121                 links = <
0122                         /*
0123                          * [Normal]: cpu side only
0124                          * cpu0/codec0
0125                          */
0126                          &cpu0
0127 
0128                         /*
0129                          * [Multi-CPU/Codec]: cpu side only
0130                          * cpu1/cpu2/codec1/codec2
0131                          */
0132                          &mcpu0
0133 
0134                         /*
0135                          * [DPCM]: both FE / BE
0136                          * cpu3/cpu4/codec3
0137                          */
0138                          &fe00 &fe01 &be0
0139 
0140                         /*
0141                          * [DPCM-Multi]: both FE / BE
0142                          * cpu5/cpu6/codec4/codec5
0143                          */
0144                          &fe10 &fe11 &be1
0145 
0146                         /*
0147                          * [Codec2Codec]: cpu side only
0148                          * codec6/codec7
0149                          */
0150                          &c2c
0151 
0152                         /*
0153                          * [Codec2Codec-Multi]: cpu side only
0154                          * codec8/codec9/codec10/codec11
0155                          */
0156                          &c2c_m
0157                 >;
0158 
0159                 multi {
0160                         ports@0 {
0161                         /* [Multi-CPU] */
0162                         mcpu0:  port@0 { mcpu0_ep: endpoint { remote-endpoint = <&mcodec0_ep>; }; };
0163                                 port@1 { mcpu1_ep: endpoint { remote-endpoint = <&cpu1_ep>;    }; };
0164                                 port@2 { mcpu2_ep: endpoint { remote-endpoint = <&cpu2_ep>;    }; };
0165                         };
0166 
0167                         /* [Multi-Codec] */
0168                         ports@1 {
0169                                 port@0 { mcodec0_ep: endpoint { remote-endpoint = <&mcpu0_ep>;  }; };
0170                                 port@1 { mcodec1_ep: endpoint { remote-endpoint = <&codec1_ep>; }; };
0171                                 port@2 { mcodec2_ep: endpoint { remote-endpoint = <&codec2_ep>; }; };
0172                         };
0173 
0174                         /* [DPCM-Multi]::BE */
0175                         ports@2 {
0176                                 port@0 { mbe_ep:  endpoint { remote-endpoint = <&be10_ep>;  }; };
0177                                 port@1 { mbe1_ep: endpoint { remote-endpoint = <&codec4_ep>; }; };
0178                                 port@2 { mbe2_ep: endpoint { remote-endpoint = <&codec5_ep>; }; };
0179                         };
0180 
0181                         /* [Codec2Codec-Multi]::CPU */
0182                         ports@3 {
0183                                 port@0 { mc2c0_ep:  endpoint { remote-endpoint = <&c2cmf_ep>;  }; };
0184                                 port@1 { mc2c00_ep: endpoint { remote-endpoint = <&codec8_ep>; }; };
0185                                 port@2 { mc2c01_ep: endpoint { remote-endpoint = <&codec9_ep>; }; };
0186                         };
0187 
0188                         /* [Codec2Codec-Multi]::Codec */
0189                         ports@4 {
0190                                 port@0 { mc2c1_ep:  endpoint { remote-endpoint = <&c2cmb_ep>;  }; };
0191                                 port@1 { mc2c10_ep: endpoint { remote-endpoint = <&codec10_ep>; }; };
0192                                 port@2 { mc2c11_ep: endpoint { remote-endpoint = <&codec11_ep>; }; };
0193                         };
0194                 };
0195 
0196                 dpcm {
0197                         ports@0 {
0198                         /* [DPCM]::FE */
0199                         fe00:   port@0 { fe00_ep: endpoint { remote-endpoint = <&cpu3_ep>; }; };
0200                         fe01:   port@1 { fe01_ep: endpoint { remote-endpoint = <&cpu4_ep>; }; };
0201 
0202                         /* [DPCM-Multi]::FE */
0203                         fe10:   port@2 { fe10_ep: endpoint { remote-endpoint = <&cpu5_ep>; }; };
0204                         fe11:   port@3 { fe11_ep: endpoint { remote-endpoint = <&cpu6_ep>; }; };
0205                         };
0206 
0207                         ports@1 {
0208                         /* [DPCM]::BE */
0209                         be0:    port@0 { be00_ep: endpoint { remote-endpoint = <&codec3_ep>; }; };
0210 
0211                         /* [DPCM-Multi]::BE */
0212                         be1:    port@1 { be10_ep: endpoint { remote-endpoint = <&mbe_ep>; }; };
0213                         };
0214                 };
0215 
0216                 codec2codec {
0217                         /* [Codec2Codec] */
0218                         ports@0 {
0219                                 /* use default settings */
0220                         c2c:    port@0 { c2cf_ep: endpoint { remote-endpoint = <&codec6_ep>; }; };
0221                                 port@1 { c2cb_ep: endpoint { remote-endpoint = <&codec7_ep>; }; };
0222                         };
0223 
0224                         /* [Codec2Codec-Multi] */
0225                         ports@1 {
0226                                 /* use original settings */
0227                                 rate = <48000>;
0228                         c2c_m:  port@0 { c2cmf_ep: endpoint { remote-endpoint = <&mc2c0_ep>; }; };
0229                                 port@1 { c2cmb_ep: endpoint { remote-endpoint = <&mc2c1_ep>; }; };
0230                         };
0231                 };
0232         };
0233 
0234         test_cpu {
0235                 /*
0236                  * update compatible to indicate more detail behaviour
0237                  * if you want. see test-compatible for more detail.
0238                  *
0239                  * ex)
0240                  *      - compatible = "test-cpu";
0241                  *      + compatible = "test-cpu-verbose";
0242                  */
0243                 compatible = "test-cpu";
0244                 ports {
0245                         bitclock-master;
0246                         frame-master;
0247                         /* [Normal] */
0248                         cpu0: port@0 { cpu0_ep: endpoint { remote-endpoint = <&codec0_ep>; }; };
0249 
0250                         /* [Multi-CPU] */
0251                               port@1 { cpu1_ep: endpoint { remote-endpoint = <&mcpu1_ep>; }; };
0252                               port@2 { cpu2_ep: endpoint { remote-endpoint = <&mcpu2_ep>; }; };
0253 
0254                         /* [DPCM]::FE */
0255                               port@3 { cpu3_ep: endpoint { remote-endpoint = <&fe00_ep>; }; };
0256                               port@4 { cpu4_ep: endpoint { remote-endpoint = <&fe01_ep>; }; };
0257 
0258                         /* [DPCM-Multi]::FE */
0259                               port@5 { cpu5_ep: endpoint { remote-endpoint = <&fe10_ep>; }; };
0260                               port@6 { cpu6_ep: endpoint { remote-endpoint = <&fe11_ep>; }; };
0261                 };
0262         };
0263 
0264         test_codec {
0265                 /*
0266                  * update compatible to indicate more detail behaviour
0267                  * if you want. see test-compatible for more detail.
0268                  *
0269                  * ex)
0270                  *      - compatible = "test-codec";
0271                  *      + compatible = "test-codec-verbose";
0272                  */
0273                 compatible = "test-codec";
0274                 ports {
0275                         /*
0276                          * prefix can be added to *component*,
0277                          * see audio-graph-card2::routing
0278                          */
0279                         prefix = "TC";
0280 
0281                         /* [Normal] */
0282                         port@0  { codec0_ep:  endpoint { remote-endpoint = <&cpu0_ep>; }; };
0283 
0284                         /* [Multi-Codec] */
0285                         port@1  { codec1_ep:  endpoint { remote-endpoint = <&mcodec1_ep>; }; };
0286                         port@2  { codec2_ep:  endpoint { remote-endpoint = <&mcodec2_ep>; }; };
0287 
0288                         /* [DPCM]::BE */
0289                         port@3  { codec3_ep:  endpoint { remote-endpoint = <&be00_ep>; }; };
0290 
0291                         /* [DPCM-Multi]::BE */
0292                         port@4  { codec4_ep:  endpoint { remote-endpoint = <&mbe1_ep>; }; };
0293                         port@5  { codec5_ep:  endpoint { remote-endpoint = <&mbe2_ep>; }; };
0294 
0295                         /* [Codec2Codec] */
0296                         port@6  { bitclock-master;
0297                                   frame-master;
0298                                   codec6_ep:  endpoint { remote-endpoint = <&c2cf_ep>; }; };
0299                         port@7  { codec7_ep:  endpoint { remote-endpoint = <&c2cb_ep>; }; };
0300 
0301                         /* [Codec2Codec-Multi] */
0302                         port@8  { bitclock-master;
0303                                   frame-master;
0304                                   codec8_ep:  endpoint { remote-endpoint = <&mc2c00_ep>; }; };
0305                         port@9  { codec9_ep:  endpoint { remote-endpoint = <&mc2c01_ep>; }; };
0306                         port@10 { codec10_ep: endpoint { remote-endpoint = <&mc2c10_ep>; }; };
0307                         port@11 { codec11_ep: endpoint { remote-endpoint = <&mc2c11_ep>; }; };
0308                 };
0309         };
0310 };