aboutsummaryrefslogtreecommitdiff
path: root/sound/soc/codecs/hdmi-codec.c
diff options
context:
space:
mode:
authorGravatar Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> 2021-05-27 11:28:09 +0900
committerGravatar Mark Brown <broonie@kernel.org> 2021-06-07 15:55:17 +0100
commit68d8b7ba360f01babe56887f37a679e981833bb7 (patch)
tree989586cfd05c4b02c7466acf8bddccc58b49054a /sound/soc/codecs/hdmi-codec.c
parentASoC: fsi: add .auto_selectable_formats support (diff)
downloadlinux-68d8b7ba360f01babe56887f37a679e981833bb7.tar.gz
linux-68d8b7ba360f01babe56887f37a679e981833bb7.tar.bz2
linux-68d8b7ba360f01babe56887f37a679e981833bb7.zip
ASoC: hdmi-codec: add .auto_selectable_formats support
By this patch, DAI format might be automatically selected (Depends on paired DAI). Link: https://lore.kernel.org/r/871rb3hypy.wl-kuninori.morimoto.gx@renesas.com Link: https://lore.kernel.org/r/871racbx0w.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87a6ognc5i.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/hdmi-codec.c')
-rw-r--r--sound/soc/codecs/hdmi-codec.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c
index 1567ba196ab9..02d2614f9eee 100644
--- a/sound/soc/codecs/hdmi-codec.c
+++ b/sound/soc/codecs/hdmi-codec.c
@@ -580,12 +580,33 @@ static int hdmi_codec_mute(struct snd_soc_dai *dai, int mute, int direction)
return -ENOTSUPP;
}
+/*
+ * This driver can select all SND_SOC_DAIFMT_CBx_CFx,
+ * but need to be selected from Sound Card, not be auto selected.
+ * Because it might be used from other driver.
+ * For example,
+ * ${LINUX}/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c
+ */
+static u64 hdmi_codec_formats =
+ SND_SOC_POSSIBLE_DAIFMT_NB_NF |
+ SND_SOC_POSSIBLE_DAIFMT_NB_IF |
+ SND_SOC_POSSIBLE_DAIFMT_IB_NF |
+ SND_SOC_POSSIBLE_DAIFMT_IB_IF |
+ SND_SOC_POSSIBLE_DAIFMT_I2S |
+ SND_SOC_POSSIBLE_DAIFMT_DSP_A |
+ SND_SOC_POSSIBLE_DAIFMT_DSP_B |
+ SND_SOC_POSSIBLE_DAIFMT_RIGHT_J |
+ 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,
.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 = {