Skip to content

Commit

Permalink
ALSA: hda - Check HDMI jack types in the auto configuration
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Takashi Iwai committed Jan 20, 2009
1 parent 41b5b01 commit 2297bd6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sound/pci/hda/hda_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
2 changes: 2 additions & 0 deletions sound/pci/hda/hda_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down

0 comments on commit 2297bd6

Please sign in to comment.