ASoC: codecs/hdmi-codec: merge DAI call back functions into ops
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tue, 8 Aug 2023 22:58:58 +0000 (22:58 +0000)
committerMark Brown <broonie@kernel.org>
Mon, 14 Aug 2023 12:10:34 +0000 (13:10 +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/87edkd9m4t.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/hdmi-codec.c

index d21f69f..13689e7 100644 (file)
@@ -723,24 +723,6 @@ static u64 hdmi_codec_formats =
        SND_SOC_POSSIBLE_DAIFMT_LEFT_J  |
        SND_SOC_POSSIBLE_DAIFMT_AC97;
 
-static const struct snd_soc_dai_ops hdmi_codec_i2s_dai_ops = {
-       .startup        = hdmi_codec_startup,
-       .shutdown       = hdmi_codec_shutdown,
-       .hw_params      = hdmi_codec_hw_params,
-       .prepare        = hdmi_codec_prepare,
-       .set_fmt        = hdmi_codec_i2s_set_fmt,
-       .mute_stream    = hdmi_codec_mute,
-       .auto_selectable_formats        = &hdmi_codec_formats,
-       .num_auto_selectable_formats    = 1,
-};
-
-static const struct snd_soc_dai_ops hdmi_codec_spdif_dai_ops = {
-       .startup        = hdmi_codec_startup,
-       .shutdown       = hdmi_codec_shutdown,
-       .hw_params      = hdmi_codec_hw_params,
-       .mute_stream    = hdmi_codec_mute,
-};
-
 #define HDMI_RATES     (SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 |\
                         SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 |\
                         SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 |\
@@ -921,10 +903,31 @@ static int hdmi_dai_spdif_probe(struct snd_soc_dai *dai)
        return 0;
 }
 
+static const struct snd_soc_dai_ops hdmi_codec_i2s_dai_ops = {
+       .probe                          = hdmi_dai_probe,
+       .startup                        = hdmi_codec_startup,
+       .shutdown                       = hdmi_codec_shutdown,
+       .hw_params                      = hdmi_codec_hw_params,
+       .prepare                        = hdmi_codec_prepare,
+       .set_fmt                        = hdmi_codec_i2s_set_fmt,
+       .mute_stream                    = hdmi_codec_mute,
+       .pcm_new                        = hdmi_codec_pcm_new,
+       .auto_selectable_formats        = &hdmi_codec_formats,
+       .num_auto_selectable_formats    = 1,
+};
+
+static const struct snd_soc_dai_ops hdmi_codec_spdif_dai_ops = {
+       .probe          = hdmi_dai_spdif_probe,
+       .startup        = hdmi_codec_startup,
+       .shutdown       = hdmi_codec_shutdown,
+       .hw_params      = hdmi_codec_hw_params,
+       .mute_stream    = hdmi_codec_mute,
+       .pcm_new        = hdmi_codec_pcm_new,
+};
+
 static const struct snd_soc_dai_driver hdmi_i2s_dai = {
        .name = "i2s-hifi",
        .id = DAI_ID_I2S,
-       .probe = hdmi_dai_probe,
        .playback = {
                .stream_name = "I2S Playback",
                .channels_min = 2,
@@ -942,13 +945,11 @@ static const struct snd_soc_dai_driver hdmi_i2s_dai = {
                .sig_bits = 24,
        },
        .ops = &hdmi_codec_i2s_dai_ops,
-       .pcm_new = hdmi_codec_pcm_new,
 };
 
 static const struct snd_soc_dai_driver hdmi_spdif_dai = {
        .name = "spdif-hifi",
        .id = DAI_ID_SPDIF,
-       .probe = hdmi_dai_spdif_probe,
        .playback = {
                .stream_name = "SPDIF Playback",
                .channels_min = 2,
@@ -964,7 +965,6 @@ static const struct snd_soc_dai_driver hdmi_spdif_dai = {
                .formats = SPDIF_FORMATS,
        },
        .ops = &hdmi_codec_spdif_dai_ops,
-       .pcm_new = hdmi_codec_pcm_new,
 };
 
 static int hdmi_of_xlate_dai_id(struct snd_soc_component *component,