xref: /linux/Documentation/sound/soc/dpcm.rst (revision 4f9786035f9e519db41375818e1d0b5f20da2f10)
140433cd3STakashi Iwai===========
240433cd3STakashi IwaiDynamic PCM
340433cd3STakashi Iwai===========
440433cd3STakashi Iwai
540433cd3STakashi IwaiDescription
640433cd3STakashi Iwai===========
740433cd3STakashi Iwai
840433cd3STakashi IwaiDynamic PCM allows an ALSA PCM device to digitally route its PCM audio to
940433cd3STakashi Iwaivarious digital endpoints during the PCM stream runtime. e.g. PCM0 can route
1040433cd3STakashi Iwaidigital audio to I2S DAI0, I2S DAI1 or PDM DAI2. This is useful for on SoC DSP
1140433cd3STakashi Iwaidrivers that expose several ALSA PCMs and can route to multiple DAIs.
1240433cd3STakashi Iwai
1340433cd3STakashi IwaiThe DPCM runtime routing is determined by the ALSA mixer settings in the same
1440433cd3STakashi Iwaiway as the analog signal is routed in an ASoC codec driver. DPCM uses a DAPM
1540433cd3STakashi Iwaigraph representing the DSP internal audio paths and uses the mixer settings to
16511d53acSSylwester Nawrockidetermine the path used by each ALSA PCM.
1740433cd3STakashi Iwai
1840433cd3STakashi IwaiDPCM re-uses all the existing component codec, platform and DAI drivers without
1940433cd3STakashi Iwaiany modifications.
2040433cd3STakashi Iwai
2140433cd3STakashi Iwai
2240433cd3STakashi IwaiPhone Audio System with SoC based DSP
2340433cd3STakashi Iwai-------------------------------------
2440433cd3STakashi Iwai
2540433cd3STakashi IwaiConsider the following phone audio subsystem. This will be used in this
2640433cd3STakashi Iwaidocument for all examples :-
2740433cd3STakashi Iwai::
2840433cd3STakashi Iwai
2940433cd3STakashi Iwai  | Front End PCMs    |  SoC DSP  | Back End DAIs | Audio devices |
3040433cd3STakashi Iwai
3140433cd3STakashi Iwai                      *************
3240433cd3STakashi Iwai  PCM0 <------------> *           * <----DAI0-----> Codec Headset
3340433cd3STakashi Iwai                      *           *
3440433cd3STakashi Iwai  PCM1 <------------> *           * <----DAI1-----> Codec Speakers
3540433cd3STakashi Iwai                      *   DSP     *
3640433cd3STakashi Iwai  PCM2 <------------> *           * <----DAI2-----> MODEM
3740433cd3STakashi Iwai                      *           *
3840433cd3STakashi Iwai  PCM3 <------------> *           * <----DAI3-----> BT
3940433cd3STakashi Iwai                      *           *
4040433cd3STakashi Iwai                      *           * <----DAI4-----> DMIC
4140433cd3STakashi Iwai                      *           *
4240433cd3STakashi Iwai                      *           * <----DAI5-----> FM
4340433cd3STakashi Iwai                      *************
4440433cd3STakashi Iwai
4540433cd3STakashi IwaiThis diagram shows a simple smart phone audio subsystem. It supports Bluetooth,
4640433cd3STakashi IwaiFM digital radio, Speakers, Headset Jack, digital microphones and cellular
4740433cd3STakashi Iwaimodem. This sound card exposes 4 DSP front end (FE) ALSA PCM devices and
4840433cd3STakashi Iwaisupports 6 back end (BE) DAIs. Each FE PCM can digitally route audio data to any
4940433cd3STakashi Iwaiof the BE DAIs. The FE PCM devices can also route audio to more than 1 BE DAI.
5040433cd3STakashi Iwai
5140433cd3STakashi Iwai
5240433cd3STakashi Iwai
5340433cd3STakashi IwaiExample - DPCM Switching playback from DAI0 to DAI1
5440433cd3STakashi Iwai---------------------------------------------------
5540433cd3STakashi Iwai
5640433cd3STakashi IwaiAudio is being played to the Headset. After a while the user removes the headset
5740433cd3STakashi Iwaiand audio continues playing on the speakers.
5840433cd3STakashi Iwai
5940433cd3STakashi IwaiPlayback on PCM0 to Headset would look like :-
6040433cd3STakashi Iwai::
6140433cd3STakashi Iwai
6240433cd3STakashi Iwai                      *************
6340433cd3STakashi Iwai  PCM0 <============> *           * <====DAI0=====> Codec Headset
6440433cd3STakashi Iwai                      *           *
6540433cd3STakashi Iwai  PCM1 <------------> *           * <----DAI1-----> Codec Speakers
6640433cd3STakashi Iwai                      *   DSP     *
6740433cd3STakashi Iwai  PCM2 <------------> *           * <----DAI2-----> MODEM
6840433cd3STakashi Iwai                      *           *
6940433cd3STakashi Iwai  PCM3 <------------> *           * <----DAI3-----> BT
7040433cd3STakashi Iwai                      *           *
7140433cd3STakashi Iwai                      *           * <----DAI4-----> DMIC
7240433cd3STakashi Iwai                      *           *
7340433cd3STakashi Iwai                      *           * <----DAI5-----> FM
7440433cd3STakashi Iwai                      *************
7540433cd3STakashi Iwai
7640433cd3STakashi IwaiThe headset is removed from the jack by user so the speakers must now be used :-
7740433cd3STakashi Iwai::
7840433cd3STakashi Iwai
7940433cd3STakashi Iwai                      *************
8040433cd3STakashi Iwai  PCM0 <============> *           * <----DAI0-----> Codec Headset
8140433cd3STakashi Iwai                      *           *
8240433cd3STakashi Iwai  PCM1 <------------> *           * <====DAI1=====> Codec Speakers
8340433cd3STakashi Iwai                      *   DSP     *
8440433cd3STakashi Iwai  PCM2 <------------> *           * <----DAI2-----> MODEM
8540433cd3STakashi Iwai                      *           *
8640433cd3STakashi Iwai  PCM3 <------------> *           * <----DAI3-----> BT
8740433cd3STakashi Iwai                      *           *
8840433cd3STakashi Iwai                      *           * <----DAI4-----> DMIC
8940433cd3STakashi Iwai                      *           *
9040433cd3STakashi Iwai                      *           * <----DAI5-----> FM
9140433cd3STakashi Iwai                      *************
9240433cd3STakashi Iwai
9340433cd3STakashi IwaiThe audio driver processes this as follows :-
9440433cd3STakashi Iwai
9540433cd3STakashi Iwai1. Machine driver receives Jack removal event.
9640433cd3STakashi Iwai
9740433cd3STakashi Iwai2. Machine driver OR audio HAL disables the Headset path.
9840433cd3STakashi Iwai
9940433cd3STakashi Iwai3. DPCM runs the PCM trigger(stop), hw_free(), shutdown() operations on DAI0
10040433cd3STakashi Iwai   for headset since the path is now disabled.
10140433cd3STakashi Iwai
10240433cd3STakashi Iwai4. Machine driver or audio HAL enables the speaker path.
10340433cd3STakashi Iwai
104511d53acSSylwester Nawrocki5. DPCM runs the PCM ops for startup(), hw_params(), prepare() and
10540433cd3STakashi Iwai   trigger(start) for DAI1 Speakers since the path is enabled.
10640433cd3STakashi Iwai
10740433cd3STakashi IwaiIn this example, the machine driver or userspace audio HAL can alter the routing
10840433cd3STakashi Iwaiand then DPCM will take care of managing the DAI PCM operations to either bring
10940433cd3STakashi Iwaithe link up or down. Audio playback does not stop during this transition.
11040433cd3STakashi Iwai
11140433cd3STakashi Iwai
11240433cd3STakashi Iwai
11340433cd3STakashi IwaiDPCM machine driver
11440433cd3STakashi Iwai===================
11540433cd3STakashi Iwai
11640433cd3STakashi IwaiThe DPCM enabled ASoC machine driver is similar to normal machine drivers
11740433cd3STakashi Iwaiexcept that we also have to :-
11840433cd3STakashi Iwai
11940433cd3STakashi Iwai1. Define the FE and BE DAI links.
12040433cd3STakashi Iwai
12140433cd3STakashi Iwai2. Define any FE/BE PCM operations.
12240433cd3STakashi Iwai
12340433cd3STakashi Iwai3. Define widget graph connections.
12440433cd3STakashi Iwai
12540433cd3STakashi Iwai
12640433cd3STakashi IwaiFE and BE DAI links
12740433cd3STakashi Iwai-------------------
12840433cd3STakashi Iwai::
12940433cd3STakashi Iwai
13040433cd3STakashi Iwai  | Front End PCMs    |  SoC DSP  | Back End DAIs | Audio devices |
13140433cd3STakashi Iwai
13240433cd3STakashi Iwai                      *************
13340433cd3STakashi Iwai  PCM0 <------------> *           * <----DAI0-----> Codec Headset
13440433cd3STakashi Iwai                      *           *
13540433cd3STakashi Iwai  PCM1 <------------> *           * <----DAI1-----> Codec Speakers
13640433cd3STakashi Iwai                      *   DSP     *
13740433cd3STakashi Iwai  PCM2 <------------> *           * <----DAI2-----> MODEM
13840433cd3STakashi Iwai                      *           *
13940433cd3STakashi Iwai  PCM3 <------------> *           * <----DAI3-----> BT
14040433cd3STakashi Iwai                      *           *
14140433cd3STakashi Iwai                      *           * <----DAI4-----> DMIC
14240433cd3STakashi Iwai                      *           *
14340433cd3STakashi Iwai                      *           * <----DAI5-----> FM
14440433cd3STakashi Iwai                      *************
14540433cd3STakashi Iwai
14640433cd3STakashi IwaiFor the example above we have to define 4 FE DAI links and 6 BE DAI links. The
14740433cd3STakashi IwaiFE DAI links are defined as follows :-
14840433cd3STakashi Iwai::
14940433cd3STakashi Iwai
150*de22dc76SKuninori Morimoto SND_SOC_DAILINK_DEFS(pcm0,
151*de22dc76SKuninori Morimoto	DAILINK_COMP_ARRAY(COMP_CPU("System Pin")),
152*de22dc76SKuninori Morimoto	DAILINK_COMP_ARRAY(COMP_DUMMY()),
153*de22dc76SKuninori Morimoto	DAILINK_COMP_ARRAY(COMP_PLATFORM("dsp-audio")));
154*de22dc76SKuninori Morimoto
15540433cd3STakashi Iwai  static struct snd_soc_dai_link machine_dais[] = {
15640433cd3STakashi Iwai	{
15740433cd3STakashi Iwai		.name = "PCM0 System",
15840433cd3STakashi Iwai		.stream_name = "System Playback",
159*de22dc76SKuninori Morimoto		SND_SOC_DAILINK_REG(pcm0),
16040433cd3STakashi Iwai		.dynamic = 1,
16140433cd3STakashi Iwai		.trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
16240433cd3STakashi Iwai	},
16340433cd3STakashi Iwai	.....< other FE and BE DAI links here >
16440433cd3STakashi Iwai  };
16540433cd3STakashi Iwai
16640433cd3STakashi IwaiThis FE DAI link is pretty similar to a regular DAI link except that we also
1670e3dc8e4SKuninori Morimotoset the DAI link to a DPCM FE with the ``dynamic = 1``.
1680e3dc8e4SKuninori MorimotoThere is also an option to specify the ordering of the trigger call for
16940433cd3STakashi Iwaieach FE. This allows the ASoC core to trigger the DSP before or after the other
17040433cd3STakashi Iwaicomponents (as some DSPs have strong requirements for the ordering DAI/DSP
17140433cd3STakashi Iwaistart and stop sequences).
17240433cd3STakashi Iwai
17340433cd3STakashi IwaiThe FE DAI above sets the codec and code DAIs to dummy devices since the BE is
17440433cd3STakashi Iwaidynamic and will change depending on runtime config.
17540433cd3STakashi Iwai
17640433cd3STakashi IwaiThe BE DAIs are configured as follows :-
17740433cd3STakashi Iwai::
17840433cd3STakashi Iwai
179*de22dc76SKuninori Morimoto SND_SOC_DAILINK_DEFS(headset,
180*de22dc76SKuninori Morimoto	DAILINK_COMP_ARRAY(COMP_CPU("ssp-dai.0")),
181*de22dc76SKuninori Morimoto	DAILINK_COMP_ARRAY(COMP_CODEC("rt5640.0-001c", "rt5640-aif1")));
182*de22dc76SKuninori Morimoto
18340433cd3STakashi Iwai  static struct snd_soc_dai_link machine_dais[] = {
18440433cd3STakashi Iwai	.....< FE DAI links here >
18540433cd3STakashi Iwai	{
18640433cd3STakashi Iwai		.name = "Codec Headset",
187*de22dc76SKuninori Morimoto		SND_SOC_DAILINK_REG(headset),
18840433cd3STakashi Iwai		.no_pcm = 1,
18940433cd3STakashi Iwai		.ignore_suspend = 1,
19040433cd3STakashi Iwai		.ignore_pmdown_time = 1,
19140433cd3STakashi Iwai		.be_hw_params_fixup = hswult_ssp0_fixup,
19240433cd3STakashi Iwai		.ops = &haswell_ops,
19340433cd3STakashi Iwai	},
19440433cd3STakashi Iwai	.....< other BE DAI links here >
19540433cd3STakashi Iwai  };
19640433cd3STakashi Iwai
19740433cd3STakashi IwaiThis BE DAI link connects DAI0 to the codec (in this case RT5460 AIF1). It sets
1980e3dc8e4SKuninori Morimotothe ``no_pcm`` flag to mark it has a BE.
19940433cd3STakashi Iwai
20040433cd3STakashi IwaiThe BE has also flags set for ignoring suspend and PM down time. This allows
20140433cd3STakashi Iwaithe BE to work in a hostless mode where the host CPU is not transferring data
20240433cd3STakashi Iwailike a BT phone call :-
20340433cd3STakashi Iwai::
20440433cd3STakashi Iwai
20540433cd3STakashi Iwai                      *************
20640433cd3STakashi Iwai  PCM0 <------------> *           * <----DAI0-----> Codec Headset
20740433cd3STakashi Iwai                      *           *
20840433cd3STakashi Iwai  PCM1 <------------> *           * <----DAI1-----> Codec Speakers
20940433cd3STakashi Iwai                      *   DSP     *
21040433cd3STakashi Iwai  PCM2 <------------> *           * <====DAI2=====> MODEM
21140433cd3STakashi Iwai                      *           *
21240433cd3STakashi Iwai  PCM3 <------------> *           * <====DAI3=====> BT
21340433cd3STakashi Iwai                      *           *
21440433cd3STakashi Iwai                      *           * <----DAI4-----> DMIC
21540433cd3STakashi Iwai                      *           *
21640433cd3STakashi Iwai                      *           * <----DAI5-----> FM
21740433cd3STakashi Iwai                      *************
21840433cd3STakashi Iwai
219806654a9SWill DeaconThis allows the host CPU to sleep while the DSP, MODEM DAI and the BT DAI are
22040433cd3STakashi Iwaistill in operation.
22140433cd3STakashi Iwai
222511d53acSSylwester NawrockiA BE DAI link can also set the codec to a dummy device if the codec is a device
22340433cd3STakashi Iwaithat is managed externally.
22440433cd3STakashi Iwai
22540433cd3STakashi IwaiLikewise a BE DAI can also set a dummy cpu DAI if the CPU DAI is managed by the
22640433cd3STakashi IwaiDSP firmware.
22740433cd3STakashi Iwai
22840433cd3STakashi Iwai
22940433cd3STakashi IwaiFE/BE PCM operations
23040433cd3STakashi Iwai--------------------
23140433cd3STakashi Iwai
23240433cd3STakashi IwaiThe BE above also exports some PCM operations and a ``fixup`` callback. The fixup
23340433cd3STakashi Iwaicallback is used by the machine driver to (re)configure the DAI based upon the
23440433cd3STakashi IwaiFE hw params. i.e. the DSP may perform SRC or ASRC from the FE to BE.
23540433cd3STakashi Iwai
23640433cd3STakashi Iwaie.g. DSP converts all FE hw params to run at fixed rate of 48k, 16bit, stereo for
23740433cd3STakashi IwaiDAI0. This means all FE hw_params have to be fixed in the machine driver for
23840433cd3STakashi IwaiDAI0 so that the DAI is running at desired configuration regardless of the FE
23940433cd3STakashi Iwaiconfiguration.
24040433cd3STakashi Iwai::
24140433cd3STakashi Iwai
24240433cd3STakashi Iwai  static int dai0_fixup(struct snd_soc_pcm_runtime *rtd,
24340433cd3STakashi Iwai			struct snd_pcm_hw_params *params)
24440433cd3STakashi Iwai  {
24540433cd3STakashi Iwai	struct snd_interval *rate = hw_param_interval(params,
24640433cd3STakashi Iwai			SNDRV_PCM_HW_PARAM_RATE);
24740433cd3STakashi Iwai	struct snd_interval *channels = hw_param_interval(params,
24840433cd3STakashi Iwai						SNDRV_PCM_HW_PARAM_CHANNELS);
24940433cd3STakashi Iwai
250511d53acSSylwester Nawrocki	/* The DSP will convert the FE rate to 48k, stereo */
25140433cd3STakashi Iwai	rate->min = rate->max = 48000;
25240433cd3STakashi Iwai	channels->min = channels->max = 2;
25340433cd3STakashi Iwai
25440433cd3STakashi Iwai	/* set DAI0 to 16 bit */
255533a9274STakashi Iwai	params_set_format(params, SNDRV_PCM_FORMAT_S16_LE);
25640433cd3STakashi Iwai	return 0;
25740433cd3STakashi Iwai  }
25840433cd3STakashi Iwai
25940433cd3STakashi IwaiThe other PCM operation are the same as for regular DAI links. Use as necessary.
26040433cd3STakashi Iwai
26140433cd3STakashi Iwai
26240433cd3STakashi IwaiWidget graph connections
26340433cd3STakashi Iwai------------------------
26440433cd3STakashi Iwai
26540433cd3STakashi IwaiThe BE DAI links will normally be connected to the graph at initialisation time
26640433cd3STakashi Iwaiby the ASoC DAPM core. However, if the BE codec or BE DAI is a dummy then this
26740433cd3STakashi Iwaihas to be set explicitly in the driver :-
26840433cd3STakashi Iwai::
26940433cd3STakashi Iwai
27040433cd3STakashi Iwai  /* BE for codec Headset -  DAI0 is dummy and managed by DSP FW */
27140433cd3STakashi Iwai  {"DAI0 CODEC IN", NULL, "AIF1 Capture"},
27240433cd3STakashi Iwai  {"AIF1 Playback", NULL, "DAI0 CODEC OUT"},
27340433cd3STakashi Iwai
27440433cd3STakashi Iwai
27540433cd3STakashi IwaiWriting a DPCM DSP driver
27640433cd3STakashi Iwai=========================
27740433cd3STakashi Iwai
27840433cd3STakashi IwaiThe DPCM DSP driver looks much like a standard platform class ASoC driver
27940433cd3STakashi Iwaicombined with elements from a codec class driver. A DSP platform driver must
28040433cd3STakashi Iwaiimplement :-
28140433cd3STakashi Iwai
28240433cd3STakashi Iwai1. Front End PCM DAIs - i.e. struct snd_soc_dai_driver.
28340433cd3STakashi Iwai
28440433cd3STakashi Iwai2. DAPM graph showing DSP audio routing from FE DAIs to BEs.
28540433cd3STakashi Iwai
28640433cd3STakashi Iwai3. DAPM widgets from DSP graph.
28740433cd3STakashi Iwai
28840433cd3STakashi Iwai4. Mixers for gains, routing, etc.
28940433cd3STakashi Iwai
29040433cd3STakashi Iwai5. DMA configuration.
29140433cd3STakashi Iwai
29240433cd3STakashi Iwai6. BE AIF widgets.
29340433cd3STakashi Iwai
29440433cd3STakashi IwaiItems 6 is important for routing the audio outside of the DSP. AIF need to be
29540433cd3STakashi Iwaidefined for each BE and each stream direction. e.g for BE DAI0 above we would
29640433cd3STakashi Iwaihave :-
29740433cd3STakashi Iwai::
29840433cd3STakashi Iwai
29940433cd3STakashi Iwai  SND_SOC_DAPM_AIF_IN("DAI0 RX", NULL, 0, SND_SOC_NOPM, 0, 0),
30040433cd3STakashi Iwai  SND_SOC_DAPM_AIF_OUT("DAI0 TX", NULL, 0, SND_SOC_NOPM, 0, 0),
30140433cd3STakashi Iwai
30240433cd3STakashi IwaiThe BE AIF are used to connect the DSP graph to the graphs for the other
30340433cd3STakashi Iwaicomponent drivers (e.g. codec graph).
30440433cd3STakashi Iwai
30540433cd3STakashi Iwai
30640433cd3STakashi IwaiHostless PCM streams
30740433cd3STakashi Iwai====================
30840433cd3STakashi Iwai
30940433cd3STakashi IwaiA hostless PCM stream is a stream that is not routed through the host CPU. An
31040433cd3STakashi Iwaiexample of this would be a phone call from handset to modem.
31140433cd3STakashi Iwai::
31240433cd3STakashi Iwai
31340433cd3STakashi Iwai                      *************
31440433cd3STakashi Iwai  PCM0 <------------> *           * <----DAI0-----> Codec Headset
31540433cd3STakashi Iwai                      *           *
31640433cd3STakashi Iwai  PCM1 <------------> *           * <====DAI1=====> Codec Speakers/Mic
31740433cd3STakashi Iwai                      *   DSP     *
31840433cd3STakashi Iwai  PCM2 <------------> *           * <====DAI2=====> MODEM
31940433cd3STakashi Iwai                      *           *
32040433cd3STakashi Iwai  PCM3 <------------> *           * <----DAI3-----> BT
32140433cd3STakashi Iwai                      *           *
32240433cd3STakashi Iwai                      *           * <----DAI4-----> DMIC
32340433cd3STakashi Iwai                      *           *
32440433cd3STakashi Iwai                      *           * <----DAI5-----> FM
32540433cd3STakashi Iwai                      *************
32640433cd3STakashi Iwai
32740433cd3STakashi IwaiIn this case the PCM data is routed via the DSP. The host CPU in this use case
32840433cd3STakashi Iwaiis only used for control and can sleep during the runtime of the stream.
32940433cd3STakashi Iwai
33040433cd3STakashi IwaiThe host can control the hostless link either by :-
33140433cd3STakashi Iwai
33240433cd3STakashi Iwai 1. Configuring the link as a CODEC <-> CODEC style link. In this case the link
33340433cd3STakashi Iwai    is enabled or disabled by the state of the DAPM graph. This usually means
33440433cd3STakashi Iwai    there is a mixer control that can be used to connect or disconnect the path
33540433cd3STakashi Iwai    between both DAIs.
33640433cd3STakashi Iwai
33740433cd3STakashi Iwai 2. Hostless FE. This FE has a virtual connection to the BE DAI links on the DAPM
33840433cd3STakashi Iwai    graph. Control is then carried out by the FE as regular PCM operations.
33940433cd3STakashi Iwai    This method gives more control over the DAI links, but requires much more
34040433cd3STakashi Iwai    userspace code to control the link. Its recommended to use CODEC<->CODEC
34140433cd3STakashi Iwai    unless your HW needs more fine grained sequencing of the PCM ops.
34240433cd3STakashi Iwai
34340433cd3STakashi Iwai
34440433cd3STakashi IwaiCODEC <-> CODEC link
34540433cd3STakashi Iwai--------------------
34640433cd3STakashi Iwai
34740433cd3STakashi IwaiThis DAI link is enabled when DAPM detects a valid path within the DAPM graph.
34840433cd3STakashi IwaiThe machine driver sets some additional parameters to the DAI link i.e.
34940433cd3STakashi Iwai::
35040433cd3STakashi Iwai
35140433cd3STakashi Iwai  static const struct snd_soc_pcm_stream dai_params = {
35240433cd3STakashi Iwai	.formats = SNDRV_PCM_FMTBIT_S32_LE,
35340433cd3STakashi Iwai	.rate_min = 8000,
35440433cd3STakashi Iwai	.rate_max = 8000,
35540433cd3STakashi Iwai	.channels_min = 2,
35640433cd3STakashi Iwai	.channels_max = 2,
35740433cd3STakashi Iwai  };
35840433cd3STakashi Iwai
35940433cd3STakashi Iwai  static struct snd_soc_dai_link dais[] = {
36040433cd3STakashi Iwai	< ... more DAI links above ... >
36140433cd3STakashi Iwai	{
36240433cd3STakashi Iwai		.name = "MODEM",
36340433cd3STakashi Iwai		.stream_name = "MODEM",
36440433cd3STakashi Iwai		.cpu_dai_name = "dai2",
36540433cd3STakashi Iwai		.codec_dai_name = "modem-aif1",
36640433cd3STakashi Iwai		.codec_name = "modem",
36740433cd3STakashi Iwai		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
3685a09e179SKuninori Morimoto				| SND_SOC_DAIFMT_CBP_CFP,
369b5d5c879SAmadeusz Sławiński		.c2c_params = &dai_params,
370b5d5c879SAmadeusz Sławiński		.num_c2c_params = 1,
37140433cd3STakashi Iwai	}
37240433cd3STakashi Iwai	< ... more DAI links here ... >
37340433cd3STakashi Iwai
37440433cd3STakashi IwaiThese parameters are used to configure the DAI hw_params() when DAPM detects a
37540433cd3STakashi Iwaivalid path and then calls the PCM operations to start the link. DAPM will also
37640433cd3STakashi Iwaicall the appropriate PCM operations to disable the DAI when the path is no
37740433cd3STakashi Iwailonger valid.
37840433cd3STakashi Iwai
37940433cd3STakashi Iwai
38040433cd3STakashi IwaiHostless FE
38140433cd3STakashi Iwai-----------
38240433cd3STakashi Iwai
38340433cd3STakashi IwaiThe DAI link(s) are enabled by a FE that does not read or write any PCM data.
38440433cd3STakashi IwaiThis means creating a new FE that is connected with a virtual path to both
38540433cd3STakashi IwaiDAI links. The DAI links will be started when the FE PCM is started and stopped
38640433cd3STakashi Iwaiwhen the FE PCM is stopped. Note that the FE PCM cannot read or write data in
38740433cd3STakashi Iwaithis configuration.
388