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

ASoC: add new trigger ordering method

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

This patch-set adds new "trigger" starting/stopping method.
parents e8181a89 099770e2
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -158,6 +158,15 @@ struct snd_soc_component_driver {
	int probe_order;
	int remove_order;

	/*
	 * soc_pcm_trigger() start/stop sequence.
	 * see also
	 *	snd_soc_dai_link
	 *	soc_pcm_trigger()
	 */
	enum snd_soc_trigger_order trigger_start;
	enum snd_soc_trigger_order trigger_stop;

	/*
	 * signal if the module handling the component should not be removed
	 * if a pcm is open. Setting this would prevent the module
@@ -190,8 +199,6 @@ struct snd_soc_component_driver {
	bool use_dai_pcm_id;	/* use DAI link PCM ID as PCM device number */
	int be_pcm_base;	/* base device ID for all BE PCMs */

	unsigned int start_dma_last;

#ifdef CONFIG_DEBUG_FS
	const char *debugfs_prefix;
#endif
+17 −6
Original line number Diff line number Diff line
@@ -607,6 +607,14 @@ int snd_soc_get_strobe(struct snd_kcontrol *kcontrol,
int snd_soc_put_strobe(struct snd_kcontrol *kcontrol,
	struct snd_ctl_elem_value *ucontrol);

enum snd_soc_trigger_order {
						/* start			stop		     */
	SND_SOC_TRIGGER_ORDER_DEFAULT	= 0,	/* Link->Component->DAI		DAI->Component->Link */
	SND_SOC_TRIGGER_ORDER_LDC,		/* Link->DAI->Component		Component->DAI->Link */

	SND_SOC_TRIGGER_ORDER_MAX,
};

/* SoC PCM stream information */
struct snd_soc_pcm_stream {
	const char *stream_name;
@@ -713,6 +721,15 @@ struct snd_soc_dai_link {
	const struct snd_soc_ops *ops;
	const struct snd_soc_compr_ops *compr_ops;

	/*
	 * soc_pcm_trigger() start/stop sequence.
	 * see also
	 *	snd_soc_component_driver
	 *	soc_pcm_trigger()
	 */
	enum snd_soc_trigger_order trigger_start;
	enum snd_soc_trigger_order trigger_stop;

	/* Mark this pcm with non atomic ops */
	unsigned int nonatomic:1;

@@ -751,12 +768,6 @@ struct snd_soc_dai_link {
	/* Do not create a PCM for this DAI link (Backend link) */
	unsigned int ignore:1;

	/* This flag will reorder stop sequence. By enabling this flag
	 * DMA controller stop sequence will be invoked first followed by
	 * CPU DAI driver stop sequence
	 */
	unsigned int stop_dma_first:1;

#ifdef CONFIG_SND_SOC_TOPOLOGY
	struct snd_soc_dobj dobj; /* For topology */
#endif
+10 −10
Original line number Diff line number Diff line
@@ -524,7 +524,7 @@ static struct snd_soc_dai_link cz_dai_7219_98357[] = {
				| SND_SOC_DAIFMT_CBP_CFP,
		.init = cz_da7219_init,
		.dpcm_playback = 1,
		.stop_dma_first = 1,
		.trigger_stop = SND_SOC_TRIGGER_ORDER_LDC,
		.ops = &cz_da7219_play_ops,
		SND_SOC_DAILINK_REG(designware1, dlgs, platform),
	},
@@ -534,7 +534,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,
		.dpcm_capture = 1,
		.stop_dma_first = 1,
		.trigger_stop = SND_SOC_TRIGGER_ORDER_LDC,
		.ops = &cz_da7219_cap_ops,
		SND_SOC_DAILINK_REG(designware2, dlgs, platform),
	},
@@ -544,7 +544,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,
		.dpcm_playback = 1,
		.stop_dma_first = 1,
		.trigger_stop = SND_SOC_TRIGGER_ORDER_LDC,
		.ops = &cz_max_play_ops,
		SND_SOC_DAILINK_REG(designware3, mx, platform),
	},
@@ -555,7 +555,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,
		.dpcm_capture = 1,
		.stop_dma_first = 1,
		.trigger_stop = SND_SOC_TRIGGER_ORDER_LDC,
		.ops = &cz_dmic0_cap_ops,
		SND_SOC_DAILINK_REG(designware3, adau, platform),
	},
@@ -566,7 +566,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,
		.dpcm_capture = 1,
		.stop_dma_first = 1,
		.trigger_stop = SND_SOC_TRIGGER_ORDER_LDC,
		.ops = &cz_dmic1_cap_ops,
		SND_SOC_DAILINK_REG(designware2, adau, platform),
	},
@@ -580,7 +580,7 @@ static struct snd_soc_dai_link cz_dai_5682_98357[] = {
				| SND_SOC_DAIFMT_CBP_CFP,
		.init = cz_rt5682_init,
		.dpcm_playback = 1,
		.stop_dma_first = 1,
		.trigger_stop = SND_SOC_TRIGGER_ORDER_LDC,
		.ops = &cz_rt5682_play_ops,
		SND_SOC_DAILINK_REG(designware1, rt5682, platform),
	},
@@ -590,7 +590,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,
		.dpcm_capture = 1,
		.stop_dma_first = 1,
		.trigger_stop = SND_SOC_TRIGGER_ORDER_LDC,
		.ops = &cz_rt5682_cap_ops,
		SND_SOC_DAILINK_REG(designware2, rt5682, platform),
	},
@@ -600,7 +600,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,
		.dpcm_playback = 1,
		.stop_dma_first = 1,
		.trigger_stop = SND_SOC_TRIGGER_ORDER_LDC,
		.ops = &cz_rt5682_max_play_ops,
		SND_SOC_DAILINK_REG(designware3, mx, platform),
	},
@@ -611,7 +611,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,
		.dpcm_capture = 1,
		.stop_dma_first = 1,
		.trigger_stop = SND_SOC_TRIGGER_ORDER_LDC,
		.ops = &cz_rt5682_dmic0_cap_ops,
		SND_SOC_DAILINK_REG(designware3, adau, platform),
	},
@@ -622,7 +622,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,
		.dpcm_capture = 1,
		.stop_dma_first = 1,
		.trigger_stop = SND_SOC_TRIGGER_ORDER_LDC,
		.ops = &cz_rt5682_dmic1_cap_ops,
		SND_SOC_DAILINK_REG(designware2, adau, platform),
	},
+1 −1
Original line number Diff line number Diff line
@@ -149,7 +149,7 @@ static struct snd_soc_dai_link st_dai_es8336[] = {
		.stream_name = "ES8336 HiFi Play",
		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
				| SND_SOC_DAIFMT_CBP_CFP,
		.stop_dma_first = 1,
		.trigger_stop = SND_SOC_TRIGGER_ORDER_LDC,
		.dpcm_capture = 1,
		.dpcm_playback = 1,
		.init = st_es8336_init,
+1 −1
Original line number Diff line number Diff line
@@ -423,7 +423,7 @@ static const struct snd_soc_component_driver mchp_pdmc_dai_component = {
	.open = &mchp_pdmc_open,
	.close = &mchp_pdmc_close,
	.legacy_dai_naming = 1,
	.start_dma_last = 1,
	.trigger_start = SND_SOC_TRIGGER_ORDER_LDC,
};

static const unsigned int mchp_pdmc_1mic[] = {1};
Loading