ALSA: hda - Set Stream Type in Stream Format according to AES0
authorAnssi Hannula <anssi.hannula@iki.fi>
Tue, 3 Aug 2010 10:28:57 +0000 (13:28 +0300)
committerTakashi Iwai <tiwai@suse.de>
Tue, 3 Aug 2010 10:53:27 +0000 (12:53 +0200)
Set bit 15 (Stream Type) of HDA Stream Format to 1 (Non-PCM) when IEC958
channel status bit 1 (AES0 & 0x02) is set to 1 (non-audio).

This is a prequisite for HDMI HBR passthrough.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/hda_codec.c
sound/pci/hda/hda_codec.h
sound/pci/hda/hda_intel.c

index d9d1c91dfd1b49c78ea7fb99d4dc4ab96e63f19b..bd8d7a63d7fe94a84e647b44794a660d19a1256d 100644 (file)
@@ -3051,7 +3051,8 @@ static struct hda_rate_tbl rate_bits[] = {
 unsigned int snd_hda_calc_stream_format(unsigned int rate,
                                        unsigned int channels,
                                        unsigned int format,
-                                       unsigned int maxbps)
+                                       unsigned int maxbps,
+                                       unsigned short spdif_ctls)
 {
        int i;
        unsigned int val = 0;
@@ -3095,6 +3096,9 @@ unsigned int snd_hda_calc_stream_format(unsigned int rate,
                return 0;
        }
 
+       if (spdif_ctls & AC_DIG1_NONAUDIO)
+               val |= 0x8000;
+
        return val;
 }
 EXPORT_SYMBOL_HDA(snd_hda_calc_stream_format);
index 5991d14e1ec08a7c4ad23fdd4e1628d6bba90331..4797416aa3d9552e020ae7a9da5cefb997e4d1d1 100644 (file)
@@ -928,7 +928,8 @@ void snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid);
 unsigned int snd_hda_calc_stream_format(unsigned int rate,
                                        unsigned int channels,
                                        unsigned int format,
-                                       unsigned int maxbps);
+                                       unsigned int maxbps,
+                                       unsigned short spdif_ctls);
 int snd_hda_is_supported_format(struct hda_codec *codec, hda_nid_t nid,
                                unsigned int format);
 
index 1df25cf5ce38c35f0d04fdddd43be9ea1d23c3f4..f8a2f5aa40265f042a95067ef83b2f6bb20c3204 100644 (file)
@@ -1653,7 +1653,8 @@ static int azx_pcm_prepare(struct snd_pcm_substream *substream)
        format_val = snd_hda_calc_stream_format(runtime->rate,
                                                runtime->channels,
                                                runtime->format,
-                                               hinfo->maxbps);
+                                               hinfo->maxbps,
+                                               apcm->codec->spdif_ctls);
        if (!format_val) {
                snd_printk(KERN_ERR SFX
                           "invalid format_val, rate=%d, ch=%d, format=%d\n",