diff options
author | David Henningsson <david.henningsson@canonical.com> | 2011-09-20 12:04:56 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-09-20 18:22:33 +0200 |
commit | 42cf0d0155539ef1933e63453e5169a4f631d7e7 (patch) | |
tree | c3b4777ee9ea3d24012273962b59a6920f2ed00a /sound/pci/hda/alc_quirks.c | |
parent | 290b421f699463478d215c17cd6be52d78e16976 (diff) |
ALSA: HDA: Refactor Realtek's automute
Increase readability and understandability in the automute code.
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/alc_quirks.c')
-rw-r--r-- | sound/pci/hda/alc_quirks.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sound/pci/hda/alc_quirks.c b/sound/pci/hda/alc_quirks.c index 2be1129cf45..a18952ed431 100644 --- a/sound/pci/hda/alc_quirks.c +++ b/sound/pci/hda/alc_quirks.c @@ -453,6 +453,19 @@ static void setup_preset(struct hda_codec *codec, alc_fixup_autocfg_pin_nums(codec); } +static void alc_simple_setup_automute(struct alc_spec *spec, int mode) +{ + int lo_pin = spec->autocfg.line_out_pins[0]; + + if (lo_pin == spec->autocfg.speaker_pins[0] || + lo_pin == spec->autocfg.hp_pins[0]) + lo_pin = 0; + spec->automute_mode = mode; + spec->detect_hp = !!spec->autocfg.hp_pins[0]; + spec->detect_lo = !!lo_pin; + spec->automute_lo = spec->automute_lo_possible = !!lo_pin; + spec->automute_speaker = spec->automute_speaker_possible = !!spec->autocfg.speaker_pins[0]; +} /* auto-toggle front mic */ static void alc88x_simple_mic_automute(struct hda_codec *codec) |