aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
Diffstat (limited to 'sound')
-rw-r--r--sound/core/pcm.c6
-rw-r--r--sound/core/pcm_native.c4
-rw-r--r--sound/oss/sound_timer.c2
-rw-r--r--sound/pci/asihpi/hpi6205.c7
-rw-r--r--sound/pci/emu10k1/emu10k1.c4
-rw-r--r--sound/pci/emu10k1/emupcm.c30
-rw-r--r--sound/pci/emu10k1/memory.c4
-rw-r--r--sound/pci/hda/hda_codec.c33
-rw-r--r--sound/pci/hda/hda_codec.h2
-rw-r--r--sound/pci/hda/hda_eld.c4
-rw-r--r--sound/pci/hda/patch_conexant.c2
-rw-r--r--sound/pci/hda/patch_hdmi.c21
-rw-r--r--sound/pci/hda/patch_intelhdmi.c8
-rw-r--r--sound/pci/hda/patch_nvhdmi.c8
-rw-r--r--sound/pci/hda/patch_realtek.c177
-rw-r--r--sound/pci/hda/patch_sigmatel.c15
-rw-r--r--sound/pci/intel8x0.c6
-rw-r--r--sound/pci/riptide/riptide.c11
18 files changed, 246 insertions, 98 deletions
diff --git a/sound/core/pcm.c b/sound/core/pcm.c
index cbe815dfbdc8..204af48c5cc1 100644
--- a/sound/core/pcm.c
+++ b/sound/core/pcm.c
@@ -203,10 +203,16 @@ static char *snd_pcm_format_names[] = {
203 FORMAT(S18_3BE), 203 FORMAT(S18_3BE),
204 FORMAT(U18_3LE), 204 FORMAT(U18_3LE),
205 FORMAT(U18_3BE), 205 FORMAT(U18_3BE),
206 FORMAT(G723_24),
207 FORMAT(G723_24_1B),
208 FORMAT(G723_40),
209 FORMAT(G723_40_1B),
206}; 210};
207 211
208const char *snd_pcm_format_name(snd_pcm_format_t format) 212const char *snd_pcm_format_name(snd_pcm_format_t format)
209{ 213{
214 if (format >= ARRAY_SIZE(snd_pcm_format_names))
215 return "Unknown";
210 return snd_pcm_format_names[format]; 216 return snd_pcm_format_names[format];
211} 217}
212EXPORT_SYMBOL_GPL(snd_pcm_format_name); 218EXPORT_SYMBOL_GPL(snd_pcm_format_name);
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index a3b2a6479246..134fc6c2e08d 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -978,6 +978,10 @@ static int snd_pcm_do_pause(struct snd_pcm_substream *substream, int push)
978{ 978{
979 if (substream->runtime->trigger_master != substream) 979 if (substream->runtime->trigger_master != substream)
980 return 0; 980 return 0;
981 /* some drivers might use hw_ptr to recover from the pause -
982 update the hw_ptr now */
983 if (push)
984 snd_pcm_update_hw_ptr(substream);
981 /* The jiffies check in snd_pcm_update_hw_ptr*() is done by 985 /* The jiffies check in snd_pcm_update_hw_ptr*() is done by
982 * a delta betwen the current jiffies, this gives a large enough 986 * a delta betwen the current jiffies, this gives a large enough
983 * delta, effectively to skip the check once. 987 * delta, effectively to skip the check once.
diff --git a/sound/oss/sound_timer.c b/sound/oss/sound_timer.c
index f0f0c19fbff7..48cda6c4c257 100644
--- a/sound/oss/sound_timer.c
+++ b/sound/oss/sound_timer.c
@@ -26,7 +26,7 @@ static unsigned long prev_event_time;
26static volatile unsigned long usecs_per_tmr; /* Length of the current interval */ 26static volatile unsigned long usecs_per_tmr; /* Length of the current interval */
27 27
28static struct sound_lowlev_timer *tmr; 28static struct sound_lowlev_timer *tmr;
29static spinlock_t lock; 29static DEFINE_SPINLOCK(lock);
30 30
31static unsigned long tmr2ticks(int tmr_value) 31static unsigned long tmr2ticks(int tmr_value)
32{ 32{
diff --git a/sound/pci/asihpi/hpi6205.c b/sound/pci/asihpi/hpi6205.c
index 3b4413448226..22c5fc625533 100644
--- a/sound/pci/asihpi/hpi6205.c
+++ b/sound/pci/asihpi/hpi6205.c
@@ -941,8 +941,7 @@ static void outstream_host_buffer_free(struct hpi_adapter_obj *pao,
941 941
942} 942}
943 943
944static u32 outstream_get_space_available(struct hpi_hostbuffer_status 944static u32 outstream_get_space_available(struct hpi_hostbuffer_status *status)
945 *status)
946{ 945{
947 return status->size_in_bytes - (status->host_index - 946 return status->size_in_bytes - (status->host_index -
948 status->dSP_index); 947 status->dSP_index);
@@ -987,6 +986,10 @@ static void outstream_write(struct hpi_adapter_obj *pao,
987 /* write it */ 986 /* write it */
988 phm->function = HPI_OSTREAM_WRITE; 987 phm->function = HPI_OSTREAM_WRITE;
989 hw_message(pao, phm, phr); 988 hw_message(pao, phm, phr);
989
990 if (phr->error)
991 return;
992
990 /* update status information that the DSP would typically 993 /* update status information that the DSP would typically
991 * update (and will update next time the DSP 994 * update (and will update next time the DSP
992 * buffer update task reads data from the host BBM buffer) 995 * buffer update task reads data from the host BBM buffer)
diff --git a/sound/pci/emu10k1/emu10k1.c b/sound/pci/emu10k1/emu10k1.c
index 4203782d7cb7..aff8387c45cf 100644
--- a/sound/pci/emu10k1/emu10k1.c
+++ b/sound/pci/emu10k1/emu10k1.c
@@ -52,6 +52,7 @@ static int max_synth_voices[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 64};
52static int max_buffer_size[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 128}; 52static int max_buffer_size[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 128};
53static int enable_ir[SNDRV_CARDS]; 53static int enable_ir[SNDRV_CARDS];
54static uint subsystem[SNDRV_CARDS]; /* Force card subsystem model */ 54static uint subsystem[SNDRV_CARDS]; /* Force card subsystem model */
55static uint delay_pcm_irq[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2};
55 56
56module_param_array(index, int, NULL, 0444); 57module_param_array(index, int, NULL, 0444);
57MODULE_PARM_DESC(index, "Index value for the EMU10K1 soundcard."); 58MODULE_PARM_DESC(index, "Index value for the EMU10K1 soundcard.");
@@ -73,6 +74,8 @@ module_param_array(enable_ir, bool, NULL, 0444);
73MODULE_PARM_DESC(enable_ir, "Enable IR."); 74MODULE_PARM_DESC(enable_ir, "Enable IR.");
74module_param_array(subsystem, uint, NULL, 0444); 75module_param_array(subsystem, uint, NULL, 0444);
75MODULE_PARM_DESC(subsystem, "Force card subsystem model."); 76MODULE_PARM_DESC(subsystem, "Force card subsystem model.");
77module_param_array(delay_pcm_irq, uint, NULL, 0444);
78MODULE_PARM_DESC(delay_pcm_irq, "Delay PCM interrupt by specified number of samples (default 0).");
76/* 79/*
77 * Class 0401: 1102:0008 (rev 00) Subsystem: 1102:1001 -> Audigy2 Value Model:SB0400 80 * Class 0401: 1102:0008 (rev 00) Subsystem: 1102:1001 -> Audigy2 Value Model:SB0400
78 */ 81 */
@@ -127,6 +130,7 @@ static int __devinit snd_card_emu10k1_probe(struct pci_dev *pci,
127 &emu)) < 0) 130 &emu)) < 0)
128 goto error; 131 goto error;
129 card->private_data = emu; 132 card->private_data = emu;
133 emu->delay_pcm_irq = delay_pcm_irq[dev] & 0x1f;
130 if ((err = snd_emu10k1_pcm(emu, 0, NULL)) < 0) 134 if ((err = snd_emu10k1_pcm(emu, 0, NULL)) < 0)
131 goto error; 135 goto error;
132 if ((err = snd_emu10k1_pcm_mic(emu, 1, NULL)) < 0) 136 if ((err = snd_emu10k1_pcm_mic(emu, 1, NULL)) < 0)
diff --git a/sound/pci/emu10k1/emupcm.c b/sound/pci/emu10k1/emupcm.c
index 55b83ef73c63..622bace148e3 100644
--- a/sound/pci/emu10k1/emupcm.c
+++ b/sound/pci/emu10k1/emupcm.c
@@ -332,7 +332,7 @@ static void snd_emu10k1_pcm_init_voice(struct snd_emu10k1 *emu,
332 evoice->epcm->ccca_start_addr = start_addr + ccis; 332 evoice->epcm->ccca_start_addr = start_addr + ccis;
333 if (extra) { 333 if (extra) {
334 start_addr += ccis; 334 start_addr += ccis;
335 end_addr += ccis; 335 end_addr += ccis + emu->delay_pcm_irq;
336 } 336 }
337 if (stereo && !extra) { 337 if (stereo && !extra) {
338 snd_emu10k1_ptr_write(emu, CPF, voice, CPF_STEREO_MASK); 338 snd_emu10k1_ptr_write(emu, CPF, voice, CPF_STEREO_MASK);
@@ -360,7 +360,9 @@ static void snd_emu10k1_pcm_init_voice(struct snd_emu10k1 *emu,
360 /* Assumption that PT is already 0 so no harm overwriting */ 360 /* Assumption that PT is already 0 so no harm overwriting */
361 snd_emu10k1_ptr_write(emu, PTRX, voice, (send_amount[0] << 8) | send_amount[1]); 361 snd_emu10k1_ptr_write(emu, PTRX, voice, (send_amount[0] << 8) | send_amount[1]);
362 snd_emu10k1_ptr_write(emu, DSL, voice, end_addr | (send_amount[3] << 24)); 362 snd_emu10k1_ptr_write(emu, DSL, voice, end_addr | (send_amount[3] << 24));
363 snd_emu10k1_ptr_write(emu, PSST, voice, start_addr | (send_amount[2] << 24)); 363 snd_emu10k1_ptr_write(emu, PSST, voice,
364 (start_addr + (extra ? emu->delay_pcm_irq : 0)) |
365 (send_amount[2] << 24));
364 if (emu->card_capabilities->emu_model) 366 if (emu->card_capabilities->emu_model)
365 pitch_target = PITCH_48000; /* Disable interpolators on emu1010 card */ 367 pitch_target = PITCH_48000; /* Disable interpolators on emu1010 card */
366 else 368 else
@@ -732,6 +734,23 @@ static void snd_emu10k1_playback_stop_voice(struct snd_emu10k1 *emu, struct snd_
732 snd_emu10k1_ptr_write(emu, IP, voice, 0); 734 snd_emu10k1_ptr_write(emu, IP, voice, 0);
733} 735}
734 736
737static inline void snd_emu10k1_playback_mangle_extra(struct snd_emu10k1 *emu,
738 struct snd_emu10k1_pcm *epcm,
739 struct snd_pcm_substream *substream,
740 struct snd_pcm_runtime *runtime)
741{
742 unsigned int ptr, period_pos;
743
744 /* try to sychronize the current position for the interrupt
745 source voice */
746 period_pos = runtime->status->hw_ptr - runtime->hw_ptr_interrupt;
747 period_pos %= runtime->period_size;
748 ptr = snd_emu10k1_ptr_read(emu, CCCA, epcm->extra->number);
749 ptr &= ~0x00ffffff;
750 ptr |= epcm->ccca_start_addr + period_pos;
751 snd_emu10k1_ptr_write(emu, CCCA, epcm->extra->number, ptr);
752}
753
735static int snd_emu10k1_playback_trigger(struct snd_pcm_substream *substream, 754static int snd_emu10k1_playback_trigger(struct snd_pcm_substream *substream,
736 int cmd) 755 int cmd)
737{ 756{
@@ -753,6 +772,8 @@ static int snd_emu10k1_playback_trigger(struct snd_pcm_substream *substream,
753 /* follow thru */ 772 /* follow thru */
754 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 773 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
755 case SNDRV_PCM_TRIGGER_RESUME: 774 case SNDRV_PCM_TRIGGER_RESUME:
775 if (cmd == SNDRV_PCM_TRIGGER_PAUSE_RELEASE)
776 snd_emu10k1_playback_mangle_extra(emu, epcm, substream, runtime);
756 mix = &emu->pcm_mixer[substream->number]; 777 mix = &emu->pcm_mixer[substream->number];
757 snd_emu10k1_playback_prepare_voice(emu, epcm->voices[0], 1, 0, mix); 778 snd_emu10k1_playback_prepare_voice(emu, epcm->voices[0], 1, 0, mix);
758 snd_emu10k1_playback_prepare_voice(emu, epcm->voices[1], 0, 0, mix); 779 snd_emu10k1_playback_prepare_voice(emu, epcm->voices[1], 0, 0, mix);
@@ -869,8 +890,9 @@ static snd_pcm_uframes_t snd_emu10k1_playback_pointer(struct snd_pcm_substream *
869#endif 890#endif
870 /* 891 /*
871 printk(KERN_DEBUG 892 printk(KERN_DEBUG
872 "ptr = 0x%x, buffer_size = 0x%x, period_size = 0x%x\n", 893 "ptr = 0x%lx, buffer_size = 0x%lx, period_size = 0x%lx\n",
873 ptr, runtime->buffer_size, runtime->period_size); 894 (long)ptr, (long)runtime->buffer_size,
895 (long)runtime->period_size);
874 */ 896 */
875 return ptr; 897 return ptr;
876} 898}
diff --git a/sound/pci/emu10k1/memory.c b/sound/pci/emu10k1/memory.c
index ffb1ddb8dc28..957a311514c8 100644
--- a/sound/pci/emu10k1/memory.c
+++ b/sound/pci/emu10k1/memory.c
@@ -310,8 +310,10 @@ snd_emu10k1_alloc_pages(struct snd_emu10k1 *emu, struct snd_pcm_substream *subst
310 if (snd_BUG_ON(!hdr)) 310 if (snd_BUG_ON(!hdr))
311 return NULL; 311 return NULL;
312 312
313 idx = runtime->period_size >= runtime->buffer_size ?
314 (emu->delay_pcm_irq * 2) : 0;
313 mutex_lock(&hdr->block_mutex); 315 mutex_lock(&hdr->block_mutex);
314 blk = search_empty(emu, runtime->dma_bytes); 316 blk = search_empty(emu, runtime->dma_bytes + idx);
315 if (blk == NULL) { 317 if (blk == NULL) {
316 mutex_unlock(&hdr->block_mutex); 318 mutex_unlock(&hdr->block_mutex);
317 return NULL; 319 return NULL;
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index dd8fb86c842b..3827092cc1d2 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -589,6 +589,7 @@ int /*__devinit*/ snd_hda_bus_new(struct snd_card *card,
589 bus->ops = temp->ops; 589 bus->ops = temp->ops;
590 590
591 mutex_init(&bus->cmd_mutex); 591 mutex_init(&bus->cmd_mutex);
592 mutex_init(&bus->prepare_mutex);
592 INIT_LIST_HEAD(&bus->codec_list); 593 INIT_LIST_HEAD(&bus->codec_list);
593 594
594 snprintf(bus->workq_name, sizeof(bus->workq_name), 595 snprintf(bus->workq_name, sizeof(bus->workq_name),
@@ -1068,7 +1069,6 @@ int /*__devinit*/ snd_hda_codec_new(struct hda_bus *bus,
1068 codec->addr = codec_addr; 1069 codec->addr = codec_addr;
1069 mutex_init(&codec->spdif_mutex); 1070 mutex_init(&codec->spdif_mutex);
1070 mutex_init(&codec->control_mutex); 1071 mutex_init(&codec->control_mutex);
1071 mutex_init(&codec->prepare_mutex);
1072 init_hda_cache(&codec->amp_cache, sizeof(struct hda_amp_info)); 1072 init_hda_cache(&codec->amp_cache, sizeof(struct hda_amp_info));
1073 init_hda_cache(&codec->cmd_cache, sizeof(struct hda_cache_head)); 1073 init_hda_cache(&codec->cmd_cache, sizeof(struct hda_cache_head));
1074 snd_array_init(&codec->mixers, sizeof(struct hda_nid_item), 32); 1074 snd_array_init(&codec->mixers, sizeof(struct hda_nid_item), 32);
@@ -1213,6 +1213,7 @@ void snd_hda_codec_setup_stream(struct hda_codec *codec, hda_nid_t nid,
1213 u32 stream_tag, 1213 u32 stream_tag,
1214 int channel_id, int format) 1214 int channel_id, int format)
1215{ 1215{
1216 struct hda_codec *c;
1216 struct hda_cvt_setup *p; 1217 struct hda_cvt_setup *p;
1217 unsigned int oldval, newval; 1218 unsigned int oldval, newval;
1218 int i; 1219 int i;
@@ -1253,10 +1254,12 @@ void snd_hda_codec_setup_stream(struct hda_codec *codec, hda_nid_t nid,
1253 p->dirty = 0; 1254 p->dirty = 0;
1254 1255
1255 /* make other inactive cvts with the same stream-tag dirty */ 1256 /* make other inactive cvts with the same stream-tag dirty */
1256 for (i = 0; i < codec->cvt_setups.used; i++) { 1257 list_for_each_entry(c, &codec->bus->codec_list, list) {
1257 p = snd_array_elem(&codec->cvt_setups, i); 1258 for (i = 0; i < c->cvt_setups.used; i++) {
1258 if (!p->active && p->stream_tag == stream_tag) 1259 p = snd_array_elem(&c->cvt_setups, i);
1259 p->dirty = 1; 1260 if (!p->active && p->stream_tag == stream_tag)
1261 p->dirty = 1;
1262 }
1260 } 1263 }
1261} 1264}
1262EXPORT_SYMBOL_HDA(snd_hda_codec_setup_stream); 1265EXPORT_SYMBOL_HDA(snd_hda_codec_setup_stream);
@@ -1306,12 +1309,16 @@ static void really_cleanup_stream(struct hda_codec *codec,
1306/* clean up the all conflicting obsolete streams */ 1309/* clean up the all conflicting obsolete streams */
1307static void purify_inactive_streams(struct hda_codec *codec) 1310static void purify_inactive_streams(struct hda_codec *codec)
1308{ 1311{
1312 struct hda_codec *c;
1309 int i; 1313 int i;
1310 1314
1311 for (i = 0; i < codec->cvt_setups.used; i++) { 1315 list_for_each_entry(c, &codec->bus->codec_list, list) {
1312 struct hda_cvt_setup *p = snd_array_elem(&codec->cvt_setups, i); 1316 for (i = 0; i < c->cvt_setups.used; i++) {
1313 if (p->dirty) 1317 struct hda_cvt_setup *p;
1314 really_cleanup_stream(codec, p); 1318 p = snd_array_elem(&c->cvt_setups, i);
1319 if (p->dirty)
1320 really_cleanup_stream(c, p);
1321 }
1315 } 1322 }
1316} 1323}
1317 1324
@@ -3502,11 +3509,11 @@ int snd_hda_codec_prepare(struct hda_codec *codec,
3502 struct snd_pcm_substream *substream) 3509 struct snd_pcm_substream *substream)
3503{ 3510{
3504 int ret; 3511 int ret;
3505 mutex_lock(&codec->prepare_mutex); 3512 mutex_lock(&codec->bus->prepare_mutex);
3506 ret = hinfo->ops.prepare(hinfo, codec, stream, format, substream); 3513 ret = hinfo->ops.prepare(hinfo, codec, stream, format, substream);
3507 if (ret >= 0) 3514 if (ret >= 0)
3508 purify_inactive_streams(codec); 3515 purify_inactive_streams(codec);
3509 mutex_unlock(&codec->prepare_mutex); 3516 mutex_unlock(&codec->bus->prepare_mutex);
3510 return ret; 3517 return ret;
3511} 3518}
3512EXPORT_SYMBOL_HDA(snd_hda_codec_prepare); 3519EXPORT_SYMBOL_HDA(snd_hda_codec_prepare);
@@ -3515,9 +3522,9 @@ void snd_hda_codec_cleanup(struct hda_codec *codec,
3515 struct hda_pcm_stream *hinfo, 3522 struct hda_pcm_stream *hinfo,
3516 struct snd_pcm_substream *substream) 3523 struct snd_pcm_substream *substream)
3517{ 3524{
3518 mutex_lock(&codec->prepare_mutex); 3525 mutex_lock(&codec->bus->prepare_mutex);
3519 hinfo->ops.cleanup(hinfo, codec, substream); 3526 hinfo->ops.cleanup(hinfo, codec, substream);
3520 mutex_unlock(&codec->prepare_mutex); 3527 mutex_unlock(&codec->bus->prepare_mutex);
3521} 3528}
3522EXPORT_SYMBOL_HDA(snd_hda_codec_cleanup); 3529EXPORT_SYMBOL_HDA(snd_hda_codec_cleanup);
3523 3530
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h
index 4303353feda9..62c702240108 100644
--- a/sound/pci/hda/hda_codec.h
+++ b/sound/pci/hda/hda_codec.h
@@ -648,6 +648,7 @@ struct hda_bus {
648 struct hda_codec *caddr_tbl[HDA_MAX_CODEC_ADDRESS + 1]; 648 struct hda_codec *caddr_tbl[HDA_MAX_CODEC_ADDRESS + 1];
649 649
650 struct mutex cmd_mutex; 650 struct mutex cmd_mutex;
651 struct mutex prepare_mutex;
651 652
652 /* unsolicited event queue */ 653 /* unsolicited event queue */
653 struct hda_bus_unsolicited *unsol; 654 struct hda_bus_unsolicited *unsol;
@@ -826,7 +827,6 @@ struct hda_codec {
826 827
827 struct mutex spdif_mutex; 828 struct mutex spdif_mutex;
828 struct mutex control_mutex; 829 struct mutex control_mutex;
829 struct mutex prepare_mutex;
830 unsigned int spdif_status; /* IEC958 status bits */ 830 unsigned int spdif_status; /* IEC958 status bits */
831 unsigned short spdif_ctls; /* SPDIF control bits */ 831 unsigned short spdif_ctls; /* SPDIF control bits */
832 unsigned int spdif_in_enable; /* SPDIF input enable? */ 832 unsigned int spdif_in_enable; /* SPDIF input enable? */
diff --git a/sound/pci/hda/hda_eld.c b/sound/pci/hda/hda_eld.c
index 803b298f7411..26c3ade73583 100644
--- a/sound/pci/hda/hda_eld.c
+++ b/sound/pci/hda/hda_eld.c
@@ -596,6 +596,8 @@ void snd_hda_eld_proc_free(struct hda_codec *codec, struct hdmi_eld *eld)
596} 596}
597EXPORT_SYMBOL_HDA(snd_hda_eld_proc_free); 597EXPORT_SYMBOL_HDA(snd_hda_eld_proc_free);
598 598
599#endif /* CONFIG_PROC_FS */
600
599/* update PCM info based on ELD */ 601/* update PCM info based on ELD */
600void hdmi_eld_update_pcm_info(struct hdmi_eld *eld, struct hda_pcm_stream *pcm, 602void hdmi_eld_update_pcm_info(struct hdmi_eld *eld, struct hda_pcm_stream *pcm,
601 struct hda_pcm_stream *codec_pars) 603 struct hda_pcm_stream *codec_pars)
@@ -644,5 +646,3 @@ void hdmi_eld_update_pcm_info(struct hdmi_eld *eld, struct hda_pcm_stream *pcm,
644 pcm->maxbps = min(pcm->maxbps, codec_pars->maxbps); 646 pcm->maxbps = min(pcm->maxbps, codec_pars->maxbps);
645} 647}
646EXPORT_SYMBOL_HDA(hdmi_eld_update_pcm_info); 648EXPORT_SYMBOL_HDA(hdmi_eld_update_pcm_info);
647
648#endif /* CONFIG_PROC_FS */
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index 31b5d9eeba68..5cdb80edbd7f 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -3049,6 +3049,7 @@ static struct snd_pci_quirk cxt5066_cfg_tbl[] = {
3049 SND_PCI_QUIRK(0x1028, 0x02f5, "Dell", 3049 SND_PCI_QUIRK(0x1028, 0x02f5, "Dell",
3050 CXT5066_DELL_LAPTOP), 3050 CXT5066_DELL_LAPTOP),
3051 SND_PCI_QUIRK(0x152d, 0x0833, "OLPC XO-1.5", CXT5066_OLPC_XO_1_5), 3051 SND_PCI_QUIRK(0x152d, 0x0833, "OLPC XO-1.5", CXT5066_OLPC_XO_1_5),
3052 SND_PCI_QUIRK(0x1028, 0x02d8, "Dell Vostro", CXT5066_DELL_VOSTO),
3052 SND_PCI_QUIRK(0x1028, 0x0402, "Dell Vostro", CXT5066_DELL_VOSTO), 3053 SND_PCI_QUIRK(0x1028, 0x0402, "Dell Vostro", CXT5066_DELL_VOSTO),
3053 SND_PCI_QUIRK(0x1028, 0x0408, "Dell Inspiron One 19T", CXT5066_IDEAPAD), 3054 SND_PCI_QUIRK(0x1028, 0x0408, "Dell Inspiron One 19T", CXT5066_IDEAPAD),
3054 SND_PCI_QUIRK(0x1179, 0xff50, "Toshiba Satellite P500-PSPGSC-01800T", CXT5066_OLPC_XO_1_5), 3055 SND_PCI_QUIRK(0x1179, 0xff50, "Toshiba Satellite P500-PSPGSC-01800T", CXT5066_OLPC_XO_1_5),
@@ -3058,6 +3059,7 @@ static struct snd_pci_quirk cxt5066_cfg_tbl[] = {
3058 SND_PCI_QUIRK(0x17aa, 0x21b4, "Thinkpad Edge", CXT5066_IDEAPAD), 3059 SND_PCI_QUIRK(0x17aa, 0x21b4, "Thinkpad Edge", CXT5066_IDEAPAD),
3059 SND_PCI_QUIRK(0x17aa, 0x215e, "Lenovo Thinkpad", CXT5066_THINKPAD), 3060 SND_PCI_QUIRK(0x17aa, 0x215e, "Lenovo Thinkpad", CXT5066_THINKPAD),
3060 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo G series", CXT5066_IDEAPAD), 3061 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo G series", CXT5066_IDEAPAD),
3062 SND_PCI_QUIRK(0x17aa, 0x390a, "Lenovo S10-3t", CXT5066_IDEAPAD),
3061 SND_PCI_QUIRK(0x17aa, 0x3938, "Lenovo G series (AMD)", CXT5066_IDEAPAD), 3063 SND_PCI_QUIRK(0x17aa, 0x3938, "Lenovo G series (AMD)", CXT5066_IDEAPAD),
3062 SND_PCI_QUIRK(0x17aa, 0x3a0d, "ideapad", CXT5066_IDEAPAD), 3064 SND_PCI_QUIRK(0x17aa, 0x3a0d, "ideapad", CXT5066_IDEAPAD),
3063 {} 3065 {}
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 2bc0f07cf33f..afd6022a96a7 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -707,8 +707,6 @@ static int hdmi_setup_stream(struct hda_codec *codec, hda_nid_t nid,
707 u32 stream_tag, int format) 707 u32 stream_tag, int format)
708{ 708{
709 struct hdmi_spec *spec = codec->spec; 709 struct hdmi_spec *spec = codec->spec;
710 int tag;
711 int fmt;
712 int pinctl; 710 int pinctl;
713 int new_pinctl = 0; 711 int new_pinctl = 0;
714 int i; 712 int i;
@@ -745,24 +743,7 @@ static int hdmi_setup_stream(struct hda_codec *codec, hda_nid_t nid,
745 return -EINVAL; 743 return -EINVAL;
746 } 744 }
747 745
748 tag = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_CONV, 0) >> 4; 746 snd_hda_codec_setup_stream(codec, nid, stream_tag, 0, format);
749 fmt = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_STREAM_FORMAT, 0);
750
751 snd_printdd("hdmi_setup_stream: "
752 "NID=0x%x, %sstream=0x%x, %sformat=0x%x\n",
753 nid,
754 tag == stream_tag ? "" : "new-",
755 stream_tag,
756 fmt == format ? "" : "new-",
757 format);
758
759 if (tag != stream_tag)
760 snd_hda_codec_write(codec, nid, 0,
761 AC_VERB_SET_CHANNEL_STREAMID,
762 stream_tag << 4);
763 if (fmt != format)
764 snd_hda_codec_write(codec, nid, 0,
765 AC_VERB_SET_STREAM_FORMAT, format);
766 return 0; 747 return 0;
767} 748}
768 749
diff --git a/sound/pci/hda/patch_intelhdmi.c b/sound/pci/hda/patch_intelhdmi.c
index d382d3c81c0f..36a9b83a6174 100644
--- a/sound/pci/hda/patch_intelhdmi.c
+++ b/sound/pci/hda/patch_intelhdmi.c
@@ -69,20 +69,12 @@ static int intel_hdmi_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
69 return hdmi_setup_stream(codec, hinfo->nid, stream_tag, format); 69 return hdmi_setup_stream(codec, hinfo->nid, stream_tag, format);
70} 70}
71 71
72static int intel_hdmi_playback_pcm_cleanup(struct hda_pcm_stream *hinfo,
73 struct hda_codec *codec,
74 struct snd_pcm_substream *substream)
75{
76 return 0;
77}
78
79static struct hda_pcm_stream intel_hdmi_pcm_playback = { 72static struct hda_pcm_stream intel_hdmi_pcm_playback = {
80 .substreams = 1, 73 .substreams = 1,
81 .channels_min = 2, 74 .channels_min = 2,
82 .ops = { 75 .ops = {
83 .open = hdmi_pcm_open, 76 .open = hdmi_pcm_open,
84 .prepare = intel_hdmi_playback_pcm_prepare, 77 .prepare = intel_hdmi_playback_pcm_prepare,
85 .cleanup = intel_hdmi_playback_pcm_cleanup,
86 }, 78 },
87}; 79};
88 80
diff --git a/sound/pci/hda/patch_nvhdmi.c b/sound/pci/hda/patch_nvhdmi.c
index f636870dc718..69b950d527c3 100644
--- a/sound/pci/hda/patch_nvhdmi.c
+++ b/sound/pci/hda/patch_nvhdmi.c
@@ -326,13 +326,6 @@ static int nvhdmi_dig_playback_pcm_prepare_8ch(struct hda_pcm_stream *hinfo,
326 return 0; 326 return 0;
327} 327}
328 328
329static int nvhdmi_playback_pcm_cleanup(struct hda_pcm_stream *hinfo,
330 struct hda_codec *codec,
331 struct snd_pcm_substream *substream)
332{
333 return 0;
334}
335
336static int nvhdmi_dig_playback_pcm_prepare_2ch(struct hda_pcm_stream *hinfo, 329static int nvhdmi_dig_playback_pcm_prepare_2ch(struct hda_pcm_stream *hinfo,
337 struct hda_codec *codec, 330 struct hda_codec *codec,
338 unsigned int stream_tag, 331 unsigned int stream_tag,
@@ -350,7 +343,6 @@ static struct hda_pcm_stream nvhdmi_pcm_digital_playback_8ch_89 = {
350 .ops = { 343 .ops = {
351 .open = hdmi_pcm_open, 344 .open = hdmi_pcm_open,
352 .prepare = nvhdmi_dig_playback_pcm_prepare_8ch_89, 345 .prepare = nvhdmi_dig_playback_pcm_prepare_8ch_89,
353 .cleanup = nvhdmi_playback_pcm_cleanup,
354 }, 346 },
355}; 347};
356 348
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 2cd1ae809e46..627bf9963368 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -14467,6 +14467,7 @@ static const struct alc_fixup alc269_fixups[] = {
14467 14467
14468static struct snd_pci_quirk alc269_fixup_tbl[] = { 14468static struct snd_pci_quirk alc269_fixup_tbl[] = {
14469 SND_PCI_QUIRK(0x104d, 0x9071, "Sony VAIO", ALC269_FIXUP_SONY_VAIO), 14469 SND_PCI_QUIRK(0x104d, 0x9071, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
14470 SND_PCI_QUIRK(0x104d, 0x9077, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
14470 {} 14471 {}
14471}; 14472};
14472 14473
@@ -19030,6 +19031,7 @@ static int patch_alc888(struct hda_codec *codec)
19030/* 19031/*
19031 * ALC680 support 19032 * ALC680 support
19032 */ 19033 */
19034#define ALC680_DIGIN_NID ALC880_DIGIN_NID
19033#define ALC680_DIGOUT_NID ALC880_DIGOUT_NID 19035#define ALC680_DIGOUT_NID ALC880_DIGOUT_NID
19034#define alc680_modes alc260_modes 19036#define alc680_modes alc260_modes
19035 19037
@@ -19044,23 +19046,93 @@ static hda_nid_t alc680_adc_nids[3] = {
19044 0x07, 0x08, 0x09 19046 0x07, 0x08, 0x09
19045}; 19047};
19046 19048
19049/*
19050 * Analog capture ADC cgange
19051 */
19052static int alc680_capture_pcm_prepare(struct hda_pcm_stream *hinfo,
19053 struct hda_codec *codec,
19054 unsigned int stream_tag,
19055 unsigned int format,
19056 struct snd_pcm_substream *substream)
19057{
19058 struct alc_spec *spec = codec->spec;
19059 struct auto_pin_cfg *cfg = &spec->autocfg;
19060 unsigned int pre_mic, pre_line;
19061
19062 pre_mic = snd_hda_jack_detect(codec, cfg->input_pins[AUTO_PIN_MIC]);
19063 pre_line = snd_hda_jack_detect(codec, cfg->input_pins[AUTO_PIN_LINE]);
19064
19065 spec->cur_adc_stream_tag = stream_tag;
19066 spec->cur_adc_format = format;
19067
19068 if (pre_mic || pre_line) {
19069 if (pre_mic)
19070 snd_hda_codec_setup_stream(codec, 0x08, stream_tag, 0,
19071 format);
19072 else
19073 snd_hda_codec_setup_stream(codec, 0x09, stream_tag, 0,
19074 format);
19075 } else
19076 snd_hda_codec_setup_stream(codec, 0x07, stream_tag, 0, format);
19077 return 0;
19078}
19079
19080static int alc680_capture_pcm_cleanup(struct hda_pcm_stream *hinfo,
19081 struct hda_codec *codec,
19082 struct snd_pcm_substream *substream)
19083{
19084 snd_hda_codec_cleanup_stream(codec, 0x07);
19085 snd_hda_codec_cleanup_stream(codec, 0x08);
19086 snd_hda_codec_cleanup_stream(codec, 0x09);
19087 return 0;
19088}
19089
19090static struct hda_pcm_stream alc680_pcm_analog_auto_capture = {
19091 .substreams = 1, /* can be overridden */
19092 .channels_min = 2,
19093 .channels_max = 2,
19094 /* NID is set in alc_build_pcms */
19095 .ops = {
19096 .prepare = alc680_capture_pcm_prepare,
19097 .cleanup = alc680_capture_pcm_cleanup
19098 },
19099};
19100
19047static struct snd_kcontrol_new alc680_base_mixer[] = { 19101static struct snd_kcontrol_new alc680_base_mixer[] = {
19048 /* output mixer control */ 19102 /* output mixer control */
19049 HDA_CODEC_VOLUME("Front Playback Volume", 0x2, 0x0, HDA_OUTPUT), 19103 HDA_CODEC_VOLUME("Front Playback Volume", 0x2, 0x0, HDA_OUTPUT),
19050 HDA_CODEC_MUTE("Front Playback Switch", 0x14, 0x0, HDA_OUTPUT), 19104 HDA_CODEC_MUTE("Front Playback Switch", 0x14, 0x0, HDA_OUTPUT),
19051 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x4, 0x0, HDA_OUTPUT), 19105 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x4, 0x0, HDA_OUTPUT),
19052 HDA_CODEC_MUTE("Headphone Playback Switch", 0x16, 0x0, HDA_OUTPUT), 19106 HDA_CODEC_MUTE("Headphone Playback Switch", 0x16, 0x0, HDA_OUTPUT),
19107 HDA_CODEC_VOLUME("Int Mic Boost", 0x12, 0, HDA_INPUT),
19053 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT), 19108 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
19109 HDA_CODEC_VOLUME("Line In Boost", 0x19, 0, HDA_INPUT),
19054 { } 19110 { }
19055}; 19111};
19056 19112
19057static struct snd_kcontrol_new alc680_capture_mixer[] = { 19113static struct hda_bind_ctls alc680_bind_cap_vol = {
19058 HDA_CODEC_VOLUME("Capture Volume", 0x07, 0x0, HDA_INPUT), 19114 .ops = &snd_hda_bind_vol,
19059 HDA_CODEC_MUTE("Capture Switch", 0x07, 0x0, HDA_INPUT), 19115 .values = {
19060 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x08, 0x0, HDA_INPUT), 19116 HDA_COMPOSE_AMP_VAL(0x07, 3, 0, HDA_INPUT),
19061 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x08, 0x0, HDA_INPUT), 19117 HDA_COMPOSE_AMP_VAL(0x08, 3, 0, HDA_INPUT),
19062 HDA_CODEC_VOLUME_IDX("Capture Volume", 2, 0x09, 0x0, HDA_INPUT), 19118 HDA_COMPOSE_AMP_VAL(0x09, 3, 0, HDA_INPUT),
19063 HDA_CODEC_MUTE_IDX("Capture Switch", 2, 0x09, 0x0, HDA_INPUT), 19119 0
19120 },
19121};
19122
19123static struct hda_bind_ctls alc680_bind_cap_switch = {
19124 .ops = &snd_hda_bind_sw,
19125 .values = {
19126 HDA_COMPOSE_AMP_VAL(0x07, 3, 0, HDA_INPUT),
19127 HDA_COMPOSE_AMP_VAL(0x08, 3, 0, HDA_INPUT),
19128 HDA_COMPOSE_AMP_VAL(0x09, 3, 0, HDA_INPUT),
19129 0
19130 },
19131};
19132
19133static struct snd_kcontrol_new alc680_master_capture_mixer[] = {
19134 HDA_BIND_VOL("Capture Volume", &alc680_bind_cap_vol),
19135 HDA_BIND_SW("Capture Switch", &alc680_bind_cap_switch),
19064 { } /* end */ 19136 { } /* end */
19065}; 19137};
19066 19138
@@ -19068,25 +19140,73 @@ static struct snd_kcontrol_new alc680_capture_mixer[] = {
19068 * generic initialization of ADC, input mixers and output mixers 19140 * generic initialization of ADC, input mixers and output mixers
19069 */ 19141 */
19070static struct hda_verb alc680_init_verbs[] = { 19142static struct hda_verb alc680_init_verbs[] = {
19071 /* Unmute DAC0-1 and set vol = 0 */ 19143 {0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
19072 {0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 19144 {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
19073 {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 19145 {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
19074 {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
19075 19146
19076 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40}, 19147 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
19077 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40}, 19148 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
19078 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0}, 19149 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
19079 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24}, 19150 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
19080 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20}, 19151 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
19152 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
19081 19153
19082 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, 19154 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
19083 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, 19155 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
19084 {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, 19156 {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
19085 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, 19157 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
19086 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, 19158 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
19159
19160 {0x16, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
19161 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_MIC_EVENT | AC_USRSP_EN},
19162
19087 { } 19163 { }
19088}; 19164};
19089 19165
19166/* toggle speaker-output according to the hp-jack state */
19167static void alc680_base_setup(struct hda_codec *codec)
19168{
19169 struct alc_spec *spec = codec->spec;
19170
19171 spec->autocfg.hp_pins[0] = 0x16;
19172 spec->autocfg.speaker_pins[0] = 0x14;
19173 spec->autocfg.speaker_pins[1] = 0x15;
19174 spec->autocfg.input_pins[AUTO_PIN_MIC] = 0x18;
19175 spec->autocfg.input_pins[AUTO_PIN_LINE] = 0x19;
19176}
19177
19178static void alc680_rec_autoswitch(struct hda_codec *codec)
19179{
19180 struct alc_spec *spec = codec->spec;
19181 struct auto_pin_cfg *cfg = &spec->autocfg;
19182 unsigned int present;
19183 hda_nid_t new_adc;
19184
19185 present = snd_hda_jack_detect(codec, cfg->input_pins[AUTO_PIN_MIC]);
19186
19187 new_adc = present ? 0x8 : 0x7;
19188 __snd_hda_codec_cleanup_stream(codec, !present ? 0x8 : 0x7, 1);
19189 snd_hda_codec_setup_stream(codec, new_adc,
19190 spec->cur_adc_stream_tag, 0,
19191 spec->cur_adc_format);
19192
19193}
19194
19195static void alc680_unsol_event(struct hda_codec *codec,
19196 unsigned int res)
19197{
19198 if ((res >> 26) == ALC880_HP_EVENT)
19199 alc_automute_amp(codec);
19200 if ((res >> 26) == ALC880_MIC_EVENT)
19201 alc680_rec_autoswitch(codec);
19202}
19203
19204static void alc680_inithook(struct hda_codec *codec)
19205{
19206 alc_automute_amp(codec);
19207 alc680_rec_autoswitch(codec);
19208}
19209
19090/* create input playback/capture controls for the given pin */ 19210/* create input playback/capture controls for the given pin */
19091static int alc680_new_analog_output(struct alc_spec *spec, hda_nid_t nid, 19211static int alc680_new_analog_output(struct alc_spec *spec, hda_nid_t nid,
19092 const char *ctlname, int idx) 19212 const char *ctlname, int idx)
@@ -19197,13 +19317,7 @@ static void alc680_auto_init_hp_out(struct hda_codec *codec)
19197#define alc680_pcm_analog_capture alc880_pcm_analog_capture 19317#define alc680_pcm_analog_capture alc880_pcm_analog_capture
19198#define alc680_pcm_analog_alt_capture alc880_pcm_analog_alt_capture 19318#define alc680_pcm_analog_alt_capture alc880_pcm_analog_alt_capture
19199#define alc680_pcm_digital_playback alc880_pcm_digital_playback 19319#define alc680_pcm_digital_playback alc880_pcm_digital_playback
19200 19320#define alc680_pcm_digital_capture alc880_pcm_digital_capture
19201static struct hda_input_mux alc680_capture_source = {
19202 .num_items = 1,
19203 .items = {
19204 { "Mic", 0x0 },
19205 },
19206};
19207 19321
19208/* 19322/*
19209 * BIOS auto configuration 19323 * BIOS auto configuration
@@ -19218,6 +19332,7 @@ static int alc680_parse_auto_config(struct hda_codec *codec)
19218 alc680_ignore); 19332 alc680_ignore);
19219 if (err < 0) 19333 if (err < 0)
19220 return err; 19334 return err;
19335
19221 if (!spec->autocfg.line_outs) { 19336 if (!spec->autocfg.line_outs) {
19222 if (spec->autocfg.dig_outs || spec->autocfg.dig_in_pin) { 19337 if (spec->autocfg.dig_outs || spec->autocfg.dig_in_pin) {
19223 spec->multiout.max_channels = 2; 19338 spec->multiout.max_channels = 2;
@@ -19239,8 +19354,6 @@ static int alc680_parse_auto_config(struct hda_codec *codec)
19239 add_mixer(spec, spec->kctls.list); 19354 add_mixer(spec, spec->kctls.list);
19240 19355
19241 add_verb(spec, alc680_init_verbs); 19356 add_verb(spec, alc680_init_verbs);
19242 spec->num_mux_defs = 1;
19243 spec->input_mux = &alc680_capture_source;
19244 19357
19245 err = alc_auto_add_mic_boost(codec); 19358 err = alc_auto_add_mic_boost(codec);
19246 if (err < 0) 19359 if (err < 0)
@@ -19279,17 +19392,17 @@ static struct snd_pci_quirk alc680_cfg_tbl[] = {
19279static struct alc_config_preset alc680_presets[] = { 19392static struct alc_config_preset alc680_presets[] = {
19280 [ALC680_BASE] = { 19393 [ALC680_BASE] = {
19281 .mixers = { alc680_base_mixer }, 19394 .mixers = { alc680_base_mixer },
19282 .cap_mixer = alc680_capture_mixer, 19395 .cap_mixer = alc680_master_capture_mixer,
19283 .init_verbs = { alc680_init_verbs }, 19396 .init_verbs = { alc680_init_verbs },
19284 .num_dacs = ARRAY_SIZE(alc680_dac_nids), 19397 .num_dacs = ARRAY_SIZE(alc680_dac_nids),
19285 .dac_nids = alc680_dac_nids, 19398 .dac_nids = alc680_dac_nids,
19286 .num_adc_nids = ARRAY_SIZE(alc680_adc_nids),
19287 .adc_nids = alc680_adc_nids,
19288 .hp_nid = 0x04,
19289 .dig_out_nid = ALC680_DIGOUT_NID, 19399 .dig_out_nid = ALC680_DIGOUT_NID,
19290 .num_channel_mode = ARRAY_SIZE(alc680_modes), 19400 .num_channel_mode = ARRAY_SIZE(alc680_modes),
19291 .channel_mode = alc680_modes, 19401 .channel_mode = alc680_modes,
19292 .input_mux = &alc680_capture_source, 19402 .unsol_event = alc680_unsol_event,
19403 .setup = alc680_base_setup,
19404 .init_hook = alc680_inithook,
19405
19293 }, 19406 },
19294}; 19407};
19295 19408
@@ -19333,9 +19446,9 @@ static int patch_alc680(struct hda_codec *codec)
19333 setup_preset(codec, &alc680_presets[board_config]); 19446 setup_preset(codec, &alc680_presets[board_config]);
19334 19447
19335 spec->stream_analog_playback = &alc680_pcm_analog_playback; 19448 spec->stream_analog_playback = &alc680_pcm_analog_playback;
19336 spec->stream_analog_capture = &alc680_pcm_analog_capture; 19449 spec->stream_analog_capture = &alc680_pcm_analog_auto_capture;
19337 spec->stream_analog_alt_capture = &alc680_pcm_analog_alt_capture;
19338 spec->stream_digital_playback = &alc680_pcm_digital_playback; 19450 spec->stream_digital_playback = &alc680_pcm_digital_playback;
19451 spec->stream_digital_capture = &alc680_pcm_digital_capture;
19339 19452
19340 if (!spec->adc_nids) { 19453 if (!spec->adc_nids) {
19341 spec->adc_nids = alc680_adc_nids; 19454 spec->adc_nids = alc680_adc_nids;
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index f3f861bd1bf8..95148e58026c 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -6303,6 +6303,21 @@ static struct hda_codec_preset snd_hda_preset_sigmatel[] = {
6303 { .id = 0x111d76b5, .name = "92HD71B6X", .patch = patch_stac92hd71bxx }, 6303 { .id = 0x111d76b5, .name = "92HD71B6X", .patch = patch_stac92hd71bxx },
6304 { .id = 0x111d76b6, .name = "92HD71B5X", .patch = patch_stac92hd71bxx }, 6304 { .id = 0x111d76b6, .name = "92HD71B5X", .patch = patch_stac92hd71bxx },
6305 { .id = 0x111d76b7, .name = "92HD71B5X", .patch = patch_stac92hd71bxx }, 6305 { .id = 0x111d76b7, .name = "92HD71B5X", .patch = patch_stac92hd71bxx },
6306 { .id = 0x111d76c0, .name = "92HD89C3", .patch = patch_stac92hd73xx },
6307 { .id = 0x111d76c1, .name = "92HD89C2", .patch = patch_stac92hd73xx },
6308 { .id = 0x111d76c2, .name = "92HD89C1", .patch = patch_stac92hd73xx },
6309 { .id = 0x111d76c3, .name = "92HD89B3", .patch = patch_stac92hd73xx },
6310 { .id = 0x111d76c4, .name = "92HD89B2", .patch = patch_stac92hd73xx },
6311 { .id = 0x111d76c5, .name = "92HD89B1", .patch = patch_stac92hd73xx },
6312 { .id = 0x111d76c6, .name = "92HD89E3", .patch = patch_stac92hd73xx },
6313 { .id = 0x111d76c7, .name = "92HD89E2", .patch = patch_stac92hd73xx },
6314 { .id = 0x111d76c8, .name = "92HD89E1", .patch = patch_stac92hd73xx },
6315 { .id = 0x111d76c9, .name = "92HD89D3", .patch = patch_stac92hd73xx },
6316 { .id = 0x111d76ca, .name = "92HD89D2", .patch = patch_stac92hd73xx },
6317 { .id = 0x111d76cb, .name = "92HD89D1", .patch = patch_stac92hd73xx },
6318 { .id = 0x111d76cc, .name = "92HD89F3", .patch = patch_stac92hd73xx },
6319 { .id = 0x111d76cd, .name = "92HD89F2", .patch = patch_stac92hd73xx },
6320 { .id = 0x111d76ce, .name = "92HD89F1", .patch = patch_stac92hd73xx },
6306 {} /* terminator */ 6321 {} /* terminator */
6307}; 6322};
6308 6323
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
index 6433e65c9507..467749249576 100644
--- a/sound/pci/intel8x0.c
+++ b/sound/pci/intel8x0.c
@@ -1776,6 +1776,12 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = {
1776 }, 1776 },
1777 { 1777 {
1778 .subvendor = 0x1014, 1778 .subvendor = 0x1014,
1779 .subdevice = 0x0534,
1780 .name = "ThinkPad X31",
1781 .type = AC97_TUNE_INV_EAPD
1782 },
1783 {
1784 .subvendor = 0x1014,
1779 .subdevice = 0x1f00, 1785 .subdevice = 0x1f00,
1780 .name = "MS-9128", 1786 .name = "MS-9128",
1781 .type = AC97_TUNE_ALC_JACK 1787 .type = AC97_TUNE_ALC_JACK
diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c
index f64fb7d988cb..ad5202efd7a9 100644
--- a/sound/pci/riptide/riptide.c
+++ b/sound/pci/riptide/riptide.c
@@ -1224,15 +1224,14 @@ static int try_to_load_firmware(struct cmdif *cif, struct snd_riptide *chip)
1224 firmware.firmware.ASIC, firmware.firmware.CODEC, 1224 firmware.firmware.ASIC, firmware.firmware.CODEC,
1225 firmware.firmware.AUXDSP, firmware.firmware.PROG); 1225 firmware.firmware.AUXDSP, firmware.firmware.PROG);
1226 1226
1227 if (!chip)
1228 return 1;
1229
1227 for (i = 0; i < FIRMWARE_VERSIONS; i++) { 1230 for (i = 0; i < FIRMWARE_VERSIONS; i++) {
1228 if (!memcmp(&firmware_versions[i], &firmware, sizeof(firmware))) 1231 if (!memcmp(&firmware_versions[i], &firmware, sizeof(firmware)))
1229 break; 1232 return 1; /* OK */
1230 }
1231 if (i >= FIRMWARE_VERSIONS)
1232 return 0; /* no match */
1233 1233
1234 if (!chip) 1234 }
1235 return 1; /* OK */
1236 1235
1237 snd_printdd("Writing Firmware\n"); 1236 snd_printdd("Writing Firmware\n");
1238 if (!chip->fw_entry) { 1237 if (!chip->fw_entry) {