diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-07-29 18:21:07 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-07-29 18:21:07 -0400 |
| commit | e271e872a8685be8e13fe006f0d81630f65d7e5c (patch) | |
| tree | d1a671f411a8e8cbbada2db46efafb0b5e3fe10e | |
| parent | 8f92054e7ca1d3a3ae50fb42d2253ac8730d9b2a (diff) | |
| parent | dc1eae256cfac03bf17bf3eb016e3a6423d3f9d5 (diff) | |
Merge branch 'fix/hda' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'fix/hda' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
ALSA: hda - Add a PC-beep workaround for ASUS P5-V
ALSA: hda - Assume PC-beep as default for Realtek
ALSA: hda - Don't register beep input device when no beep is available
ALSA: hda - Fix pin-detection of Nvidia HDMI
| -rw-r--r-- | sound/pci/hda/patch_hdmi.c | 13 | ||||
| -rw-r--r-- | sound/pci/hda/patch_nvhdmi.c | 3 | ||||
| -rw-r--r-- | sound/pci/hda/patch_realtek.c | 62 |
3 files changed, 58 insertions, 20 deletions
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index 86067ee78632..2fc53961054e 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c | |||
| @@ -52,6 +52,10 @@ struct hdmi_spec { | |||
| 52 | */ | 52 | */ |
| 53 | struct hda_multi_out multiout; | 53 | struct hda_multi_out multiout; |
| 54 | unsigned int codec_type; | 54 | unsigned int codec_type; |
| 55 | |||
| 56 | /* misc flags */ | ||
| 57 | /* PD bit indicates only the update, not the current state */ | ||
| 58 | unsigned int old_pin_detect:1; | ||
| 55 | }; | 59 | }; |
| 56 | 60 | ||
| 57 | 61 | ||
| @@ -616,6 +620,9 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec, hda_nid_t nid, | |||
| 616 | * Unsolicited events | 620 | * Unsolicited events |
| 617 | */ | 621 | */ |
| 618 | 622 | ||
| 623 | static void hdmi_present_sense(struct hda_codec *codec, hda_nid_t pin_nid, | ||
| 624 | struct hdmi_eld *eld); | ||
| 625 | |||
| 619 | static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res) | 626 | static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res) |
| 620 | { | 627 | { |
| 621 | struct hdmi_spec *spec = codec->spec; | 628 | struct hdmi_spec *spec = codec->spec; |
| @@ -632,6 +639,12 @@ static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res) | |||
| 632 | if (index < 0) | 639 | if (index < 0) |
| 633 | return; | 640 | return; |
| 634 | 641 | ||
| 642 | if (spec->old_pin_detect) { | ||
| 643 | if (pind) | ||
| 644 | hdmi_present_sense(codec, tag, &spec->sink_eld[index]); | ||
| 645 | pind = spec->sink_eld[index].monitor_present; | ||
| 646 | } | ||
| 647 | |||
| 635 | spec->sink_eld[index].monitor_present = pind; | 648 | spec->sink_eld[index].monitor_present = pind; |
| 636 | spec->sink_eld[index].eld_valid = eldv; | 649 | spec->sink_eld[index].eld_valid = eldv; |
| 637 | 650 | ||
diff --git a/sound/pci/hda/patch_nvhdmi.c b/sound/pci/hda/patch_nvhdmi.c index 3c10c0b149f4..b0652acee9b2 100644 --- a/sound/pci/hda/patch_nvhdmi.c +++ b/sound/pci/hda/patch_nvhdmi.c | |||
| @@ -478,6 +478,7 @@ static int patch_nvhdmi_8ch_89(struct hda_codec *codec) | |||
| 478 | 478 | ||
| 479 | codec->spec = spec; | 479 | codec->spec = spec; |
| 480 | spec->codec_type = HDA_CODEC_NVIDIA_MCP89; | 480 | spec->codec_type = HDA_CODEC_NVIDIA_MCP89; |
| 481 | spec->old_pin_detect = 1; | ||
| 481 | 482 | ||
| 482 | if (hdmi_parse_codec(codec) < 0) { | 483 | if (hdmi_parse_codec(codec) < 0) { |
| 483 | codec->spec = NULL; | 484 | codec->spec = NULL; |
| @@ -508,6 +509,7 @@ static int patch_nvhdmi_8ch_7x(struct hda_codec *codec) | |||
| 508 | spec->multiout.max_channels = 8; | 509 | spec->multiout.max_channels = 8; |
| 509 | spec->multiout.dig_out_nid = nvhdmi_master_con_nid_7x; | 510 | spec->multiout.dig_out_nid = nvhdmi_master_con_nid_7x; |
| 510 | spec->codec_type = HDA_CODEC_NVIDIA_MCP7X; | 511 | spec->codec_type = HDA_CODEC_NVIDIA_MCP7X; |
| 512 | spec->old_pin_detect = 1; | ||
| 511 | 513 | ||
| 512 | codec->patch_ops = nvhdmi_patch_ops_8ch_7x; | 514 | codec->patch_ops = nvhdmi_patch_ops_8ch_7x; |
| 513 | 515 | ||
| @@ -528,6 +530,7 @@ static int patch_nvhdmi_2ch(struct hda_codec *codec) | |||
| 528 | spec->multiout.max_channels = 2; | 530 | spec->multiout.max_channels = 2; |
| 529 | spec->multiout.dig_out_nid = nvhdmi_master_con_nid_7x; | 531 | spec->multiout.dig_out_nid = nvhdmi_master_con_nid_7x; |
| 530 | spec->codec_type = HDA_CODEC_NVIDIA_MCP7X; | 532 | spec->codec_type = HDA_CODEC_NVIDIA_MCP7X; |
| 533 | spec->old_pin_detect = 1; | ||
| 531 | 534 | ||
| 532 | codec->patch_ops = nvhdmi_patch_ops_2ch; | 535 | codec->patch_ops = nvhdmi_patch_ops_2ch; |
| 533 | 536 | ||
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index ff614dd824c1..596ea2f12cf6 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
| @@ -1267,11 +1267,11 @@ static int alc_auto_parse_customize_define(struct hda_codec *codec) | |||
| 1267 | unsigned nid = 0; | 1267 | unsigned nid = 0; |
| 1268 | struct alc_spec *spec = codec->spec; | 1268 | struct alc_spec *spec = codec->spec; |
| 1269 | 1269 | ||
| 1270 | spec->cdefine.enable_pcbeep = 1; /* assume always enabled */ | ||
| 1271 | |||
| 1270 | ass = codec->subsystem_id & 0xffff; | 1272 | ass = codec->subsystem_id & 0xffff; |
| 1271 | if (ass != codec->bus->pci->subsystem_device && (ass & 1)) { | 1273 | if (ass != codec->bus->pci->subsystem_device && (ass & 1)) |
| 1272 | spec->cdefine.enable_pcbeep = 1; /* assume always enabled */ | ||
| 1273 | goto do_sku; | 1274 | goto do_sku; |
| 1274 | } | ||
| 1275 | 1275 | ||
| 1276 | nid = 0x1d; | 1276 | nid = 0x1d; |
| 1277 | if (codec->vendor_id == 0x10ec0260) | 1277 | if (codec->vendor_id == 0x10ec0260) |
| @@ -5180,8 +5180,24 @@ static void fillup_priv_adc_nids(struct hda_codec *codec, hda_nid_t *nids, | |||
| 5180 | #ifdef CONFIG_SND_HDA_INPUT_BEEP | 5180 | #ifdef CONFIG_SND_HDA_INPUT_BEEP |
| 5181 | #define set_beep_amp(spec, nid, idx, dir) \ | 5181 | #define set_beep_amp(spec, nid, idx, dir) \ |
| 5182 | ((spec)->beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir)) | 5182 | ((spec)->beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir)) |
| 5183 | |||
| 5184 | static struct snd_pci_quirk beep_white_list[] = { | ||
| 5185 | SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1), | ||
| 5186 | {} | ||
| 5187 | }; | ||
| 5188 | |||
| 5189 | static inline int has_cdefine_beep(struct hda_codec *codec) | ||
| 5190 | { | ||
| 5191 | struct alc_spec *spec = codec->spec; | ||
| 5192 | const struct snd_pci_quirk *q; | ||
| 5193 | q = snd_pci_quirk_lookup(codec->bus->pci, beep_white_list); | ||
| 5194 | if (q) | ||
| 5195 | return q->value; | ||
| 5196 | return spec->cdefine.enable_pcbeep; | ||
| 5197 | } | ||
| 5183 | #else | 5198 | #else |
| 5184 | #define set_beep_amp(spec, nid, idx, dir) /* NOP */ | 5199 | #define set_beep_amp(spec, nid, idx, dir) /* NOP */ |
| 5200 | #define has_cdefine_beep(codec) 0 | ||
| 5185 | #endif | 5201 | #endif |
| 5186 | 5202 | ||
| 5187 | /* | 5203 | /* |
| @@ -10566,10 +10582,12 @@ static int patch_alc882(struct hda_codec *codec) | |||
| 10566 | } | 10582 | } |
| 10567 | } | 10583 | } |
| 10568 | 10584 | ||
| 10569 | err = snd_hda_attach_beep_device(codec, 0x1); | 10585 | if (has_cdefine_beep(codec)) { |
| 10570 | if (err < 0) { | 10586 | err = snd_hda_attach_beep_device(codec, 0x1); |
| 10571 | alc_free(codec); | 10587 | if (err < 0) { |
| 10572 | return err; | 10588 | alc_free(codec); |
| 10589 | return err; | ||
| 10590 | } | ||
| 10573 | } | 10591 | } |
| 10574 | 10592 | ||
| 10575 | if (board_config != ALC882_AUTO) | 10593 | if (board_config != ALC882_AUTO) |
| @@ -10619,7 +10637,7 @@ static int patch_alc882(struct hda_codec *codec) | |||
| 10619 | 10637 | ||
| 10620 | set_capture_mixer(codec); | 10638 | set_capture_mixer(codec); |
| 10621 | 10639 | ||
| 10622 | if (spec->cdefine.enable_pcbeep) | 10640 | if (has_cdefine_beep(codec)) |
| 10623 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); | 10641 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
| 10624 | 10642 | ||
| 10625 | if (board_config == ALC882_AUTO) | 10643 | if (board_config == ALC882_AUTO) |
| @@ -12435,7 +12453,7 @@ static int patch_alc262(struct hda_codec *codec) | |||
| 12435 | } | 12453 | } |
| 12436 | } | 12454 | } |
| 12437 | 12455 | ||
| 12438 | if (!spec->no_analog) { | 12456 | if (!spec->no_analog && has_cdefine_beep(codec)) { |
| 12439 | err = snd_hda_attach_beep_device(codec, 0x1); | 12457 | err = snd_hda_attach_beep_device(codec, 0x1); |
| 12440 | if (err < 0) { | 12458 | if (err < 0) { |
| 12441 | alc_free(codec); | 12459 | alc_free(codec); |
| @@ -12486,7 +12504,7 @@ static int patch_alc262(struct hda_codec *codec) | |||
| 12486 | } | 12504 | } |
| 12487 | if (!spec->cap_mixer && !spec->no_analog) | 12505 | if (!spec->cap_mixer && !spec->no_analog) |
| 12488 | set_capture_mixer(codec); | 12506 | set_capture_mixer(codec); |
| 12489 | if (!spec->no_analog && spec->cdefine.enable_pcbeep) | 12507 | if (!spec->no_analog && has_cdefine_beep(codec)) |
| 12490 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); | 12508 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
| 12491 | 12509 | ||
| 12492 | spec->vmaster_nid = 0x0c; | 12510 | spec->vmaster_nid = 0x0c; |
| @@ -14458,10 +14476,12 @@ static int patch_alc269(struct hda_codec *codec) | |||
| 14458 | } | 14476 | } |
| 14459 | } | 14477 | } |
| 14460 | 14478 | ||
| 14461 | err = snd_hda_attach_beep_device(codec, 0x1); | 14479 | if (has_cdefine_beep(codec)) { |
| 14462 | if (err < 0) { | 14480 | err = snd_hda_attach_beep_device(codec, 0x1); |
| 14463 | alc_free(codec); | 14481 | if (err < 0) { |
| 14464 | return err; | 14482 | alc_free(codec); |
| 14483 | return err; | ||
| 14484 | } | ||
| 14465 | } | 14485 | } |
| 14466 | 14486 | ||
| 14467 | if (board_config != ALC269_AUTO) | 14487 | if (board_config != ALC269_AUTO) |
| @@ -14494,7 +14514,7 @@ static int patch_alc269(struct hda_codec *codec) | |||
| 14494 | 14514 | ||
| 14495 | if (!spec->cap_mixer) | 14515 | if (!spec->cap_mixer) |
| 14496 | set_capture_mixer(codec); | 14516 | set_capture_mixer(codec); |
| 14497 | if (spec->cdefine.enable_pcbeep) | 14517 | if (has_cdefine_beep(codec)) |
| 14498 | set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); | 14518 | set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); |
| 14499 | 14519 | ||
| 14500 | if (board_config == ALC269_AUTO) | 14520 | if (board_config == ALC269_AUTO) |
| @@ -18691,10 +18711,12 @@ static int patch_alc662(struct hda_codec *codec) | |||
| 18691 | } | 18711 | } |
| 18692 | } | 18712 | } |
| 18693 | 18713 | ||
| 18694 | err = snd_hda_attach_beep_device(codec, 0x1); | 18714 | if (has_cdefine_beep(codec)) { |
| 18695 | if (err < 0) { | 18715 | err = snd_hda_attach_beep_device(codec, 0x1); |
| 18696 | alc_free(codec); | 18716 | if (err < 0) { |
| 18697 | return err; | 18717 | alc_free(codec); |
| 18718 | return err; | ||
| 18719 | } | ||
| 18698 | } | 18720 | } |
| 18699 | 18721 | ||
| 18700 | if (board_config != ALC662_AUTO) | 18722 | if (board_config != ALC662_AUTO) |
| @@ -18716,7 +18738,7 @@ static int patch_alc662(struct hda_codec *codec) | |||
| 18716 | if (!spec->cap_mixer) | 18738 | if (!spec->cap_mixer) |
| 18717 | set_capture_mixer(codec); | 18739 | set_capture_mixer(codec); |
| 18718 | 18740 | ||
| 18719 | if (spec->cdefine.enable_pcbeep) { | 18741 | if (has_cdefine_beep(codec)) { |
| 18720 | switch (codec->vendor_id) { | 18742 | switch (codec->vendor_id) { |
| 18721 | case 0x10ec0662: | 18743 | case 0x10ec0662: |
| 18722 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); | 18744 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
