diff options
author | Takashi Iwai <tiwai@suse.de> | 2013-03-07 18:32:59 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-03-07 18:32:59 +0100 |
commit | f811c3cf8fae63ecc8a937ba7376490e2565f8f1 (patch) | |
tree | 2e1b91e0079b8f1b404260d2ea5cf51d513f6332 /sound | |
parent | 3f550e323242bea82d07dfd06e6ce3f723eef7bd (diff) |
ALSA: hda - Consolidate add_in_jack_modes and add_out_jack_modes hints
There is no big merit to distinguish these two hints. Instead, just
have a single flag, add_jack_modes, for creating the jack mode enum
ctls for both I/O directions.
The hint string parser code is left and translated as add_jack_modes
just for keeping compatibility.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/hda/hda_generic.c | 26 | ||||
-rw-r--r-- | sound/pci/hda/hda_generic.h | 3 | ||||
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 3 |
3 files changed, 14 insertions, 18 deletions
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c index cb40a0b7ce3e..c8791225b2ba 100644 --- a/sound/pci/hda/hda_generic.c +++ b/sound/pci/hda/hda_generic.c @@ -150,12 +150,16 @@ static void parse_user_hints(struct hda_codec *codec) val = snd_hda_get_bool_hint(codec, "add_stereo_mix_input"); if (val >= 0) spec->add_stereo_mix_input = !!val; + /* the following two are just for compatibility */ val = snd_hda_get_bool_hint(codec, "add_out_jack_modes"); if (val >= 0) - spec->add_out_jack_modes = !!val; + spec->add_jack_modes = !!val; val = snd_hda_get_bool_hint(codec, "add_in_jack_modes"); if (val >= 0) - spec->add_in_jack_modes = !!val; + spec->add_jack_modes = !!val; + val = snd_hda_get_bool_hint(codec, "add_jack_modes"); + if (val >= 0) + spec->add_jack_modes = !!val; val = snd_hda_get_bool_hint(codec, "power_down_unused"); if (val >= 0) spec->power_down_unused = !!val; @@ -2373,7 +2377,7 @@ static void get_jack_mode_name(struct hda_codec *codec, hda_nid_t pin, static int get_out_jack_num_items(struct hda_codec *codec, hda_nid_t pin) { struct hda_gen_spec *spec = codec->spec; - if (spec->add_out_jack_modes) { + if (spec->add_jack_modes) { unsigned int pincap = snd_hda_query_pin_caps(codec, pin); if ((pincap & AC_PINCAP_OUT) && (pincap & AC_PINCAP_HP_DRV)) return 2; @@ -2520,7 +2524,7 @@ static int get_in_jack_num_items(struct hda_codec *codec, hda_nid_t pin) { struct hda_gen_spec *spec = codec->spec; int nitems = 0; - if (spec->add_in_jack_modes) + if (spec->add_jack_modes) nitems = hweight32(get_vref_caps(codec, pin)); return nitems ? nitems : 1; } @@ -2532,14 +2536,8 @@ static int create_in_jack_mode(struct hda_codec *codec, hda_nid_t pin) char name[44]; unsigned int defcfg; - if (pin == spec->hp_mic_pin) { - if (!spec->add_out_jack_modes) { - int ret = create_hp_mic_jack_mode(codec, pin); - if (ret < 0) - return ret; - } - return 0; - } + if (pin == spec->hp_mic_pin) + return 0; /* already done in create_out_jack_mode() */ /* no jack mode for fixed pins */ defcfg = snd_hda_codec_get_pincfg(codec, pin); @@ -2981,7 +2979,7 @@ static int create_input_ctls(struct hda_codec *codec) if (err < 0) return err; - if (spec->add_in_jack_modes) { + if (spec->add_jack_modes) { err = create_in_jack_mode(codec, pin); if (err < 0) return err; @@ -4215,7 +4213,7 @@ int snd_hda_gen_parse_auto_config(struct hda_codec *codec, if (err < 0) return err; - if (spec->add_out_jack_modes) { + if (spec->add_jack_modes) { if (cfg->line_out_type != AUTO_PIN_SPEAKER_OUT) { err = create_out_jack_modes(codec, cfg->line_outs, cfg->line_out_pins); diff --git a/sound/pci/hda/hda_generic.h b/sound/pci/hda/hda_generic.h index 7ee5b57946c9..984bf301ebbb 100644 --- a/sound/pci/hda/hda_generic.h +++ b/sound/pci/hda/hda_generic.h @@ -213,8 +213,7 @@ struct hda_gen_spec { unsigned int indep_hp:1; /* independent HP supported */ unsigned int prefer_hp_amp:1; /* enable HP amp for speaker if any */ unsigned int add_stereo_mix_input:1; /* add aamix as a capture src */ - unsigned int add_out_jack_modes:1; /* add output jack mode enum ctls */ - unsigned int add_in_jack_modes:1; /* add input jack mode enum ctls */ + unsigned int add_jack_modes:1; /* add i/o jack mode enum ctls */ unsigned int power_down_unused:1; /* power down unused widgets */ /* other internal flags */ diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 056990e5ffe9..f772585c89ba 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -1526,8 +1526,7 @@ static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec, { struct alc_spec *spec = codec->spec; if (action == HDA_FIXUP_ACT_PRE_PROBE) { - spec->gen.add_out_jack_modes = 1; - spec->gen.add_in_jack_modes = 1; + spec->gen.add_jack_modes = 1; spec->gen.hp_mic = 1; } } |