diff options
author | David Henningsson <david.henningsson@canonical.com> | 2011-09-20 06:04:56 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-09-20 12:22:33 -0400 |
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 2be1129cf458..a18952ed4311 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, | |||
453 | alc_fixup_autocfg_pin_nums(codec); | 453 | alc_fixup_autocfg_pin_nums(codec); |
454 | } | 454 | } |
455 | 455 | ||
456 | static void alc_simple_setup_automute(struct alc_spec *spec, int mode) | ||
457 | { | ||
458 | int lo_pin = spec->autocfg.line_out_pins[0]; | ||
459 | |||
460 | if (lo_pin == spec->autocfg.speaker_pins[0] || | ||
461 | lo_pin == spec->autocfg.hp_pins[0]) | ||
462 | lo_pin = 0; | ||
463 | spec->automute_mode = mode; | ||
464 | spec->detect_hp = !!spec->autocfg.hp_pins[0]; | ||
465 | spec->detect_lo = !!lo_pin; | ||
466 | spec->automute_lo = spec->automute_lo_possible = !!lo_pin; | ||
467 | spec->automute_speaker = spec->automute_speaker_possible = !!spec->autocfg.speaker_pins[0]; | ||
468 | } | ||
456 | 469 | ||
457 | /* auto-toggle front mic */ | 470 | /* auto-toggle front mic */ |
458 | static void alc88x_simple_mic_automute(struct hda_codec *codec) | 471 | static void alc88x_simple_mic_automute(struct hda_codec *codec) |