Merge tag 'asoc-hdmi-codec-improvements-v2' of git://git.kernel.org/pub/scm/linux...
[linux-2.6-microblaze.git] / sound / soc / codecs / hdmi-codec.c
index a67c920..e0460a9 100644 (file)
@@ -685,6 +685,25 @@ 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,
@@ -692,6 +711,8 @@ static const struct snd_soc_dai_ops hdmi_codec_i2s_dai_ops = {
        .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 = {