OSDN Git Service

ASoC: meson: merge DAI call back functions into ops
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tue, 8 Aug 2023 22:57:18 +0000 (22:57 +0000)
committerMark Brown <broonie@kernel.org>
Mon, 14 Aug 2023 12:09:34 +0000 (13:09 +0100)
ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87zg319m7m.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
12 files changed:
sound/soc/meson/aiu-acodec-ctrl.c
sound/soc/meson/aiu-codec-ctrl.c
sound/soc/meson/aiu-fifo-i2s.c
sound/soc/meson/aiu-fifo-spdif.c
sound/soc/meson/aiu.c
sound/soc/meson/axg-frddr.c
sound/soc/meson/axg-pdm.c
sound/soc/meson/axg-spdifin.c
sound/soc/meson/axg-tdm-interface.c
sound/soc/meson/axg-toddr.c
sound/soc/meson/g12a-toacodec.c
sound/soc/meson/g12a-tohdmitx.c

index d0f0ada..7b04b97 100644 (file)
@@ -103,6 +103,8 @@ static int aiu_acodec_ctrl_input_hw_params(struct snd_pcm_substream *substream,
 }
 
 static const struct snd_soc_dai_ops aiu_acodec_ctrl_input_ops = {
+       .probe          = meson_codec_glue_input_dai_probe,
+       .remove         = meson_codec_glue_input_dai_remove,
        .hw_params      = aiu_acodec_ctrl_input_hw_params,
        .set_fmt        = meson_codec_glue_input_set_fmt,
 };
@@ -130,8 +132,6 @@ static const struct snd_soc_dai_ops aiu_acodec_ctrl_output_ops = {
        .name = "ACODEC CTRL " xname,                           \
        .playback = AIU_ACODEC_STREAM(xname, "Playback", 8),    \
        .ops = &aiu_acodec_ctrl_input_ops,                      \
-       .probe = meson_codec_glue_input_dai_probe,              \
-       .remove = meson_codec_glue_input_dai_remove,            \
 }
 
 #define AIU_ACODEC_OUTPUT(xname) {                             \
index 84c1095..ee0ef63 100644 (file)
@@ -75,6 +75,8 @@ static const struct snd_soc_dapm_widget aiu_hdmi_ctrl_widgets[] = {
 };
 
 static const struct snd_soc_dai_ops aiu_codec_ctrl_input_ops = {
+       .probe          = meson_codec_glue_input_dai_probe,
+       .remove         = meson_codec_glue_input_dai_remove,
        .hw_params      = meson_codec_glue_input_hw_params,
        .set_fmt        = meson_codec_glue_input_set_fmt,
 };
@@ -102,8 +104,6 @@ static const struct snd_soc_dai_ops aiu_codec_ctrl_output_ops = {
        .name = "CODEC CTRL " xname,                            \
        .playback = AIU_CODEC_CTRL_STREAM(xname, "Playback"),   \
        .ops = &aiu_codec_ctrl_input_ops,                       \
-       .probe = meson_codec_glue_input_dai_probe,              \
-       .remove = meson_codec_glue_input_dai_remove,            \
 }
 
 #define AIU_CODEC_CTRL_OUTPUT(xname) {                         \
index 59e00a7..7d83350 100644 (file)
@@ -140,6 +140,9 @@ static int aiu_fifo_i2s_hw_params(struct snd_pcm_substream *substream,
 }
 
 const struct snd_soc_dai_ops aiu_fifo_i2s_dai_ops = {
+       .pcm_new        = aiu_fifo_pcm_new,
+       .probe          = aiu_fifo_i2s_dai_probe,
+       .remove         = aiu_fifo_dai_remove,
        .trigger        = aiu_fifo_i2s_trigger,
        .prepare        = aiu_fifo_i2s_prepare,
        .hw_params      = aiu_fifo_i2s_hw_params,
index ddbd2fc..fa91f3c 100644 (file)
@@ -155,6 +155,9 @@ static int fifo_spdif_hw_params(struct snd_pcm_substream *substream,
 }
 
 const struct snd_soc_dai_ops aiu_fifo_spdif_dai_ops = {
+       .pcm_new        = aiu_fifo_pcm_new,
+       .probe          = aiu_fifo_spdif_dai_probe,
+       .remove         = aiu_fifo_dai_remove,
        .trigger        = fifo_spdif_trigger,
        .prepare        = fifo_spdif_prepare,
        .hw_params      = fifo_spdif_hw_params,
index da351a6..7109b81 100644 (file)
@@ -121,9 +121,6 @@ static struct snd_soc_dai_driver aiu_cpu_dai_drv[] = {
                        .formats        = AIU_FORMATS,
                },
                .ops            = &aiu_fifo_i2s_dai_ops,
-               .pcm_new        = aiu_fifo_pcm_new,
-               .probe          = aiu_fifo_i2s_dai_probe,
-               .remove         = aiu_fifo_dai_remove,
        },
        [CPU_SPDIF_FIFO] = {
                .name = "SPDIF FIFO",
@@ -137,9 +134,6 @@ static struct snd_soc_dai_driver aiu_cpu_dai_drv[] = {
                        .formats        = AIU_FORMATS,
                },
                .ops            = &aiu_fifo_spdif_dai_ops,
-               .pcm_new        = aiu_fifo_pcm_new,
-               .probe          = aiu_fifo_spdif_dai_probe,
-               .remove         = aiu_fifo_dai_remove,
        },
        [CPU_I2S_ENCODER] = {
                .name = "I2S Encoder",
index 61f9d41..8c166a5 100644 (file)
@@ -100,6 +100,7 @@ static const struct snd_soc_dai_ops axg_frddr_ops = {
        .hw_params      = axg_frddr_dai_hw_params,
        .startup        = axg_frddr_dai_startup,
        .shutdown       = axg_frddr_dai_shutdown,
+       .pcm_new        = axg_frddr_pcm_new,
 };
 
 static struct snd_soc_dai_driver axg_frddr_dai_drv = {
@@ -112,7 +113,6 @@ static struct snd_soc_dai_driver axg_frddr_dai_drv = {
                .formats        = AXG_FIFO_FORMATS,
        },
        .ops            = &axg_frddr_ops,
-       .pcm_new        = axg_frddr_pcm_new,
 };
 
 static const char * const axg_frddr_sel_texts[] = {
@@ -175,6 +175,7 @@ static const struct snd_soc_dai_ops g12a_frddr_ops = {
        .hw_params      = axg_frddr_dai_hw_params,
        .startup        = axg_frddr_dai_startup,
        .shutdown       = axg_frddr_dai_shutdown,
+       .pcm_new        = axg_frddr_pcm_new,
 };
 
 static struct snd_soc_dai_driver g12a_frddr_dai_drv = {
@@ -187,7 +188,6 @@ static struct snd_soc_dai_driver g12a_frddr_dai_drv = {
                .formats        = AXG_FIFO_FORMATS,
        },
        .ops            = &g12a_frddr_ops,
-       .pcm_new        = axg_frddr_pcm_new,
 };
 
 static SOC_ENUM_SINGLE_DECL(g12a_frddr_sel1_enum, FIFO_CTRL0, CTRL0_SEL_SHIFT,
index ad43cb2..d590509 100644 (file)
@@ -294,13 +294,6 @@ static void axg_pdm_shutdown(struct snd_pcm_substream *substream,
        clk_disable_unprepare(priv->dclk);
 }
 
-static const struct snd_soc_dai_ops axg_pdm_dai_ops = {
-       .trigger        = axg_pdm_trigger,
-       .hw_params      = axg_pdm_hw_params,
-       .startup        = axg_pdm_startup,
-       .shutdown       = axg_pdm_shutdown,
-};
-
 static void axg_pdm_set_hcic_ctrl(struct axg_pdm *priv)
 {
        const struct axg_pdm_hcic *hcic = &priv->cfg->filters->hcic;
@@ -440,6 +433,15 @@ static int axg_pdm_dai_remove(struct snd_soc_dai *dai)
        return 0;
 }
 
+static const struct snd_soc_dai_ops axg_pdm_dai_ops = {
+       .probe          = axg_pdm_dai_probe,
+       .remove         = axg_pdm_dai_remove,
+       .trigger        = axg_pdm_trigger,
+       .hw_params      = axg_pdm_hw_params,
+       .startup        = axg_pdm_startup,
+       .shutdown       = axg_pdm_shutdown,
+};
+
 static struct snd_soc_dai_driver axg_pdm_dai_drv = {
        .name = "PDM",
        .capture = {
@@ -453,8 +455,6 @@ static struct snd_soc_dai_driver axg_pdm_dai_drv = {
                                   SNDRV_PCM_FMTBIT_S32_LE),
        },
        .ops            = &axg_pdm_dai_ops,
-       .probe          = axg_pdm_dai_probe,
-       .remove         = axg_pdm_dai_remove,
 };
 
 static const struct snd_soc_component_driver axg_pdm_component_drv = {
index e2cc4c4..d868801 100644 (file)
@@ -267,6 +267,8 @@ static int axg_spdifin_dai_remove(struct snd_soc_dai *dai)
 }
 
 static const struct snd_soc_dai_ops axg_spdifin_ops = {
+       .probe          = axg_spdifin_dai_probe,
+       .remove         = axg_spdifin_dai_remove,
        .prepare        = axg_spdifin_prepare,
        .startup        = axg_spdifin_startup,
        .shutdown       = axg_spdifin_shutdown,
@@ -429,8 +431,6 @@ axg_spdifin_get_dai_drv(struct device *dev, struct axg_spdifin *priv)
 
        drv->name = "SPDIF Input";
        drv->ops = &axg_spdifin_ops;
-       drv->probe = axg_spdifin_dai_probe;
-       drv->remove = axg_spdifin_dai_remove;
        drv->capture.stream_name = "Capture";
        drv->capture.channels_min = 1;
        drv->capture.channels_max = 2;
index 5e5e4c5..1c3d433 100644 (file)
@@ -395,6 +395,8 @@ static int axg_tdm_iface_probe_dai(struct snd_soc_dai *dai)
 }
 
 static const struct snd_soc_dai_ops axg_tdm_iface_ops = {
+       .probe          = axg_tdm_iface_probe_dai,
+       .remove         = axg_tdm_iface_remove_dai,
        .set_sysclk     = axg_tdm_iface_set_sysclk,
        .set_fmt        = axg_tdm_iface_set_fmt,
        .startup        = axg_tdm_iface_startup,
@@ -423,8 +425,6 @@ static const struct snd_soc_dai_driver axg_tdm_iface_dai_drv[] = {
                },
                .id = TDM_IFACE_PAD,
                .ops = &axg_tdm_iface_ops,
-               .probe = axg_tdm_iface_probe_dai,
-               .remove = axg_tdm_iface_remove_dai,
        },
        [TDM_IFACE_LOOPBACK] = {
                .name = "TDM Loopback",
@@ -437,8 +437,6 @@ static const struct snd_soc_dai_driver axg_tdm_iface_dai_drv[] = {
                },
                .id = TDM_IFACE_LOOPBACK,
                .ops = &axg_tdm_iface_ops,
-               .probe = axg_tdm_iface_probe_dai,
-               .remove = axg_tdm_iface_remove_dai,
        },
 };
 
index e9208e7..1a0be17 100644 (file)
@@ -122,6 +122,7 @@ static const struct snd_soc_dai_ops axg_toddr_ops = {
        .hw_params      = axg_toddr_dai_hw_params,
        .startup        = axg_toddr_dai_startup,
        .shutdown       = axg_toddr_dai_shutdown,
+       .pcm_new        = axg_toddr_pcm_new,
 };
 
 static struct snd_soc_dai_driver axg_toddr_dai_drv = {
@@ -134,7 +135,6 @@ static struct snd_soc_dai_driver axg_toddr_dai_drv = {
                .formats        = AXG_FIFO_FORMATS,
        },
        .ops            = &axg_toddr_ops,
-       .pcm_new        = axg_toddr_pcm_new,
 };
 
 static const char * const axg_toddr_sel_texts[] = {
@@ -217,6 +217,7 @@ static const struct snd_soc_dai_ops g12a_toddr_ops = {
        .hw_params      = axg_toddr_dai_hw_params,
        .startup        = g12a_toddr_dai_startup,
        .shutdown       = axg_toddr_dai_shutdown,
+       .pcm_new        = axg_toddr_pcm_new,
 };
 
 static struct snd_soc_dai_driver g12a_toddr_dai_drv = {
@@ -229,7 +230,6 @@ static struct snd_soc_dai_driver g12a_toddr_dai_drv = {
                .formats        = AXG_FIFO_FORMATS,
        },
        .ops            = &g12a_toddr_ops,
-       .pcm_new        = axg_toddr_pcm_new,
 };
 
 static const struct snd_soc_component_driver g12a_toddr_component_drv = {
index ddc6679..6c45037 100644 (file)
@@ -162,6 +162,8 @@ static int g12a_toacodec_input_hw_params(struct snd_pcm_substream *substream,
 }
 
 static const struct snd_soc_dai_ops g12a_toacodec_input_ops = {
+       .probe          = meson_codec_glue_input_dai_probe,
+       .remove         = meson_codec_glue_input_dai_remove,
        .hw_params      = g12a_toacodec_input_hw_params,
        .set_fmt        = meson_codec_glue_input_set_fmt,
 };
@@ -185,8 +187,6 @@ static const struct snd_soc_dai_ops g12a_toacodec_output_ops = {
        .id = (xid),                                                    \
        .playback = TOACODEC_STREAM(xname, "Playback", 8),              \
        .ops = &g12a_toacodec_input_ops,                                \
-       .probe = meson_codec_glue_input_dai_probe,                      \
-       .remove = meson_codec_glue_input_dai_remove,                    \
 }
 
 #define TOACODEC_OUTPUT(xname, xid) {                                  \
index 579a04a..f7ef9aa 100644 (file)
@@ -140,6 +140,8 @@ static const struct snd_soc_dapm_widget g12a_tohdmitx_widgets[] = {
 };
 
 static const struct snd_soc_dai_ops g12a_tohdmitx_input_ops = {
+       .probe          = meson_codec_glue_input_dai_probe,
+       .remove         = meson_codec_glue_input_dai_remove,
        .hw_params      = meson_codec_glue_input_hw_params,
        .set_fmt        = meson_codec_glue_input_set_fmt,
 };
@@ -172,8 +174,6 @@ static const struct snd_soc_dai_ops g12a_tohdmitx_output_ops = {
        .id = (xid),                                                    \
        .playback = TOHDMITX_STREAM(xname, "Playback", xfmt, xchmax),   \
        .ops = &g12a_tohdmitx_input_ops,                                \
-       .probe = meson_codec_glue_input_dai_probe,                      \
-       .remove = meson_codec_glue_input_dai_remove,                    \
 }
 
 #define TOHDMITX_OUT(xname, xid, xfmt, xchmax) {                       \