diff options
author | Takashi Iwai <tiwai@suse.de> | 2010-07-09 04:09:00 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-07-09 04:09:00 -0400 |
commit | f8fb27bd4aac6b5b16fa37761aeffe8976d445da (patch) | |
tree | 95880f8f1d3b8b7eecf4a58184b9c9c2d08558a4 | |
parent | afbd9b8448f4b7d15673c6858012f384f18d28b8 (diff) | |
parent | ac0547dc62e67a3e0b0c1628b6e49efba8f517db (diff) |
Merge branch 'fix/hda' into topic/hda
-rw-r--r-- | sound/pci/hda/hda_codec.c | 27 | ||||
-rw-r--r-- | sound/pci/hda/hda_codec.h | 5 | ||||
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 7 |
3 files changed, 36 insertions, 3 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 88a1c6acbcbd..501cbc411a83 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -784,6 +784,9 @@ static int read_pin_defaults(struct hda_codec *codec) | |||
784 | pin->nid = nid; | 784 | pin->nid = nid; |
785 | pin->cfg = snd_hda_codec_read(codec, nid, 0, | 785 | pin->cfg = snd_hda_codec_read(codec, nid, 0, |
786 | AC_VERB_GET_CONFIG_DEFAULT, 0); | 786 | AC_VERB_GET_CONFIG_DEFAULT, 0); |
787 | pin->ctrl = snd_hda_codec_read(codec, nid, 0, | ||
788 | AC_VERB_GET_PIN_WIDGET_CONTROL, | ||
789 | 0); | ||
787 | } | 790 | } |
788 | return 0; | 791 | return 0; |
789 | } | 792 | } |
@@ -912,15 +915,38 @@ static void restore_pincfgs(struct hda_codec *codec) | |||
912 | void snd_hda_shutup_pins(struct hda_codec *codec) | 915 | void snd_hda_shutup_pins(struct hda_codec *codec) |
913 | { | 916 | { |
914 | int i; | 917 | int i; |
918 | /* don't shut up pins when unloading the driver; otherwise it breaks | ||
919 | * the default pin setup at the next load of the driver | ||
920 | */ | ||
921 | if (codec->bus->shutdown) | ||
922 | return; | ||
915 | for (i = 0; i < codec->init_pins.used; i++) { | 923 | for (i = 0; i < codec->init_pins.used; i++) { |
916 | struct hda_pincfg *pin = snd_array_elem(&codec->init_pins, i); | 924 | struct hda_pincfg *pin = snd_array_elem(&codec->init_pins, i); |
917 | /* use read here for syncing after issuing each verb */ | 925 | /* use read here for syncing after issuing each verb */ |
918 | snd_hda_codec_read(codec, pin->nid, 0, | 926 | snd_hda_codec_read(codec, pin->nid, 0, |
919 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0); | 927 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0); |
920 | } | 928 | } |
929 | codec->pins_shutup = 1; | ||
921 | } | 930 | } |
922 | EXPORT_SYMBOL_HDA(snd_hda_shutup_pins); | 931 | EXPORT_SYMBOL_HDA(snd_hda_shutup_pins); |
923 | 932 | ||
933 | /* Restore the pin controls cleared previously via snd_hda_shutup_pins() */ | ||
934 | static void restore_shutup_pins(struct hda_codec *codec) | ||
935 | { | ||
936 | int i; | ||
937 | if (!codec->pins_shutup) | ||
938 | return; | ||
939 | if (codec->bus->shutdown) | ||
940 | return; | ||
941 | for (i = 0; i < codec->init_pins.used; i++) { | ||
942 | struct hda_pincfg *pin = snd_array_elem(&codec->init_pins, i); | ||
943 | snd_hda_codec_write(codec, pin->nid, 0, | ||
944 | AC_VERB_SET_PIN_WIDGET_CONTROL, | ||
945 | pin->ctrl); | ||
946 | } | ||
947 | codec->pins_shutup = 0; | ||
948 | } | ||
949 | |||
924 | static void init_hda_cache(struct hda_cache_rec *cache, | 950 | static void init_hda_cache(struct hda_cache_rec *cache, |
925 | unsigned int record_size); | 951 | unsigned int record_size); |
926 | static void free_hda_cache(struct hda_cache_rec *cache); | 952 | static void free_hda_cache(struct hda_cache_rec *cache); |
@@ -2917,6 +2943,7 @@ static void hda_call_codec_resume(struct hda_codec *codec) | |||
2917 | codec->afg ? codec->afg : codec->mfg, | 2943 | codec->afg ? codec->afg : codec->mfg, |
2918 | AC_PWRST_D0); | 2944 | AC_PWRST_D0); |
2919 | restore_pincfgs(codec); /* restore all current pin configs */ | 2945 | restore_pincfgs(codec); /* restore all current pin configs */ |
2946 | restore_shutup_pins(codec); | ||
2920 | hda_exec_init_verbs(codec); | 2947 | hda_exec_init_verbs(codec); |
2921 | if (codec->patch_ops.resume) | 2948 | if (codec->patch_ops.resume) |
2922 | codec->patch_ops.resume(codec); | 2949 | codec->patch_ops.resume(codec); |
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h index 49e939e7e5cd..5991d14e1ec0 100644 --- a/sound/pci/hda/hda_codec.h +++ b/sound/pci/hda/hda_codec.h | |||
@@ -821,6 +821,7 @@ struct hda_codec { | |||
821 | unsigned int pin_amp_workaround:1; /* pin out-amp takes index | 821 | unsigned int pin_amp_workaround:1; /* pin out-amp takes index |
822 | * (e.g. Conexant codecs) | 822 | * (e.g. Conexant codecs) |
823 | */ | 823 | */ |
824 | unsigned int pins_shutup:1; /* pins are shut up */ | ||
824 | unsigned int no_trigger_sense:1; /* don't trigger at pin-sensing */ | 825 | unsigned int no_trigger_sense:1; /* don't trigger at pin-sensing */ |
825 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 826 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
826 | unsigned int power_on :1; /* current (global) power-state */ | 827 | unsigned int power_on :1; /* current (global) power-state */ |
@@ -897,7 +898,9 @@ void snd_hda_codec_resume_cache(struct hda_codec *codec); | |||
897 | /* the struct for codec->pin_configs */ | 898 | /* the struct for codec->pin_configs */ |
898 | struct hda_pincfg { | 899 | struct hda_pincfg { |
899 | hda_nid_t nid; | 900 | hda_nid_t nid; |
900 | unsigned int cfg; | 901 | unsigned char ctrl; /* current pin control value */ |
902 | unsigned char pad; /* reserved */ | ||
903 | unsigned int cfg; /* default configuration */ | ||
901 | }; | 904 | }; |
902 | 905 | ||
903 | unsigned int snd_hda_codec_get_pincfg(struct hda_codec *codec, hda_nid_t nid); | 906 | unsigned int snd_hda_codec_get_pincfg(struct hda_codec *codec, hda_nid_t nid); |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 9b15a46e3ccc..a7592f5e97d4 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -1275,8 +1275,10 @@ static int alc_auto_parse_customize_define(struct hda_codec *codec) | |||
1275 | struct alc_spec *spec = codec->spec; | 1275 | struct alc_spec *spec = codec->spec; |
1276 | 1276 | ||
1277 | ass = codec->subsystem_id & 0xffff; | 1277 | ass = codec->subsystem_id & 0xffff; |
1278 | if (ass != codec->bus->pci->subsystem_device && (ass & 1)) | 1278 | if (ass != codec->bus->pci->subsystem_device && (ass & 1)) { |
1279 | spec->cdefine.enable_pcbeep = 1; /* assume always enabled */ | ||
1279 | goto do_sku; | 1280 | goto do_sku; |
1281 | } | ||
1280 | 1282 | ||
1281 | nid = 0x1d; | 1283 | nid = 0x1d; |
1282 | if (codec->vendor_id == 0x10ec0260) | 1284 | if (codec->vendor_id == 0x10ec0260) |
@@ -2554,7 +2556,7 @@ static struct snd_kcontrol_new alc_beep_mixer[] = { | |||
2554 | static int alc_build_controls(struct hda_codec *codec) | 2556 | static int alc_build_controls(struct hda_codec *codec) |
2555 | { | 2557 | { |
2556 | struct alc_spec *spec = codec->spec; | 2558 | struct alc_spec *spec = codec->spec; |
2557 | struct snd_kcontrol *kctl; | 2559 | struct snd_kcontrol *kctl = NULL; |
2558 | struct snd_kcontrol_new *knew; | 2560 | struct snd_kcontrol_new *knew; |
2559 | int i, j, err; | 2561 | int i, j, err; |
2560 | unsigned int u; | 2562 | unsigned int u; |
@@ -9493,6 +9495,7 @@ static struct snd_pci_quirk alc882_ssid_cfg_tbl[] = { | |||
9493 | SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_IMAC24), | 9495 | SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_IMAC24), |
9494 | SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC885_IMAC91), | 9496 | SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC885_IMAC91), |
9495 | SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC885_MB5), | 9497 | SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC885_MB5), |
9498 | SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC885_MB5), | ||
9496 | /* FIXME: HP jack sense seems not working for MBP 5,1 or 5,2, | 9499 | /* FIXME: HP jack sense seems not working for MBP 5,1 or 5,2, |
9497 | * so apparently no perfect solution yet | 9500 | * so apparently no perfect solution yet |
9498 | */ | 9501 | */ |