Unverified Commit a77e6c12 authored by Mark Brown's avatar Mark Brown
Browse files

ASoC: remove dpcm_xxx flags

Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

Now, we don't need to use dpcm_playback/capture flags for DPCM since v6.11,
and thus we can use playback/capture_only flags instead too for DPCM,
which is same as non-DPCM.

Let's remove dpcm_playback/capture flags, and use playback/capture_only flags
instead.

[Before]			[After]
	dpcm_playback = 1;	/* no setting is needed */
	dpcm_capture  = 1;

	dpcm_playback = 1;	playback_only = 1;
	dpcm_capture  = 0;

	dpcm_playback = 0;	capture_only = 1;
	dpcm_capture  = 1;

And then, because no-one uses dpcm_xxx flags, we don't need to have the code
for both DPCM and non-DPCM. These can be handled by same code.
parents 9c2e48ee a6ff8572
Loading
Loading
Loading
Loading
+3 −8
Original line number Diff line number Diff line
@@ -157,15 +157,13 @@ FE DAI links are defined as follows :-
		.codec_dai_name = "snd-soc-dummy-dai",
		.dynamic = 1,
		.trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
		.dpcm_playback = 1,
	},
	.....< other FE and BE DAI links here >
  };

This FE DAI link is pretty similar to a regular DAI link except that we also
set the DAI link to a DPCM FE with the ``dynamic = 1``. The supported FE stream
directions should also be set with the ``dpcm_playback`` and ``dpcm_capture``
flags. There is also an option to specify the ordering of the trigger call for
set the DAI link to a DPCM FE with the ``dynamic = 1``.
There is also an option to specify the ordering of the trigger call for
each FE. This allows the ASoC core to trigger the DSP before or after the other
components (as some DSPs have strong requirements for the ordering DAI/DSP
start and stop sequences).
@@ -189,15 +187,12 @@ The BE DAIs are configured as follows :-
		.ignore_pmdown_time = 1,
		.be_hw_params_fixup = hswult_ssp0_fixup,
		.ops = &haswell_ops,
		.dpcm_playback = 1,
		.dpcm_capture = 1,
	},
	.....< other BE DAI links here >
  };

This BE DAI link connects DAI0 to the codec (in this case RT5460 AIF1). It sets
the ``no_pcm`` flag to mark it has a BE and sets flags for supported stream
directions using ``dpcm_playback`` and ``dpcm_capture`` above.
the ``no_pcm`` flag to mark it has a BE.

The BE has also flags set for ignoring suspend and PM down time. This allows
the BE to work in a hostless mode where the host CPU is not transferring data
+0 −5
Original line number Diff line number Diff line
@@ -820,11 +820,6 @@ struct snd_soc_dai_link {
	/* This DAI link can route to other DAI links at runtime (Frontend)*/
	unsigned int dynamic:1;

	/* REMOVE ME */
	/* DPCM capture and Playback support */
	unsigned int dpcm_capture:1;
	unsigned int dpcm_playback:1;

	/* DPCM used FE & BE merged format */
	unsigned int dpcm_merged_format:1;
	/* DPCM used FE & BE merged channel */
+10 −10
Original line number Diff line number Diff line
@@ -542,7 +542,7 @@ static struct snd_soc_dai_link cz_dai_7219_98357[] = {
		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
				| SND_SOC_DAIFMT_CBP_CFP,
		.init = cz_da7219_init,
		.dpcm_playback = 1,
		.playback_only = 1,
		.trigger_stop = SND_SOC_TRIGGER_ORDER_LDC,
		.ops = &cz_da7219_play_ops,
		SND_SOC_DAILINK_REG(designware1, dlgs, platform),
@@ -552,7 +552,7 @@ static struct snd_soc_dai_link cz_dai_7219_98357[] = {
		.stream_name = "Capture",
		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
				| SND_SOC_DAIFMT_CBP_CFP,
		.dpcm_capture = 1,
		.capture_only = 1,
		.trigger_stop = SND_SOC_TRIGGER_ORDER_LDC,
		.ops = &cz_da7219_cap_ops,
		SND_SOC_DAILINK_REG(designware2, dlgs, platform),
@@ -562,7 +562,7 @@ static struct snd_soc_dai_link cz_dai_7219_98357[] = {
		.stream_name = "HiFi Playback",
		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
				| SND_SOC_DAIFMT_CBP_CFP,
		.dpcm_playback = 1,
		.playback_only = 1,
		.trigger_stop = SND_SOC_TRIGGER_ORDER_LDC,
		.ops = &cz_max_play_ops,
		SND_SOC_DAILINK_REG(designware3, mx, platform),
@@ -573,7 +573,7 @@ static struct snd_soc_dai_link cz_dai_7219_98357[] = {
		.stream_name = "DMIC0 Capture",
		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
				| SND_SOC_DAIFMT_CBP_CFP,
		.dpcm_capture = 1,
		.capture_only = 1,
		.trigger_stop = SND_SOC_TRIGGER_ORDER_LDC,
		.ops = &cz_dmic0_cap_ops,
		SND_SOC_DAILINK_REG(designware3, adau, platform),
@@ -584,7 +584,7 @@ static struct snd_soc_dai_link cz_dai_7219_98357[] = {
		.stream_name = "DMIC1 Capture",
		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
				| SND_SOC_DAIFMT_CBP_CFP,
		.dpcm_capture = 1,
		.capture_only = 1,
		.trigger_stop = SND_SOC_TRIGGER_ORDER_LDC,
		.ops = &cz_dmic1_cap_ops,
		SND_SOC_DAILINK_REG(designware2, adau, platform),
@@ -598,7 +598,7 @@ static struct snd_soc_dai_link cz_dai_5682_98357[] = {
		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
				| SND_SOC_DAIFMT_CBP_CFP,
		.init = cz_rt5682_init,
		.dpcm_playback = 1,
		.playback_only = 1,
		.trigger_stop = SND_SOC_TRIGGER_ORDER_LDC,
		.ops = &cz_rt5682_play_ops,
		SND_SOC_DAILINK_REG(designware1, rt5682, platform),
@@ -608,7 +608,7 @@ static struct snd_soc_dai_link cz_dai_5682_98357[] = {
		.stream_name = "Capture",
		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
				| SND_SOC_DAIFMT_CBP_CFP,
		.dpcm_capture = 1,
		.capture_only = 1,
		.trigger_stop = SND_SOC_TRIGGER_ORDER_LDC,
		.ops = &cz_rt5682_cap_ops,
		SND_SOC_DAILINK_REG(designware2, rt5682, platform),
@@ -618,7 +618,7 @@ static struct snd_soc_dai_link cz_dai_5682_98357[] = {
		.stream_name = "HiFi Playback",
		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
				| SND_SOC_DAIFMT_CBP_CFP,
		.dpcm_playback = 1,
		.playback_only = 1,
		.trigger_stop = SND_SOC_TRIGGER_ORDER_LDC,
		.ops = &cz_rt5682_max_play_ops,
		SND_SOC_DAILINK_REG(designware3, mx, platform),
@@ -629,7 +629,7 @@ static struct snd_soc_dai_link cz_dai_5682_98357[] = {
		.stream_name = "DMIC0 Capture",
		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
				| SND_SOC_DAIFMT_CBP_CFP,
		.dpcm_capture = 1,
		.capture_only = 1,
		.trigger_stop = SND_SOC_TRIGGER_ORDER_LDC,
		.ops = &cz_rt5682_dmic0_cap_ops,
		SND_SOC_DAILINK_REG(designware3, adau, platform),
@@ -640,7 +640,7 @@ static struct snd_soc_dai_link cz_dai_5682_98357[] = {
		.stream_name = "DMIC1 Capture",
		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
				| SND_SOC_DAIFMT_CBP_CFP,
		.dpcm_capture = 1,
		.capture_only = 1,
		.trigger_stop = SND_SOC_TRIGGER_ORDER_LDC,
		.ops = &cz_rt5682_dmic1_cap_ops,
		SND_SOC_DAILINK_REG(designware2, adau, platform),
+0 −2
Original line number Diff line number Diff line
@@ -150,8 +150,6 @@ static struct snd_soc_dai_link st_dai_es8336[] = {
		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
				| SND_SOC_DAIFMT_CBP_CFP,
		.trigger_stop = SND_SOC_TRIGGER_ORDER_LDC,
		.dpcm_capture = 1,
		.dpcm_playback = 1,
		.init = st_es8336_init,
		.ops = &st_es8336_ops,
		SND_SOC_DAILINK_REG(designware1, codec, platform),
+7 −17
Original line number Diff line number Diff line
@@ -1407,8 +1407,6 @@ int acp_sofdsp_dai_links_create(struct snd_soc_card *card)
		links[i].num_cpus = ARRAY_SIZE(sof_sp);
		links[i].platforms = sof_component;
		links[i].num_platforms = ARRAY_SIZE(sof_component);
		links[i].dpcm_playback = 1;
		links[i].dpcm_capture = 1;
		links[i].nonatomic = true;
		links[i].no_pcm = 1;
		if (!drv_data->hs_codec_id) {
@@ -1444,8 +1442,6 @@ int acp_sofdsp_dai_links_create(struct snd_soc_card *card)
		links[i].num_cpus = ARRAY_SIZE(sof_hs);
		links[i].platforms = sof_component;
		links[i].num_platforms = ARRAY_SIZE(sof_component);
		links[i].dpcm_playback = 1;
		links[i].dpcm_capture = 1;
		links[i].nonatomic = true;
		links[i].no_pcm = 1;
		if (!drv_data->hs_codec_id) {
@@ -1480,7 +1476,7 @@ int acp_sofdsp_dai_links_create(struct snd_soc_card *card)
		}
		links[i].platforms = sof_component;
		links[i].num_platforms = ARRAY_SIZE(sof_component);
		links[i].dpcm_playback = 1;
		links[i].playback_only = 1;
		links[i].nonatomic = true;
		links[i].no_pcm = 1;
		if (!drv_data->amp_codec_id) {
@@ -1512,7 +1508,7 @@ int acp_sofdsp_dai_links_create(struct snd_soc_card *card)
		links[i].num_cpus = ARRAY_SIZE(sof_hs_virtual);
		links[i].platforms = sof_component;
		links[i].num_platforms = ARRAY_SIZE(sof_component);
		links[i].dpcm_playback = 1;
		links[i].playback_only = 1;
		links[i].nonatomic = true;
		links[i].no_pcm = 1;
		if (!drv_data->amp_codec_id) {
@@ -1527,7 +1523,7 @@ int acp_sofdsp_dai_links_create(struct snd_soc_card *card)
			links[i].init = acp_card_maxim_init;
		}
		if (drv_data->amp_codec_id == MAX98388) {
			links[i].dpcm_capture = 1;
			links[i].playback_only = 0;
			links[i].codecs = max98388;
			links[i].num_codecs = ARRAY_SIZE(max98388);
			links[i].ops = &acp_max98388_ops;
@@ -1553,8 +1549,6 @@ int acp_sofdsp_dai_links_create(struct snd_soc_card *card)
		links[i].num_cpus = ARRAY_SIZE(sof_bt);
		links[i].platforms = sof_component;
		links[i].num_platforms = ARRAY_SIZE(sof_component);
		links[i].dpcm_playback = 1;
		links[i].dpcm_capture = 1;
		links[i].nonatomic = true;
		links[i].no_pcm = 1;
		if (!drv_data->bt_codec_id) {
@@ -1575,7 +1569,7 @@ int acp_sofdsp_dai_links_create(struct snd_soc_card *card)
		links[i].num_cpus = ARRAY_SIZE(sof_dmic);
		links[i].platforms = sof_component;
		links[i].num_platforms = ARRAY_SIZE(sof_component);
		links[i].dpcm_capture = 1;
		links[i].capture_only = 1;
		links[i].nonatomic = true;
		links[i].no_pcm = 1;
	}
@@ -1614,8 +1608,6 @@ int acp_legacy_dai_links_create(struct snd_soc_card *card)
		links[i].num_cpus = ARRAY_SIZE(i2s_sp);
		links[i].platforms = platform_component;
		links[i].num_platforms = ARRAY_SIZE(platform_component);
		links[i].dpcm_playback = 1;
		links[i].dpcm_capture = 1;
		if (!drv_data->hs_codec_id) {
			/* Use dummy codec if codec id not specified */
			links[i].codecs = &snd_soc_dummy_dlc;
@@ -1663,8 +1655,6 @@ int acp_legacy_dai_links_create(struct snd_soc_card *card)
			break;
		}

		links[i].dpcm_playback = 1;
		links[i].dpcm_capture = 1;
		if (!drv_data->hs_codec_id) {
			/* Use dummy codec if codec id not specified */
			links[i].codecs = &snd_soc_dummy_dlc;
@@ -1692,7 +1682,7 @@ int acp_legacy_dai_links_create(struct snd_soc_card *card)
		links[i].num_cpus = ARRAY_SIZE(i2s_sp);
		links[i].platforms = platform_component;
		links[i].num_platforms = ARRAY_SIZE(platform_component);
		links[i].dpcm_playback = 1;
		links[i].playback_only = 1;
		if (!drv_data->amp_codec_id) {
			/* Use dummy codec if codec id not specified */
			links[i].codecs = &snd_soc_dummy_dlc;
@@ -1735,7 +1725,7 @@ int acp_legacy_dai_links_create(struct snd_soc_card *card)
			break;
		}

		links[i].dpcm_playback = 1;
		links[i].playback_only = 1;
		if (!drv_data->amp_codec_id) {
			/* Use dummy codec if codec id not specified */
			links[i].codecs = &snd_soc_dummy_dlc;
@@ -1792,7 +1782,7 @@ int acp_legacy_dai_links_create(struct snd_soc_card *card)
			break;
		}
		links[i].ops = &acp_card_dmic_ops;
		links[i].dpcm_capture = 1;
		links[i].capture_only = 1;
	}

	card->dai_link = links;
Loading