Unverified Commit 2edc4a2c authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown
Browse files

ASoC: codecs/hdmi-codec: merge DAI call back functions into ops



ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87edkd9m4t.wl-kuninori.morimoto.gx@renesas.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 878b5fee
Loading
Loading
Loading
Loading
+22 −22
Original line number Diff line number Diff line
@@ -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,