]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - sound/pci/hda/patch_hdmi.c
ALSA: hda - Fix missing CA initialization for HDMI/DP
[mv-sheeva.git] / sound / pci / hda / patch_hdmi.c
index f29b97b5de8f36e53fc459e90cc8cc41870e54f5..a5876773672749d05ac9672b9ba59b8acb0fc903 100644 (file)
@@ -642,6 +642,7 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec, hda_nid_t nid,
                        hdmi_ai->ver            = 0x01;
                        hdmi_ai->len            = 0x0a;
                        hdmi_ai->CC02_CT47      = channels - 1;
+                       hdmi_ai->CA             = ca;
                        hdmi_checksum_audio_infoframe(hdmi_ai);
                } else if (spec->sink_eld[i].conn_type == 1) { /* DisplayPort */
                        struct dp_audio_infoframe *dp_ai;
@@ -651,6 +652,7 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec, hda_nid_t nid,
                        dp_ai->len              = 0x1b;
                        dp_ai->ver              = 0x11 << 2;
                        dp_ai->CC02_CT47        = channels - 1;
+                       dp_ai->CA               = ca;
                } else {
                        snd_printd("HDMI: unknown connection type at pin %d\n",
                                   pin_nid);
@@ -817,6 +819,7 @@ static int hdmi_pcm_open(struct hda_pcm_stream *hinfo,
        struct hdmi_spec *spec = codec->spec;
        struct hdmi_eld *eld;
        struct hda_pcm_stream *codec_pars;
+       struct snd_pcm_runtime *runtime = substream->runtime;
        unsigned int idx;
 
        for (idx = 0; idx < spec->num_cvts; idx++)
@@ -844,6 +847,14 @@ static int hdmi_pcm_open(struct hda_pcm_stream *hinfo,
                hinfo->formats = codec_pars->formats;
                hinfo->maxbps = codec_pars->maxbps;
        }
+       /* store the updated parameters */
+       runtime->hw.channels_min = hinfo->channels_min;
+       runtime->hw.channels_max = hinfo->channels_max;
+       runtime->hw.formats = hinfo->formats;
+       runtime->hw.rates = hinfo->rates;
+
+       snd_pcm_hw_constraint_step(substream->runtime, 0,
+                                  SNDRV_PCM_HW_PARAM_CHANNELS, 2);
        return 0;
 }
 
@@ -1238,6 +1249,9 @@ static int simple_playback_pcm_open(struct hda_pcm_stream *hinfo,
                snd_pcm_hw_constraint_list(substream->runtime, 0,
                                SNDRV_PCM_HW_PARAM_CHANNELS,
                                hw_constraints_channels);
+       } else {
+               snd_pcm_hw_constraint_step(substream->runtime, 0,
+                                          SNDRV_PCM_HW_PARAM_CHANNELS, 2);
        }
 
        return snd_hda_multi_out_dig_open(codec, &spec->multiout);