]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: remove bespoke trigger support
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tue, 6 Aug 2024 00:00:57 +0000 (00:00 +0000)
committerMark Brown <broonie@kernel.org>
Tue, 6 Aug 2024 12:56:21 +0000 (13:56 +0100)
Bespoke trigger support was added when Linux v3.5 by this patch.

commit 07bf84aaf736781a283b1bd36eaa911453b14574
("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: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87v80ewmdi.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/soc-dai.h
include/sound/soc-dpcm.h
sound/soc/generic/test-component.c
sound/soc/soc-dai.c
sound/soc/soc-pcm.c

index bbb72ad4c951827a880ac8c1f793717271230817..ab4e109fe71d2243f5fe0fb83ccd5972980c0b63 100644 (file)
@@ -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_trigger(struct snd_pcm_substream *substream, int cmd,
                            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,
                           snd_pcm_sframes_t *cpu_delay, snd_pcm_sframes_t *codec_delay);
 
@@ -345,8 +343,7 @@ struct snd_soc_dai_ops {
         */
        int (*trigger)(struct snd_pcm_substream *, int,
                struct snd_soc_dai *);
-       int (*bespoke_trigger)(struct snd_pcm_substream *, int,
-               struct snd_soc_dai *);
+
        /*
         * For hardware based FIFO caused delay reporting.
         * Optional.
index ebd24753dd000b5aa0685a89ab61d6ccf6c0ce7c..773f2db8c31c825b216a834c0dcaf5ce748efbf1 100644 (file)
@@ -58,7 +58,6 @@ enum snd_soc_dpcm_state {
 enum snd_soc_dpcm_trigger {
        SND_SOC_DPCM_TRIGGER_PRE                = 0,
        SND_SOC_DPCM_TRIGGER_POST,
-       SND_SOC_DPCM_TRIGGER_BESPOKE,
 };
 
 /*
index e9e5e235a8a659cabffee7acd747a68bd45f177f..df2487b700cca0d0243e0f2b1628ff66df181423 100644 (file)
@@ -181,14 +181,6 @@ static int test_dai_trigger(struct snd_pcm_substream *substream, int cmd, struct
        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 =
        /*
         * Select below from Sound Card, not auto
@@ -228,7 +220,6 @@ static const struct snd_soc_dai_ops test_verbose_ops = {
        .hw_params              = test_dai_hw_params,
        .hw_free                = test_dai_hw_free,
        .trigger                = test_dai_trigger,
-       .bespoke_trigger        = test_dai_bespoke_trigger,
        .auto_selectable_formats        = &test_dai_formats,
        .num_auto_selectable_formats    = 1,
 };
index 9e47053419c16eb121bd0eadf9583884322b484f..302ca753a1f35554a2385249acfdbd879eb05a7d 100644 (file)
@@ -685,26 +685,6 @@ int snd_soc_pcm_dai_trigger(struct snd_pcm_substream *substream,
        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,
                           snd_pcm_sframes_t *cpu_delay,
                           snd_pcm_sframes_t *codec_delay)
index 5520944ac9ddc7f63ecee4731e52112d6b120a6e..1edcb8d6f6eea0abf9e4728126d2ca1873b45d2c 100644 (file)
@@ -2388,14 +2388,6 @@ static int dpcm_fe_dai_do_trigger(struct snd_pcm_substream *substream, int cmd)
                        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:
                dev_err(fe->dev, "ASoC: invalid trigger cmd %d for %s\n", cmd,
                                fe->dai_link->name);
@@ -2525,26 +2517,12 @@ out:
 
 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;
 
        dev_dbg(fe->dev, "ASoC: runtime %s close on FE %s\n",
                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);
 
@@ -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)
 {
-       struct snd_pcm_substream *substream =
-               snd_soc_dpcm_get_substream(fe, stream);
        struct snd_soc_dpcm *dpcm;
-       enum snd_soc_dpcm_trigger trigger = fe->dai_link->trigger[stream];
        int ret = 0;
 
        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)
                fe->dpcm[stream].state == SND_SOC_DPCM_STATE_STOP)
                return 0;
 
-       if (trigger == SND_SOC_DPCM_TRIGGER_BESPOKE) {
-               /* 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)
-                       goto hw_free;
-       }
+       ret = dpcm_be_dai_trigger(fe, stream, SNDRV_PCM_TRIGGER_START);
+       if (ret < 0)
+               goto hw_free;
 
        return 0;