Commit 7d2fb381 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: remove bespoke trigger support

Bespoke trigger support was added when Linux v3.5 by this patch.

	commit 07bf84aa
	("ASoC: dpcm: Add bespoke trigger()")

test-component driver is using it, but this is because it indicates used
function for debug/trace purpose. Except test-component driver, bespoke
trigger has never been used over 10 years in upstream.

We can re-support it if needed in the future, but let's remove it for now,
because it just noise in upstream.
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87v80ewmdi.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent cf410c1b
...@@ -240,8 +240,6 @@ int snd_soc_pcm_dai_new(struct snd_soc_pcm_runtime *rtd); ...@@ -240,8 +240,6 @@ int snd_soc_pcm_dai_new(struct snd_soc_pcm_runtime *rtd);
int snd_soc_pcm_dai_prepare(struct snd_pcm_substream *substream); int snd_soc_pcm_dai_prepare(struct snd_pcm_substream *substream);
int snd_soc_pcm_dai_trigger(struct snd_pcm_substream *substream, int cmd, int snd_soc_pcm_dai_trigger(struct snd_pcm_substream *substream, int cmd,
int rollback); int rollback);
int snd_soc_pcm_dai_bespoke_trigger(struct snd_pcm_substream *substream,
int cmd);
void snd_soc_pcm_dai_delay(struct snd_pcm_substream *substream, void snd_soc_pcm_dai_delay(struct snd_pcm_substream *substream,
snd_pcm_sframes_t *cpu_delay, snd_pcm_sframes_t *codec_delay); snd_pcm_sframes_t *cpu_delay, snd_pcm_sframes_t *codec_delay);
...@@ -345,8 +343,7 @@ struct snd_soc_dai_ops { ...@@ -345,8 +343,7 @@ struct snd_soc_dai_ops {
*/ */
int (*trigger)(struct snd_pcm_substream *, int, int (*trigger)(struct snd_pcm_substream *, int,
struct snd_soc_dai *); struct snd_soc_dai *);
int (*bespoke_trigger)(struct snd_pcm_substream *, int,
struct snd_soc_dai *);
/* /*
* For hardware based FIFO caused delay reporting. * For hardware based FIFO caused delay reporting.
* Optional. * Optional.
......
...@@ -58,7 +58,6 @@ enum snd_soc_dpcm_state { ...@@ -58,7 +58,6 @@ enum snd_soc_dpcm_state {
enum snd_soc_dpcm_trigger { enum snd_soc_dpcm_trigger {
SND_SOC_DPCM_TRIGGER_PRE = 0, SND_SOC_DPCM_TRIGGER_PRE = 0,
SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST,
SND_SOC_DPCM_TRIGGER_BESPOKE,
}; };
/* /*
......
...@@ -181,14 +181,6 @@ static int test_dai_trigger(struct snd_pcm_substream *substream, int cmd, struct ...@@ -181,14 +181,6 @@ static int test_dai_trigger(struct snd_pcm_substream *substream, int cmd, struct
return 0; return 0;
} }
static int test_dai_bespoke_trigger(struct snd_pcm_substream *substream,
int cmd, struct snd_soc_dai *dai)
{
mile_stone(dai);
return 0;
}
static const u64 test_dai_formats = static const u64 test_dai_formats =
/* /*
* Select below from Sound Card, not auto * Select below from Sound Card, not auto
...@@ -228,7 +220,6 @@ static const struct snd_soc_dai_ops test_verbose_ops = { ...@@ -228,7 +220,6 @@ static const struct snd_soc_dai_ops test_verbose_ops = {
.hw_params = test_dai_hw_params, .hw_params = test_dai_hw_params,
.hw_free = test_dai_hw_free, .hw_free = test_dai_hw_free,
.trigger = test_dai_trigger, .trigger = test_dai_trigger,
.bespoke_trigger = test_dai_bespoke_trigger,
.auto_selectable_formats = &test_dai_formats, .auto_selectable_formats = &test_dai_formats,
.num_auto_selectable_formats = 1, .num_auto_selectable_formats = 1,
}; };
......
...@@ -685,26 +685,6 @@ int snd_soc_pcm_dai_trigger(struct snd_pcm_substream *substream, ...@@ -685,26 +685,6 @@ int snd_soc_pcm_dai_trigger(struct snd_pcm_substream *substream,
return ret; return ret;
} }
int snd_soc_pcm_dai_bespoke_trigger(struct snd_pcm_substream *substream,
int cmd)
{
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
struct snd_soc_dai *dai;
int i, ret;
for_each_rtd_dais(rtd, i, dai) {
if (dai->driver->ops &&
dai->driver->ops->bespoke_trigger) {
ret = dai->driver->ops->bespoke_trigger(substream,
cmd, dai);
if (ret < 0)
return soc_dai_ret(dai, ret);
}
}
return 0;
}
void snd_soc_pcm_dai_delay(struct snd_pcm_substream *substream, void snd_soc_pcm_dai_delay(struct snd_pcm_substream *substream,
snd_pcm_sframes_t *cpu_delay, snd_pcm_sframes_t *cpu_delay,
snd_pcm_sframes_t *codec_delay) snd_pcm_sframes_t *codec_delay)
......
...@@ -2388,14 +2388,6 @@ static int dpcm_fe_dai_do_trigger(struct snd_pcm_substream *substream, int cmd) ...@@ -2388,14 +2388,6 @@ static int dpcm_fe_dai_do_trigger(struct snd_pcm_substream *substream, int cmd)
break; break;
} }
break; break;
case SND_SOC_DPCM_TRIGGER_BESPOKE:
/* bespoke trigger() - handles both FE and BEs */
dev_dbg(fe->dev, "ASoC: bespoke trigger FE %s cmd %d\n",
fe->dai_link->name, cmd);
ret = snd_soc_pcm_dai_bespoke_trigger(substream, cmd);
break;
default: default:
dev_err(fe->dev, "ASoC: invalid trigger cmd %d for %s\n", cmd, dev_err(fe->dev, "ASoC: invalid trigger cmd %d for %s\n", cmd,
fe->dai_link->name); fe->dai_link->name);
...@@ -2525,26 +2517,12 @@ static int dpcm_fe_dai_prepare(struct snd_pcm_substream *substream) ...@@ -2525,26 +2517,12 @@ static int dpcm_fe_dai_prepare(struct snd_pcm_substream *substream)
static int dpcm_run_update_shutdown(struct snd_soc_pcm_runtime *fe, int stream) static int dpcm_run_update_shutdown(struct snd_soc_pcm_runtime *fe, int stream)
{ {
struct snd_pcm_substream *substream =
snd_soc_dpcm_get_substream(fe, stream);
enum snd_soc_dpcm_trigger trigger = fe->dai_link->trigger[stream];
int err; int err;
dev_dbg(fe->dev, "ASoC: runtime %s close on FE %s\n", dev_dbg(fe->dev, "ASoC: runtime %s close on FE %s\n",
snd_pcm_direction_name(stream), fe->dai_link->name); snd_pcm_direction_name(stream), fe->dai_link->name);
if (trigger == SND_SOC_DPCM_TRIGGER_BESPOKE) {
/* call bespoke trigger - FE takes care of all BE triggers */
dev_dbg(fe->dev, "ASoC: bespoke trigger FE %s cmd stop\n",
fe->dai_link->name);
err = snd_soc_pcm_dai_bespoke_trigger(substream, SNDRV_PCM_TRIGGER_STOP);
} else {
dev_dbg(fe->dev, "ASoC: trigger FE %s cmd stop\n",
fe->dai_link->name);
err = dpcm_be_dai_trigger(fe, stream, SNDRV_PCM_TRIGGER_STOP); err = dpcm_be_dai_trigger(fe, stream, SNDRV_PCM_TRIGGER_STOP);
}
dpcm_be_dai_hw_free(fe, stream); dpcm_be_dai_hw_free(fe, stream);
...@@ -2558,10 +2536,7 @@ static int dpcm_run_update_shutdown(struct snd_soc_pcm_runtime *fe, int stream) ...@@ -2558,10 +2536,7 @@ static int dpcm_run_update_shutdown(struct snd_soc_pcm_runtime *fe, int stream)
static int dpcm_run_update_startup(struct snd_soc_pcm_runtime *fe, int stream) static int dpcm_run_update_startup(struct snd_soc_pcm_runtime *fe, int stream)
{ {
struct snd_pcm_substream *substream =
snd_soc_dpcm_get_substream(fe, stream);
struct snd_soc_dpcm *dpcm; struct snd_soc_dpcm *dpcm;
enum snd_soc_dpcm_trigger trigger = fe->dai_link->trigger[stream];
int ret = 0; int ret = 0;
dev_dbg(fe->dev, "ASoC: runtime %s open on FE %s\n", dev_dbg(fe->dev, "ASoC: runtime %s open on FE %s\n",
...@@ -2605,23 +2580,9 @@ static int dpcm_run_update_startup(struct snd_soc_pcm_runtime *fe, int stream) ...@@ -2605,23 +2580,9 @@ static int dpcm_run_update_startup(struct snd_soc_pcm_runtime *fe, int stream)
fe->dpcm[stream].state == SND_SOC_DPCM_STATE_STOP) fe->dpcm[stream].state == SND_SOC_DPCM_STATE_STOP)
return 0; return 0;
if (trigger == SND_SOC_DPCM_TRIGGER_BESPOKE) { ret = dpcm_be_dai_trigger(fe, stream, SNDRV_PCM_TRIGGER_START);
/* call trigger on the frontend - FE takes care of all BE triggers */
dev_dbg(fe->dev, "ASoC: bespoke trigger FE %s cmd start\n",
fe->dai_link->name);
ret = snd_soc_pcm_dai_bespoke_trigger(substream, SNDRV_PCM_TRIGGER_START);
if (ret < 0)
goto hw_free;
} else {
dev_dbg(fe->dev, "ASoC: trigger FE %s cmd start\n",
fe->dai_link->name);
ret = dpcm_be_dai_trigger(fe, stream,
SNDRV_PCM_TRIGGER_START);
if (ret < 0) if (ret < 0)
goto hw_free; goto hw_free;
}
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment