]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ALSA: hda - Check HDMI jack types in the auto configuration
authorTakashi Iwai <tiwai@suse.de>
Tue, 20 Jan 2009 17:24:13 +0000 (18:24 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 20 Jan 2009 17:24:13 +0000 (18:24 +0100)
Add dig_out_type and dig_in_type fields to autocfg struct.
A proper HDA_PCM_TYPE_* value is assigned to these fields according
to the pin-jack location type value.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/hda_codec.c
sound/pci/hda/hda_local.h

index 0129e95672ae59386387b2f0ce10d2a0c556f6c4..dd419ce43d92f216a089d9b80e7ed02ef0a66e0d 100644 (file)
@@ -3392,10 +3392,18 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec,
                case AC_JACK_SPDIF_OUT:
                case AC_JACK_DIG_OTHER_OUT:
                        cfg->dig_out_pin = nid;
+                       if (loc == AC_JACK_LOC_HDMI)
+                               cfg->dig_out_type = HDA_PCM_TYPE_HDMI;
+                       else
+                               cfg->dig_out_type = HDA_PCM_TYPE_SPDIF;
                        break;
                case AC_JACK_SPDIF_IN:
                case AC_JACK_DIG_OTHER_IN:
                        cfg->dig_in_pin = nid;
+                       if (loc == AC_JACK_LOC_HDMI)
+                               cfg->dig_in_type = HDA_PCM_TYPE_HDMI;
+                       else
+                               cfg->dig_in_type = HDA_PCM_TYPE_SPDIF;
                        break;
                }
        }
index 1dd8716c387f74e036a30d14301e37e443d77925..a4ecd77a451a1c0b314a533e1b926782ee8bd27f 100644 (file)
@@ -355,6 +355,8 @@ struct auto_pin_cfg {
        hda_nid_t dig_out_pin;
        hda_nid_t dig_in_pin;
        hda_nid_t mono_out_pin;
+       int dig_out_type; /* HDA_PCM_TYPE_XXX */
+       int dig_in_type; /* HDA_PCM_TYPE_XXX */
 };
 
 #define get_defcfg_connect(cfg) \