diff options
author | Takashi Iwai <tiwai@suse.de> | 2010-02-17 08:24:46 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-02-17 08:24:46 -0500 |
commit | 7fb3a069bc5d3577409c2ae89f89cd264ff85816 (patch) | |
tree | 7fe3ba3b95faeecb01e4feafb9288ef4b523c6b3 /sound/pci | |
parent | 291186e049d7f8178ad31d43c38a53889f25d79e (diff) | |
parent | 9d3415a8cc76ff65c6602a121ac318432c5cd7ba (diff) |
Merge branch 'fix/misc' into topic/misc
Conflicts:
sound/pci/hda/patch_realtek.c
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/atiixp.c | 1 | ||||
-rw-r--r-- | sound/pci/echoaudio/echoaudio.c | 4 | ||||
-rw-r--r-- | sound/pci/hda/hda_intel.c | 25 | ||||
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 127 | ||||
-rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 61 | ||||
-rw-r--r-- | sound/pci/riptide/riptide.c | 2 |
6 files changed, 176 insertions, 44 deletions
diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c index 81e2bfc11257..49d572a7b235 100644 --- a/sound/pci/atiixp.c +++ b/sound/pci/atiixp.c | |||
@@ -297,6 +297,7 @@ static DEFINE_PCI_DEVICE_TABLE(snd_atiixp_ids) = { | |||
297 | MODULE_DEVICE_TABLE(pci, snd_atiixp_ids); | 297 | MODULE_DEVICE_TABLE(pci, snd_atiixp_ids); |
298 | 298 | ||
299 | static struct snd_pci_quirk atiixp_quirks[] __devinitdata = { | 299 | static struct snd_pci_quirk atiixp_quirks[] __devinitdata = { |
300 | SND_PCI_QUIRK(0x105b, 0x0c81, "Foxconn RC4107MA-RS2", 0), | ||
300 | SND_PCI_QUIRK(0x15bd, 0x3100, "DFI RS482", 0), | 301 | SND_PCI_QUIRK(0x15bd, 0x3100, "DFI RS482", 0), |
301 | { } /* terminator */ | 302 | { } /* terminator */ |
302 | }; | 303 | }; |
diff --git a/sound/pci/echoaudio/echoaudio.c b/sound/pci/echoaudio/echoaudio.c index 2783ce6c236e..8dab82d7d19d 100644 --- a/sound/pci/echoaudio/echoaudio.c +++ b/sound/pci/echoaudio/echoaudio.c | |||
@@ -1864,7 +1864,9 @@ static irqreturn_t snd_echo_interrupt(int irq, void *dev_id) | |||
1864 | /* The hardware doesn't tell us which substream caused the irq, | 1864 | /* The hardware doesn't tell us which substream caused the irq, |
1865 | thus we have to check all running substreams. */ | 1865 | thus we have to check all running substreams. */ |
1866 | for (ss = 0; ss < DSP_MAXPIPES; ss++) { | 1866 | for (ss = 0; ss < DSP_MAXPIPES; ss++) { |
1867 | if ((substream = chip->substream[ss])) { | 1867 | substream = chip->substream[ss]; |
1868 | if (substream && ((struct audiopipe *)substream->runtime-> | ||
1869 | private_data)->state == PIPE_STATE_STARTED) { | ||
1868 | period = pcm_pointer(substream) / | 1870 | period = pcm_pointer(substream) / |
1869 | substream->runtime->period_size; | 1871 | substream->runtime->period_size; |
1870 | if (period != chip->last_period[ss]) { | 1872 | if (period != chip->last_period[ss]) { |
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index ac05bef7c2ec..8d8e0b5aa248 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -426,6 +426,7 @@ struct azx { | |||
426 | 426 | ||
427 | /* flags */ | 427 | /* flags */ |
428 | int position_fix; | 428 | int position_fix; |
429 | int poll_count; | ||
429 | unsigned int running :1; | 430 | unsigned int running :1; |
430 | unsigned int initialized :1; | 431 | unsigned int initialized :1; |
431 | unsigned int single_cmd :1; | 432 | unsigned int single_cmd :1; |
@@ -506,7 +507,7 @@ static char *driver_short_names[] __devinitdata = { | |||
506 | #define get_azx_dev(substream) (substream->runtime->private_data) | 507 | #define get_azx_dev(substream) (substream->runtime->private_data) |
507 | 508 | ||
508 | static int azx_acquire_irq(struct azx *chip, int do_disconnect); | 509 | static int azx_acquire_irq(struct azx *chip, int do_disconnect); |
509 | 510 | static int azx_send_cmd(struct hda_bus *bus, unsigned int val); | |
510 | /* | 511 | /* |
511 | * Interface for HD codec | 512 | * Interface for HD codec |
512 | */ | 513 | */ |
@@ -664,11 +665,12 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus, | |||
664 | { | 665 | { |
665 | struct azx *chip = bus->private_data; | 666 | struct azx *chip = bus->private_data; |
666 | unsigned long timeout; | 667 | unsigned long timeout; |
668 | int do_poll = 0; | ||
667 | 669 | ||
668 | again: | 670 | again: |
669 | timeout = jiffies + msecs_to_jiffies(1000); | 671 | timeout = jiffies + msecs_to_jiffies(1000); |
670 | for (;;) { | 672 | for (;;) { |
671 | if (chip->polling_mode) { | 673 | if (chip->polling_mode || do_poll) { |
672 | spin_lock_irq(&chip->reg_lock); | 674 | spin_lock_irq(&chip->reg_lock); |
673 | azx_update_rirb(chip); | 675 | azx_update_rirb(chip); |
674 | spin_unlock_irq(&chip->reg_lock); | 676 | spin_unlock_irq(&chip->reg_lock); |
@@ -676,6 +678,9 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus, | |||
676 | if (!chip->rirb.cmds[addr]) { | 678 | if (!chip->rirb.cmds[addr]) { |
677 | smp_rmb(); | 679 | smp_rmb(); |
678 | bus->rirb_error = 0; | 680 | bus->rirb_error = 0; |
681 | |||
682 | if (!do_poll) | ||
683 | chip->poll_count = 0; | ||
679 | return chip->rirb.res[addr]; /* the last value */ | 684 | return chip->rirb.res[addr]; /* the last value */ |
680 | } | 685 | } |
681 | if (time_after(jiffies, timeout)) | 686 | if (time_after(jiffies, timeout)) |
@@ -688,6 +693,16 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus, | |||
688 | } | 693 | } |
689 | } | 694 | } |
690 | 695 | ||
696 | if (!chip->polling_mode && chip->poll_count < 2) { | ||
697 | snd_printdd(SFX "azx_get_response timeout, " | ||
698 | "polling the codec once: last cmd=0x%08x\n", | ||
699 | chip->last_cmd[addr]); | ||
700 | do_poll = 1; | ||
701 | chip->poll_count++; | ||
702 | goto again; | ||
703 | } | ||
704 | |||
705 | |||
691 | if (!chip->polling_mode) { | 706 | if (!chip->polling_mode) { |
692 | snd_printk(KERN_WARNING SFX "azx_get_response timeout, " | 707 | snd_printk(KERN_WARNING SFX "azx_get_response timeout, " |
693 | "switching to polling mode: last cmd=0x%08x\n", | 708 | "switching to polling mode: last cmd=0x%08x\n", |
@@ -1878,6 +1893,9 @@ static int azx_position_ok(struct azx *chip, struct azx_dev *azx_dev) | |||
1878 | 1893 | ||
1879 | if (!bdl_pos_adj[chip->dev_index]) | 1894 | if (!bdl_pos_adj[chip->dev_index]) |
1880 | return 1; /* no delayed ack */ | 1895 | return 1; /* no delayed ack */ |
1896 | if (WARN_ONCE(!azx_dev->period_bytes, | ||
1897 | "hda-intel: zero azx_dev->period_bytes")) | ||
1898 | return 0; /* this shouldn't happen! */ | ||
1881 | if (pos % azx_dev->period_bytes > azx_dev->period_bytes / 2) | 1899 | if (pos % azx_dev->period_bytes > azx_dev->period_bytes / 2) |
1882 | return 0; /* NG - it's below the period boundary */ | 1900 | return 0; /* NG - it's below the period boundary */ |
1883 | return 1; /* OK, it's fine */ | 1901 | return 1; /* OK, it's fine */ |
@@ -2043,7 +2061,7 @@ static int azx_acquire_irq(struct azx *chip, int do_disconnect) | |||
2043 | { | 2061 | { |
2044 | if (request_irq(chip->pci->irq, azx_interrupt, | 2062 | if (request_irq(chip->pci->irq, azx_interrupt, |
2045 | chip->msi ? 0 : IRQF_SHARED, | 2063 | chip->msi ? 0 : IRQF_SHARED, |
2046 | "HDA Intel", chip)) { | 2064 | "hda_intel", chip)) { |
2047 | printk(KERN_ERR "hda-intel: unable to grab IRQ %d, " | 2065 | printk(KERN_ERR "hda-intel: unable to grab IRQ %d, " |
2048 | "disabling device\n", chip->pci->irq); | 2066 | "disabling device\n", chip->pci->irq); |
2049 | if (do_disconnect) | 2067 | if (do_disconnect) |
@@ -2332,6 +2350,7 @@ static void __devinit check_probe_mask(struct azx *chip, int dev) | |||
2332 | */ | 2350 | */ |
2333 | static struct snd_pci_quirk msi_black_list[] __devinitdata = { | 2351 | static struct snd_pci_quirk msi_black_list[] __devinitdata = { |
2334 | SND_PCI_QUIRK(0x1043, 0x81f2, "ASUS", 0), /* Athlon64 X2 + nvidia */ | 2352 | SND_PCI_QUIRK(0x1043, 0x81f2, "ASUS", 0), /* Athlon64 X2 + nvidia */ |
2353 | SND_PCI_QUIRK(0x1043, 0x829c, "ASUS", 0), /* nvidia */ | ||
2335 | {} | 2354 | {} |
2336 | }; | 2355 | }; |
2337 | 2356 | ||
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 141ff446104a..f628c33d80b3 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -1097,6 +1097,16 @@ static void alc889_coef_init(struct hda_codec *codec) | |||
1097 | snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, tmp|0x2010); | 1097 | snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, tmp|0x2010); |
1098 | } | 1098 | } |
1099 | 1099 | ||
1100 | /* turn on/off EAPD control (only if available) */ | ||
1101 | static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on) | ||
1102 | { | ||
1103 | if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN) | ||
1104 | return; | ||
1105 | if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD) | ||
1106 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE, | ||
1107 | on ? 2 : 0); | ||
1108 | } | ||
1109 | |||
1100 | static void alc_auto_init_amp(struct hda_codec *codec, int type) | 1110 | static void alc_auto_init_amp(struct hda_codec *codec, int type) |
1101 | { | 1111 | { |
1102 | unsigned int tmp; | 1112 | unsigned int tmp; |
@@ -1114,25 +1124,22 @@ static void alc_auto_init_amp(struct hda_codec *codec, int type) | |||
1114 | case ALC_INIT_DEFAULT: | 1124 | case ALC_INIT_DEFAULT: |
1115 | switch (codec->vendor_id) { | 1125 | switch (codec->vendor_id) { |
1116 | case 0x10ec0260: | 1126 | case 0x10ec0260: |
1117 | snd_hda_codec_write(codec, 0x0f, 0, | 1127 | set_eapd(codec, 0x0f, 1); |
1118 | AC_VERB_SET_EAPD_BTLENABLE, 2); | 1128 | set_eapd(codec, 0x10, 1); |
1119 | snd_hda_codec_write(codec, 0x10, 0, | ||
1120 | AC_VERB_SET_EAPD_BTLENABLE, 2); | ||
1121 | break; | 1129 | break; |
1122 | case 0x10ec0262: | 1130 | case 0x10ec0262: |
1123 | case 0x10ec0267: | 1131 | case 0x10ec0267: |
1124 | case 0x10ec0268: | 1132 | case 0x10ec0268: |
1125 | case 0x10ec0269: | 1133 | case 0x10ec0269: |
1134 | case 0x10ec0270: | ||
1126 | case 0x10ec0272: | 1135 | case 0x10ec0272: |
1127 | case 0x10ec0660: | 1136 | case 0x10ec0660: |
1128 | case 0x10ec0662: | 1137 | case 0x10ec0662: |
1129 | case 0x10ec0663: | 1138 | case 0x10ec0663: |
1130 | case 0x10ec0862: | 1139 | case 0x10ec0862: |
1131 | case 0x10ec0889: | 1140 | case 0x10ec0889: |
1132 | snd_hda_codec_write(codec, 0x14, 0, | 1141 | set_eapd(codec, 0x14, 1); |
1133 | AC_VERB_SET_EAPD_BTLENABLE, 2); | 1142 | set_eapd(codec, 0x15, 1); |
1134 | snd_hda_codec_write(codec, 0x15, 0, | ||
1135 | AC_VERB_SET_EAPD_BTLENABLE, 2); | ||
1136 | break; | 1143 | break; |
1137 | } | 1144 | } |
1138 | switch (codec->vendor_id) { | 1145 | switch (codec->vendor_id) { |
@@ -1234,6 +1241,8 @@ static void alc_init_auto_mic(struct hda_codec *codec) | |||
1234 | return; /* invalid entry */ | 1241 | return; /* invalid entry */ |
1235 | } | 1242 | } |
1236 | } | 1243 | } |
1244 | if (!ext || !fixed) | ||
1245 | return; | ||
1237 | if (!(get_wcaps(codec, ext) & AC_WCAP_UNSOL_CAP)) | 1246 | if (!(get_wcaps(codec, ext) & AC_WCAP_UNSOL_CAP)) |
1238 | return; /* no unsol support */ | 1247 | return; /* no unsol support */ |
1239 | snd_printdd("realtek: Enable auto-mic switch on NID 0x%x/0x%x\n", | 1248 | snd_printdd("realtek: Enable auto-mic switch on NID 0x%x/0x%x\n", |
@@ -4917,6 +4926,49 @@ static void fixup_automic_adc(struct hda_codec *codec) | |||
4917 | spec->auto_mic = 0; /* disable auto-mic to be sure */ | 4926 | spec->auto_mic = 0; /* disable auto-mic to be sure */ |
4918 | } | 4927 | } |
4919 | 4928 | ||
4929 | /* choose the ADC/MUX containing the input pin and initialize the setup */ | ||
4930 | static void fixup_single_adc(struct hda_codec *codec) | ||
4931 | { | ||
4932 | struct alc_spec *spec = codec->spec; | ||
4933 | hda_nid_t pin; | ||
4934 | int i; | ||
4935 | |||
4936 | /* search for the input pin; there must be only one */ | ||
4937 | for (i = 0; i < AUTO_PIN_LAST; i++) { | ||
4938 | if (spec->autocfg.input_pins[i]) { | ||
4939 | pin = spec->autocfg.input_pins[i]; | ||
4940 | break; | ||
4941 | } | ||
4942 | } | ||
4943 | if (!pin) | ||
4944 | return; | ||
4945 | |||
4946 | /* set the default connection to that pin */ | ||
4947 | for (i = 0; i < spec->num_adc_nids; i++) { | ||
4948 | hda_nid_t cap = spec->capsrc_nids ? | ||
4949 | spec->capsrc_nids[i] : spec->adc_nids[i]; | ||
4950 | int idx; | ||
4951 | |||
4952 | idx = get_connection_index(codec, cap, pin); | ||
4953 | if (idx < 0) | ||
4954 | continue; | ||
4955 | /* use only this ADC */ | ||
4956 | if (spec->capsrc_nids) | ||
4957 | spec->capsrc_nids += i; | ||
4958 | spec->adc_nids += i; | ||
4959 | spec->num_adc_nids = 1; | ||
4960 | /* select or unmute this route */ | ||
4961 | if (get_wcaps_type(get_wcaps(codec, cap)) == AC_WID_AUD_MIX) { | ||
4962 | snd_hda_codec_amp_stereo(codec, cap, HDA_INPUT, idx, | ||
4963 | HDA_AMP_MUTE, 0); | ||
4964 | } else { | ||
4965 | snd_hda_codec_write_cache(codec, cap, 0, | ||
4966 | AC_VERB_SET_CONNECT_SEL, idx); | ||
4967 | } | ||
4968 | return; | ||
4969 | } | ||
4970 | } | ||
4971 | |||
4920 | static void set_capture_mixer(struct hda_codec *codec) | 4972 | static void set_capture_mixer(struct hda_codec *codec) |
4921 | { | 4973 | { |
4922 | struct alc_spec *spec = codec->spec; | 4974 | struct alc_spec *spec = codec->spec; |
@@ -4929,14 +4981,15 @@ static void set_capture_mixer(struct hda_codec *codec) | |||
4929 | alc_capture_mixer3 }, | 4981 | alc_capture_mixer3 }, |
4930 | }; | 4982 | }; |
4931 | if (spec->num_adc_nids > 0 && spec->num_adc_nids <= 3) { | 4983 | if (spec->num_adc_nids > 0 && spec->num_adc_nids <= 3) { |
4932 | int mux; | 4984 | int mux = 0; |
4933 | if (spec->auto_mic) { | 4985 | if (spec->auto_mic) |
4934 | mux = 0; | ||
4935 | fixup_automic_adc(codec); | 4986 | fixup_automic_adc(codec); |
4936 | } else if (spec->input_mux && spec->input_mux->num_items > 1) | 4987 | else if (spec->input_mux) { |
4937 | mux = 1; | 4988 | if (spec->input_mux->num_items > 1) |
4938 | else | 4989 | mux = 1; |
4939 | mux = 0; | 4990 | else if (spec->input_mux->num_items == 1) |
4991 | fixup_single_adc(codec); | ||
4992 | } | ||
4940 | spec->cap_mixer = caps[mux][spec->num_adc_nids - 1]; | 4993 | spec->cap_mixer = caps[mux][spec->num_adc_nids - 1]; |
4941 | } | 4994 | } |
4942 | } | 4995 | } |
@@ -7201,8 +7254,8 @@ static struct snd_kcontrol_new alc885_mb5_mixer[] = { | |||
7201 | HDA_BIND_MUTE ("Surround Playback Switch", 0x0d, 0x02, HDA_INPUT), | 7254 | HDA_BIND_MUTE ("Surround Playback Switch", 0x0d, 0x02, HDA_INPUT), |
7202 | HDA_CODEC_VOLUME("LFE Playback Volume", 0x0e, 0x00, HDA_OUTPUT), | 7255 | HDA_CODEC_VOLUME("LFE Playback Volume", 0x0e, 0x00, HDA_OUTPUT), |
7203 | HDA_BIND_MUTE ("LFE Playback Switch", 0x0e, 0x02, HDA_INPUT), | 7256 | HDA_BIND_MUTE ("LFE Playback Switch", 0x0e, 0x02, HDA_INPUT), |
7204 | HDA_CODEC_VOLUME("HP Playback Volume", 0x0f, 0x00, HDA_OUTPUT), | 7257 | HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0f, 0x00, HDA_OUTPUT), |
7205 | HDA_BIND_MUTE ("HP Playback Switch", 0x0f, 0x02, HDA_INPUT), | 7258 | HDA_BIND_MUTE ("Headphone Playback Switch", 0x0f, 0x02, HDA_INPUT), |
7206 | HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT), | 7259 | HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT), |
7207 | HDA_CODEC_MUTE ("Line Playback Switch", 0x0b, 0x02, HDA_INPUT), | 7260 | HDA_CODEC_MUTE ("Line Playback Switch", 0x0b, 0x02, HDA_INPUT), |
7208 | HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x01, HDA_INPUT), | 7261 | HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x01, HDA_INPUT), |
@@ -7603,6 +7656,7 @@ static struct hda_verb alc885_mb5_init_verbs[] = { | |||
7603 | {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, | 7656 | {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, |
7604 | {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | 7657 | {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, |
7605 | {0x14, AC_VERB_SET_CONNECT_SEL, 0x03}, | 7658 | {0x14, AC_VERB_SET_CONNECT_SEL, 0x03}, |
7659 | {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN}, | ||
7606 | /* Front Mic pin: input vref at 80% */ | 7660 | /* Front Mic pin: input vref at 80% */ |
7607 | {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, | 7661 | {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, |
7608 | {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, | 7662 | {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, |
@@ -7787,6 +7841,27 @@ static void alc885_mbp3_setup(struct hda_codec *codec) | |||
7787 | spec->autocfg.speaker_pins[0] = 0x14; | 7841 | spec->autocfg.speaker_pins[0] = 0x14; |
7788 | } | 7842 | } |
7789 | 7843 | ||
7844 | static void alc885_mb5_automute(struct hda_codec *codec) | ||
7845 | { | ||
7846 | unsigned int present; | ||
7847 | |||
7848 | present = snd_hda_codec_read(codec, 0x14, 0, | ||
7849 | AC_VERB_GET_PIN_SENSE, 0) & 0x80000000; | ||
7850 | snd_hda_codec_amp_stereo(codec, 0x18, HDA_OUTPUT, 0, | ||
7851 | HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0); | ||
7852 | snd_hda_codec_amp_stereo(codec, 0x1a, HDA_OUTPUT, 0, | ||
7853 | HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0); | ||
7854 | |||
7855 | } | ||
7856 | |||
7857 | static void alc885_mb5_unsol_event(struct hda_codec *codec, | ||
7858 | unsigned int res) | ||
7859 | { | ||
7860 | /* Headphone insertion or removal. */ | ||
7861 | if ((res >> 26) == ALC880_HP_EVENT) | ||
7862 | alc885_mb5_automute(codec); | ||
7863 | } | ||
7864 | |||
7790 | static void alc885_imac91_automute(struct hda_codec *codec) | 7865 | static void alc885_imac91_automute(struct hda_codec *codec) |
7791 | { | 7866 | { |
7792 | unsigned int present; | 7867 | unsigned int present; |
@@ -9233,6 +9308,8 @@ static struct alc_config_preset alc882_presets[] = { | |||
9233 | .input_mux = &mb5_capture_source, | 9308 | .input_mux = &mb5_capture_source, |
9234 | .dig_out_nid = ALC882_DIGOUT_NID, | 9309 | .dig_out_nid = ALC882_DIGOUT_NID, |
9235 | .dig_in_nid = ALC882_DIGIN_NID, | 9310 | .dig_in_nid = ALC882_DIGIN_NID, |
9311 | .unsol_event = alc885_mb5_unsol_event, | ||
9312 | .init_hook = alc885_mb5_automute, | ||
9236 | }, | 9313 | }, |
9237 | [ALC885_MACPRO] = { | 9314 | [ALC885_MACPRO] = { |
9238 | .mixers = { alc882_macpro_mixer }, | 9315 | .mixers = { alc882_macpro_mixer }, |
@@ -9510,6 +9587,7 @@ static struct alc_config_preset alc882_presets[] = { | |||
9510 | .num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_modes), | 9587 | .num_channel_mode = ARRAY_SIZE(alc883_3ST_6ch_modes), |
9511 | .channel_mode = alc883_3ST_6ch_modes, | 9588 | .channel_mode = alc883_3ST_6ch_modes, |
9512 | .need_dac_fix = 1, | 9589 | .need_dac_fix = 1, |
9590 | .const_channel_count = 6, | ||
9513 | .num_mux_defs = | 9591 | .num_mux_defs = |
9514 | ARRAY_SIZE(alc888_2_capture_sources), | 9592 | ARRAY_SIZE(alc888_2_capture_sources), |
9515 | .input_mux = alc888_2_capture_sources, | 9593 | .input_mux = alc888_2_capture_sources, |
@@ -10420,7 +10498,7 @@ static void alc262_hp_t5735_setup(struct hda_codec *codec) | |||
10420 | struct alc_spec *spec = codec->spec; | 10498 | struct alc_spec *spec = codec->spec; |
10421 | 10499 | ||
10422 | spec->autocfg.hp_pins[0] = 0x15; | 10500 | spec->autocfg.hp_pins[0] = 0x15; |
10423 | spec->autocfg.speaker_pins[0] = 0x0c; /* HACK: not actually a pin */ | 10501 | spec->autocfg.speaker_pins[0] = 0x14; |
10424 | } | 10502 | } |
10425 | 10503 | ||
10426 | static struct snd_kcontrol_new alc262_hp_t5735_mixer[] = { | 10504 | static struct snd_kcontrol_new alc262_hp_t5735_mixer[] = { |
@@ -11310,7 +11388,7 @@ static int alc262_auto_create_multi_out_ctls(struct alc_spec *spec, | |||
11310 | } | 11388 | } |
11311 | 11389 | ||
11312 | #define alc262_auto_create_input_ctls \ | 11390 | #define alc262_auto_create_input_ctls \ |
11313 | alc880_auto_create_input_ctls | 11391 | alc882_auto_create_input_ctls |
11314 | 11392 | ||
11315 | /* | 11393 | /* |
11316 | * generic initialization of ADC, input mixers and output mixers | 11394 | * generic initialization of ADC, input mixers and output mixers |
@@ -11849,9 +11927,9 @@ static struct alc_config_preset alc262_presets[] = { | |||
11849 | .num_channel_mode = ARRAY_SIZE(alc262_modes), | 11927 | .num_channel_mode = ARRAY_SIZE(alc262_modes), |
11850 | .channel_mode = alc262_modes, | 11928 | .channel_mode = alc262_modes, |
11851 | .input_mux = &alc262_capture_source, | 11929 | .input_mux = &alc262_capture_source, |
11852 | .unsol_event = alc_automute_amp_unsol_event, | 11930 | .unsol_event = alc_sku_unsol_event, |
11853 | .setup = alc262_hp_t5735_setup, | 11931 | .setup = alc262_hp_t5735_setup, |
11854 | .init_hook = alc_automute_amp, | 11932 | .init_hook = alc_inithook, |
11855 | }, | 11933 | }, |
11856 | [ALC262_HP_RP5700] = { | 11934 | [ALC262_HP_RP5700] = { |
11857 | .mixers = { alc262_hp_rp5700_mixer }, | 11935 | .mixers = { alc262_hp_rp5700_mixer }, |
@@ -12605,6 +12683,7 @@ static int alc268_new_analog_output(struct alc_spec *spec, hda_nid_t nid, | |||
12605 | dac = 0x02; | 12683 | dac = 0x02; |
12606 | break; | 12684 | break; |
12607 | case 0x15: | 12685 | case 0x15: |
12686 | case 0x21: | ||
12608 | dac = 0x03; | 12687 | dac = 0x03; |
12609 | break; | 12688 | break; |
12610 | default: | 12689 | default: |
@@ -14991,6 +15070,8 @@ static int patch_alc861(struct hda_codec *codec) | |||
14991 | spec->stream_digital_playback = &alc861_pcm_digital_playback; | 15070 | spec->stream_digital_playback = &alc861_pcm_digital_playback; |
14992 | spec->stream_digital_capture = &alc861_pcm_digital_capture; | 15071 | spec->stream_digital_capture = &alc861_pcm_digital_capture; |
14993 | 15072 | ||
15073 | if (!spec->cap_mixer) | ||
15074 | set_capture_mixer(codec); | ||
14994 | set_beep_amp(spec, 0x23, 0, HDA_OUTPUT); | 15075 | set_beep_amp(spec, 0x23, 0, HDA_OUTPUT); |
14995 | 15076 | ||
14996 | spec->vmaster_nid = 0x03; | 15077 | spec->vmaster_nid = 0x03; |
@@ -15633,7 +15714,7 @@ static struct alc_config_preset alc861vd_presets[] = { | |||
15633 | static int alc861vd_auto_create_input_ctls(struct hda_codec *codec, | 15714 | static int alc861vd_auto_create_input_ctls(struct hda_codec *codec, |
15634 | const struct auto_pin_cfg *cfg) | 15715 | const struct auto_pin_cfg *cfg) |
15635 | { | 15716 | { |
15636 | return alc_auto_create_input_ctls(codec, cfg, 0x15, 0x09, 0); | 15717 | return alc_auto_create_input_ctls(codec, cfg, 0x15, 0x22, 0); |
15637 | } | 15718 | } |
15638 | 15719 | ||
15639 | 15720 | ||
@@ -17391,7 +17472,7 @@ static struct snd_pci_quirk alc662_cfg_tbl[] = { | |||
17391 | SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_ECS), | 17472 | SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_ECS), |
17392 | SND_PCI_QUIRK(0x105b, 0x0d47, "Foxconn 45CMX/45GMX/45CMX-K", | 17473 | SND_PCI_QUIRK(0x105b, 0x0d47, "Foxconn 45CMX/45GMX/45CMX-K", |
17393 | ALC662_3ST_6ch_DIG), | 17474 | ALC662_3ST_6ch_DIG), |
17394 | SND_PCI_QUIRK(0x1179, 0xff6e, "Toshiba NB200", ALC663_ASUS_MODE4), | 17475 | SND_PCI_QUIRK(0x1179, 0xff6e, "Toshiba NB20x", ALC662_AUTO), |
17395 | SND_PCI_QUIRK(0x144d, 0xca00, "Samsung NC10", ALC272_SAMSUNG_NC10), | 17476 | SND_PCI_QUIRK(0x144d, 0xca00, "Samsung NC10", ALC272_SAMSUNG_NC10), |
17396 | SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte 945GCM-S2L", | 17477 | SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte 945GCM-S2L", |
17397 | ALC662_3ST_6ch_DIG), | 17478 | ALC662_3ST_6ch_DIG), |
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 117919aa17f4..dbffb5b5c69d 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -4737,6 +4737,26 @@ static void stac92xx_unsol_event(struct hda_codec *codec, unsigned int res) | |||
4737 | } | 4737 | } |
4738 | } | 4738 | } |
4739 | 4739 | ||
4740 | static int hp_blike_system(u32 subsystem_id); | ||
4741 | |||
4742 | static void set_hp_led_gpio(struct hda_codec *codec) | ||
4743 | { | ||
4744 | struct sigmatel_spec *spec = codec->spec; | ||
4745 | switch (codec->vendor_id) { | ||
4746 | case 0x111d7608: | ||
4747 | /* GPIO 0 */ | ||
4748 | spec->gpio_led = 0x01; | ||
4749 | break; | ||
4750 | case 0x111d7600: | ||
4751 | case 0x111d7601: | ||
4752 | case 0x111d7602: | ||
4753 | case 0x111d7603: | ||
4754 | /* GPIO 3 */ | ||
4755 | spec->gpio_led = 0x08; | ||
4756 | break; | ||
4757 | } | ||
4758 | } | ||
4759 | |||
4740 | /* | 4760 | /* |
4741 | * This method searches for the mute LED GPIO configuration | 4761 | * This method searches for the mute LED GPIO configuration |
4742 | * provided as OEM string in SMBIOS. The format of that string | 4762 | * provided as OEM string in SMBIOS. The format of that string |
@@ -4748,6 +4768,14 @@ static void stac92xx_unsol_event(struct hda_codec *codec, unsigned int res) | |||
4748 | * | 4768 | * |
4749 | * So, HP B-series like systems may have HP_Mute_LED_0 (current models) | 4769 | * So, HP B-series like systems may have HP_Mute_LED_0 (current models) |
4750 | * or HP_Mute_LED_0_3 (future models) OEM SMBIOS strings | 4770 | * or HP_Mute_LED_0_3 (future models) OEM SMBIOS strings |
4771 | * | ||
4772 | * | ||
4773 | * The dv-series laptops don't seem to have the HP_Mute_LED* strings in | ||
4774 | * SMBIOS - at least the ones I have seen do not have them - which include | ||
4775 | * my own system (HP Pavilion dv6-1110ax) and my cousin's | ||
4776 | * HP Pavilion dv9500t CTO. | ||
4777 | * Need more information on whether it is true across the entire series. | ||
4778 | * -- kunal | ||
4751 | */ | 4779 | */ |
4752 | static int find_mute_led_gpio(struct hda_codec *codec) | 4780 | static int find_mute_led_gpio(struct hda_codec *codec) |
4753 | { | 4781 | { |
@@ -4758,28 +4786,27 @@ static int find_mute_led_gpio(struct hda_codec *codec) | |||
4758 | while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, | 4786 | while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, |
4759 | NULL, dev))) { | 4787 | NULL, dev))) { |
4760 | if (sscanf(dev->name, "HP_Mute_LED_%d_%d", | 4788 | if (sscanf(dev->name, "HP_Mute_LED_%d_%d", |
4761 | &spec->gpio_led_polarity, | 4789 | &spec->gpio_led_polarity, |
4762 | &spec->gpio_led) == 2) { | 4790 | &spec->gpio_led) == 2) { |
4763 | spec->gpio_led = 1 << spec->gpio_led; | 4791 | spec->gpio_led = 1 << spec->gpio_led; |
4764 | return 1; | 4792 | return 1; |
4765 | } | 4793 | } |
4766 | if (sscanf(dev->name, "HP_Mute_LED_%d", | 4794 | if (sscanf(dev->name, "HP_Mute_LED_%d", |
4767 | &spec->gpio_led_polarity) == 1) { | 4795 | &spec->gpio_led_polarity) == 1) { |
4768 | switch (codec->vendor_id) { | 4796 | set_hp_led_gpio(codec); |
4769 | case 0x111d7608: | 4797 | return 1; |
4770 | /* GPIO 0 */ | ||
4771 | spec->gpio_led = 0x01; | ||
4772 | return 1; | ||
4773 | case 0x111d7600: | ||
4774 | case 0x111d7601: | ||
4775 | case 0x111d7602: | ||
4776 | case 0x111d7603: | ||
4777 | /* GPIO 3 */ | ||
4778 | spec->gpio_led = 0x08; | ||
4779 | return 1; | ||
4780 | } | ||
4781 | } | 4798 | } |
4782 | } | 4799 | } |
4800 | |||
4801 | /* | ||
4802 | * Fallback case - if we don't find the DMI strings, | ||
4803 | * we statically set the GPIO - if not a B-series system. | ||
4804 | */ | ||
4805 | if (!hp_blike_system(codec->subsystem_id)) { | ||
4806 | set_hp_led_gpio(codec); | ||
4807 | spec->gpio_led_polarity = 1; | ||
4808 | return 1; | ||
4809 | } | ||
4783 | } | 4810 | } |
4784 | return 0; | 4811 | return 0; |
4785 | } | 4812 | } |
@@ -5603,6 +5630,8 @@ again: | |||
5603 | spec->num_dmuxes = ARRAY_SIZE(stac92hd71bxx_dmux_nids); | 5630 | spec->num_dmuxes = ARRAY_SIZE(stac92hd71bxx_dmux_nids); |
5604 | spec->num_smuxes = stac92hd71bxx_connected_smuxes(codec, 0x1e); | 5631 | spec->num_smuxes = stac92hd71bxx_connected_smuxes(codec, 0x1e); |
5605 | 5632 | ||
5633 | snd_printdd("Found board config: %d\n", spec->board_config); | ||
5634 | |||
5606 | switch (spec->board_config) { | 5635 | switch (spec->board_config) { |
5607 | case STAC_HP_M4: | 5636 | case STAC_HP_M4: |
5608 | /* enable internal microphone */ | 5637 | /* enable internal microphone */ |
diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c index bb08a2855fce..960a227eb653 100644 --- a/sound/pci/riptide/riptide.c +++ b/sound/pci/riptide/riptide.c | |||
@@ -1058,7 +1058,7 @@ setsamplerate(struct cmdif *cif, unsigned char *intdec, unsigned int rate) | |||
1058 | rptr.retwords[2] != M && | 1058 | rptr.retwords[2] != M && |
1059 | rptr.retwords[3] != N && | 1059 | rptr.retwords[3] != N && |
1060 | i++ < MAX_WRITE_RETRY); | 1060 | i++ < MAX_WRITE_RETRY); |
1061 | if (i == MAX_WRITE_RETRY) { | 1061 | if (i > MAX_WRITE_RETRY) { |
1062 | snd_printdd("sent samplerate %d: %d failed\n", | 1062 | snd_printdd("sent samplerate %d: %d failed\n", |
1063 | *intdec, rate); | 1063 | *intdec, rate); |
1064 | return -EIO; | 1064 | return -EIO; |