aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-11-19 01:19:03 -0500
committerDavid S. Miller <davem@davemloft.net>2009-11-19 01:19:03 -0500
commit3505d1a9fd65e2d3e00827857b6795d9d8983658 (patch)
tree941cfafdb57c427bb6b7ebf6354ee93b2a3693b5 /sound
parentdfef948ed2ba69cf041840b5e860d6b4e16fa0b1 (diff)
parent66b00a7c93ec782d118d2c03bd599cfd041e80a1 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: drivers/net/sfc/sfe4001.c drivers/net/wireless/libertas/cmd.c drivers/staging/Kconfig drivers/staging/Makefile drivers/staging/rtl8187se/Kconfig drivers/staging/rtl8192e/Kconfig
Diffstat (limited to 'sound')
-rw-r--r--sound/arm/aaci.c1
-rw-r--r--sound/core/pcm.c5
-rw-r--r--sound/core/rawmidi.c42
-rw-r--r--sound/drivers/dummy.c4
-rw-r--r--sound/drivers/opl3/opl3_midi.c28
-rw-r--r--sound/drivers/pcsp/pcsp_lib.c65
-rw-r--r--sound/drivers/pcsp/pcsp_mixer.c2
-rw-r--r--sound/oss/dmasound/dmasound_core.c4
-rw-r--r--sound/oss/hex2hex.c2
-rw-r--r--sound/oss/sb_common.c4
-rw-r--r--sound/oss/sb_ess.c2
-rw-r--r--sound/parisc/harmony.c6
-rw-r--r--sound/pci/Kconfig1
-rw-r--r--sound/pci/ali5451/ali5451.c2
-rw-r--r--sound/pci/bt87x.c2
-rw-r--r--sound/pci/hda/hda_intel.c13
-rw-r--r--sound/pci/hda/patch_conexant.c16
-rw-r--r--sound/pci/hda/patch_nvhdmi.c33
-rw-r--r--sound/pci/hda/patch_realtek.c115
-rw-r--r--sound/pci/hda/patch_sigmatel.c99
-rw-r--r--sound/pci/ice1712/amp.c8
-rw-r--r--sound/pci/ice1712/ice1712.c2
-rw-r--r--sound/pci/ice1712/ice1712.h4
-rw-r--r--sound/pci/ice1712/ice1724.c8
-rw-r--r--sound/pci/ice1712/prodigy_hifi.c2
-rw-r--r--sound/pci/intel8x0.c6
-rw-r--r--sound/pci/via82xx.c86
-rw-r--r--sound/pcmcia/pdaudiocf/pdaudiocf.c21
-rw-r--r--sound/pcmcia/vx/vxpocket.c21
-rw-r--r--sound/ppc/Kconfig2
-rw-r--r--sound/sh/aica.c1
-rw-r--r--sound/soc/codecs/tlv320aic23.c2
-rw-r--r--sound/soc/codecs/wm8350.c4
-rw-r--r--sound/soc/codecs/wm8940.c2
-rw-r--r--sound/soc/imx/mxc-ssi.c8
-rw-r--r--sound/soc/omap/Kconfig13
-rw-r--r--sound/soc/omap/omap-pcm.c8
-rw-r--r--sound/soc/omap/omap3evm.c2
-rw-r--r--sound/soc/omap/omap3pandora.c3
-rw-r--r--sound/soc/s3c24xx/s3c24xx-pcm.c17
-rw-r--r--sound/soc/s3c24xx/s3c64xx-i2s.c2
-rw-r--r--sound/soc/soc-core.c11
-rw-r--r--sound/soc/soc-dapm.c7
-rw-r--r--sound/usb/caiaq/audio.c16
-rw-r--r--sound/usb/caiaq/device.c2
-rw-r--r--sound/usb/usbaudio.h2
-rw-r--r--sound/usb/usbmixer.c9
47 files changed, 518 insertions, 197 deletions
diff --git a/sound/arm/aaci.c b/sound/arm/aaci.c
index dc78272fc39f..1f0f8213e2d5 100644
--- a/sound/arm/aaci.c
+++ b/sound/arm/aaci.c
@@ -937,6 +937,7 @@ static int __devinit aaci_probe_ac97(struct aaci *aaci)
937 struct snd_ac97 *ac97; 937 struct snd_ac97 *ac97;
938 int ret; 938 int ret;
939 939
940 writel(0, aaci->base + AC97_POWERDOWN);
940 /* 941 /*
941 * Assert AACIRESET for 2us 942 * Assert AACIRESET for 2us
942 */ 943 */
diff --git a/sound/core/pcm.c b/sound/core/pcm.c
index 0c1440121c22..c69c60b2a48a 100644
--- a/sound/core/pcm.c
+++ b/sound/core/pcm.c
@@ -953,11 +953,12 @@ static int snd_pcm_dev_register(struct snd_device *device)
953 struct snd_pcm_substream *substream; 953 struct snd_pcm_substream *substream;
954 struct snd_pcm_notify *notify; 954 struct snd_pcm_notify *notify;
955 char str[16]; 955 char str[16];
956 struct snd_pcm *pcm = device->device_data; 956 struct snd_pcm *pcm;
957 struct device *dev; 957 struct device *dev;
958 958
959 if (snd_BUG_ON(!pcm || !device)) 959 if (snd_BUG_ON(!device || !device->device_data))
960 return -ENXIO; 960 return -ENXIO;
961 pcm = device->device_data;
961 mutex_lock(&register_mutex); 962 mutex_lock(&register_mutex);
962 err = snd_pcm_add(pcm); 963 err = snd_pcm_add(pcm);
963 if (err) { 964 if (err) {
diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c
index c0adc14c91f0..70d6f25ba526 100644
--- a/sound/core/rawmidi.c
+++ b/sound/core/rawmidi.c
@@ -248,7 +248,8 @@ static int assign_substream(struct snd_rawmidi *rmidi, int subdevice,
248 list_for_each_entry(substream, &s->substreams, list) { 248 list_for_each_entry(substream, &s->substreams, list) {
249 if (substream->opened) { 249 if (substream->opened) {
250 if (stream == SNDRV_RAWMIDI_STREAM_INPUT || 250 if (stream == SNDRV_RAWMIDI_STREAM_INPUT ||
251 !(mode & SNDRV_RAWMIDI_LFLG_APPEND)) 251 !(mode & SNDRV_RAWMIDI_LFLG_APPEND) ||
252 !substream->append)
252 continue; 253 continue;
253 } 254 }
254 if (subdevice < 0 || subdevice == substream->number) { 255 if (subdevice < 0 || subdevice == substream->number) {
@@ -266,17 +267,21 @@ static int open_substream(struct snd_rawmidi *rmidi,
266{ 267{
267 int err; 268 int err;
268 269
269 err = snd_rawmidi_runtime_create(substream); 270 if (substream->use_count == 0) {
270 if (err < 0) 271 err = snd_rawmidi_runtime_create(substream);
271 return err; 272 if (err < 0)
272 err = substream->ops->open(substream); 273 return err;
273 if (err < 0) 274 err = substream->ops->open(substream);
274 return err; 275 if (err < 0) {
275 substream->opened = 1; 276 snd_rawmidi_runtime_free(substream);
276 if (substream->use_count++ == 0) 277 return err;
278 }
279 substream->opened = 1;
277 substream->active_sensing = 0; 280 substream->active_sensing = 0;
278 if (mode & SNDRV_RAWMIDI_LFLG_APPEND) 281 if (mode & SNDRV_RAWMIDI_LFLG_APPEND)
279 substream->append = 1; 282 substream->append = 1;
283 }
284 substream->use_count++;
280 rmidi->streams[substream->stream].substream_opened++; 285 rmidi->streams[substream->stream].substream_opened++;
281 return 0; 286 return 0;
282} 287}
@@ -297,27 +302,27 @@ static int rawmidi_open_priv(struct snd_rawmidi *rmidi, int subdevice, int mode,
297 SNDRV_RAWMIDI_STREAM_INPUT, 302 SNDRV_RAWMIDI_STREAM_INPUT,
298 mode, &sinput); 303 mode, &sinput);
299 if (err < 0) 304 if (err < 0)
300 goto __error; 305 return err;
301 } 306 }
302 if (mode & SNDRV_RAWMIDI_LFLG_OUTPUT) { 307 if (mode & SNDRV_RAWMIDI_LFLG_OUTPUT) {
303 err = assign_substream(rmidi, subdevice, 308 err = assign_substream(rmidi, subdevice,
304 SNDRV_RAWMIDI_STREAM_OUTPUT, 309 SNDRV_RAWMIDI_STREAM_OUTPUT,
305 mode, &soutput); 310 mode, &soutput);
306 if (err < 0) 311 if (err < 0)
307 goto __error; 312 return err;
308 } 313 }
309 314
310 if (sinput) { 315 if (sinput) {
311 err = open_substream(rmidi, sinput, mode); 316 err = open_substream(rmidi, sinput, mode);
312 if (err < 0) 317 if (err < 0)
313 goto __error; 318 return err;
314 } 319 }
315 if (soutput) { 320 if (soutput) {
316 err = open_substream(rmidi, soutput, mode); 321 err = open_substream(rmidi, soutput, mode);
317 if (err < 0) { 322 if (err < 0) {
318 if (sinput) 323 if (sinput)
319 close_substream(rmidi, sinput, 0); 324 close_substream(rmidi, sinput, 0);
320 goto __error; 325 return err;
321 } 326 }
322 } 327 }
323 328
@@ -325,13 +330,6 @@ static int rawmidi_open_priv(struct snd_rawmidi *rmidi, int subdevice, int mode,
325 rfile->input = sinput; 330 rfile->input = sinput;
326 rfile->output = soutput; 331 rfile->output = soutput;
327 return 0; 332 return 0;
328
329 __error:
330 if (sinput && sinput->runtime)
331 snd_rawmidi_runtime_free(sinput);
332 if (soutput && soutput->runtime)
333 snd_rawmidi_runtime_free(soutput);
334 return err;
335} 333}
336 334
337/* called from sound/core/seq/seq_midi.c */ 335/* called from sound/core/seq/seq_midi.c */
diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c
index 6ba066c41d2e..252e04ce602f 100644
--- a/sound/drivers/dummy.c
+++ b/sound/drivers/dummy.c
@@ -165,7 +165,7 @@ MODULE_PARM_DESC(enable, "Enable this dummy soundcard.");
165module_param_array(pcm_devs, int, NULL, 0444); 165module_param_array(pcm_devs, int, NULL, 0444);
166MODULE_PARM_DESC(pcm_devs, "PCM devices # (0-4) for dummy driver."); 166MODULE_PARM_DESC(pcm_devs, "PCM devices # (0-4) for dummy driver.");
167module_param_array(pcm_substreams, int, NULL, 0444); 167module_param_array(pcm_substreams, int, NULL, 0444);
168MODULE_PARM_DESC(pcm_substreams, "PCM substreams # (1-16) for dummy driver."); 168MODULE_PARM_DESC(pcm_substreams, "PCM substreams # (1-128) for dummy driver.");
169//module_param_array(midi_devs, int, NULL, 0444); 169//module_param_array(midi_devs, int, NULL, 0444);
170//MODULE_PARM_DESC(midi_devs, "MIDI devices # (0-2) for dummy driver."); 170//MODULE_PARM_DESC(midi_devs, "MIDI devices # (0-2) for dummy driver.");
171module_param(fake_buffer, bool, 0444); 171module_param(fake_buffer, bool, 0444);
@@ -808,8 +808,6 @@ static int __devinit snd_card_dummy_new_mixer(struct snd_dummy *dummy)
808 unsigned int idx; 808 unsigned int idx;
809 int err; 809 int err;
810 810
811 if (snd_BUG_ON(!dummy))
812 return -EINVAL;
813 spin_lock_init(&dummy->mixer_lock); 811 spin_lock_init(&dummy->mixer_lock);
814 strcpy(card->mixername, "Dummy Mixer"); 812 strcpy(card->mixername, "Dummy Mixer");
815 813
diff --git a/sound/drivers/opl3/opl3_midi.c b/sound/drivers/opl3/opl3_midi.c
index 6e7d09ae0e82..7d722a025d0d 100644
--- a/sound/drivers/opl3/opl3_midi.c
+++ b/sound/drivers/opl3/opl3_midi.c
@@ -29,6 +29,8 @@ extern char snd_opl3_regmap[MAX_OPL2_VOICES][4];
29 29
30extern int use_internal_drums; 30extern int use_internal_drums;
31 31
32static void snd_opl3_note_off_unsafe(void *p, int note, int vel,
33 struct snd_midi_channel *chan);
32/* 34/*
33 * The next table looks magical, but it certainly is not. Its values have 35 * The next table looks magical, but it certainly is not. Its values have
34 * been calculated as table[i]=8*log(i/64)/log(2) with an obvious exception 36 * been calculated as table[i]=8*log(i/64)/log(2) with an obvious exception
@@ -242,16 +244,20 @@ void snd_opl3_timer_func(unsigned long data)
242 int again = 0; 244 int again = 0;
243 int i; 245 int i;
244 246
245 spin_lock_irqsave(&opl3->sys_timer_lock, flags); 247 spin_lock_irqsave(&opl3->voice_lock, flags);
246 for (i = 0; i < opl3->max_voices; i++) { 248 for (i = 0; i < opl3->max_voices; i++) {
247 struct snd_opl3_voice *vp = &opl3->voices[i]; 249 struct snd_opl3_voice *vp = &opl3->voices[i];
248 if (vp->state > 0 && vp->note_off_check) { 250 if (vp->state > 0 && vp->note_off_check) {
249 if (vp->note_off == jiffies) 251 if (vp->note_off == jiffies)
250 snd_opl3_note_off(opl3, vp->note, 0, vp->chan); 252 snd_opl3_note_off_unsafe(opl3, vp->note, 0,
253 vp->chan);
251 else 254 else
252 again++; 255 again++;
253 } 256 }
254 } 257 }
258 spin_unlock_irqrestore(&opl3->voice_lock, flags);
259
260 spin_lock_irqsave(&opl3->sys_timer_lock, flags);
255 if (again) { 261 if (again) {
256 opl3->tlist.expires = jiffies + 1; /* invoke again */ 262 opl3->tlist.expires = jiffies + 1; /* invoke again */
257 add_timer(&opl3->tlist); 263 add_timer(&opl3->tlist);
@@ -658,15 +664,14 @@ static void snd_opl3_kill_voice(struct snd_opl3 *opl3, int voice)
658/* 664/*
659 * Release a note in response to a midi note off. 665 * Release a note in response to a midi note off.
660 */ 666 */
661void snd_opl3_note_off(void *p, int note, int vel, struct snd_midi_channel *chan) 667static void snd_opl3_note_off_unsafe(void *p, int note, int vel,
668 struct snd_midi_channel *chan)
662{ 669{
663 struct snd_opl3 *opl3; 670 struct snd_opl3 *opl3;
664 671
665 int voice; 672 int voice;
666 struct snd_opl3_voice *vp; 673 struct snd_opl3_voice *vp;
667 674
668 unsigned long flags;
669
670 opl3 = p; 675 opl3 = p;
671 676
672#ifdef DEBUG_MIDI 677#ifdef DEBUG_MIDI
@@ -674,12 +679,9 @@ void snd_opl3_note_off(void *p, int note, int vel, struct snd_midi_channel *chan
674 chan->number, chan->midi_program, note); 679 chan->number, chan->midi_program, note);
675#endif 680#endif
676 681
677 spin_lock_irqsave(&opl3->voice_lock, flags);
678
679 if (opl3->synth_mode == SNDRV_OPL3_MODE_SEQ) { 682 if (opl3->synth_mode == SNDRV_OPL3_MODE_SEQ) {
680 if (chan->drum_channel && use_internal_drums) { 683 if (chan->drum_channel && use_internal_drums) {
681 snd_opl3_drum_switch(opl3, note, vel, 0, chan); 684 snd_opl3_drum_switch(opl3, note, vel, 0, chan);
682 spin_unlock_irqrestore(&opl3->voice_lock, flags);
683 return; 685 return;
684 } 686 }
685 /* this loop will hopefully kill all extra voices, because 687 /* this loop will hopefully kill all extra voices, because
@@ -697,6 +699,16 @@ void snd_opl3_note_off(void *p, int note, int vel, struct snd_midi_channel *chan
697 snd_opl3_kill_voice(opl3, voice); 699 snd_opl3_kill_voice(opl3, voice);
698 } 700 }
699 } 701 }
702}
703
704void snd_opl3_note_off(void *p, int note, int vel,
705 struct snd_midi_channel *chan)
706{
707 struct snd_opl3 *opl3 = p;
708 unsigned long flags;
709
710 spin_lock_irqsave(&opl3->voice_lock, flags);
711 snd_opl3_note_off_unsafe(p, note, vel, chan);
700 spin_unlock_irqrestore(&opl3->voice_lock, flags); 712 spin_unlock_irqrestore(&opl3->voice_lock, flags);
701} 713}
702 714
diff --git a/sound/drivers/pcsp/pcsp_lib.c b/sound/drivers/pcsp/pcsp_lib.c
index 84cc2658c05b..e1145ac6e908 100644
--- a/sound/drivers/pcsp/pcsp_lib.c
+++ b/sound/drivers/pcsp/pcsp_lib.c
@@ -39,25 +39,20 @@ static DECLARE_TASKLET(pcsp_pcm_tasklet, pcsp_call_pcm_elapsed, 0);
39/* write the port and returns the next expire time in ns; 39/* write the port and returns the next expire time in ns;
40 * called at the trigger-start and in hrtimer callback 40 * called at the trigger-start and in hrtimer callback
41 */ 41 */
42static unsigned long pcsp_timer_update(struct hrtimer *handle) 42static u64 pcsp_timer_update(struct snd_pcsp *chip)
43{ 43{
44 unsigned char timer_cnt, val; 44 unsigned char timer_cnt, val;
45 u64 ns; 45 u64 ns;
46 struct snd_pcm_substream *substream; 46 struct snd_pcm_substream *substream;
47 struct snd_pcm_runtime *runtime; 47 struct snd_pcm_runtime *runtime;
48 struct snd_pcsp *chip = container_of(handle, struct snd_pcsp, timer);
49 unsigned long flags; 48 unsigned long flags;
50 49
51 if (chip->thalf) { 50 if (chip->thalf) {
52 outb(chip->val61, 0x61); 51 outb(chip->val61, 0x61);
53 chip->thalf = 0; 52 chip->thalf = 0;
54 if (!atomic_read(&chip->timer_active))
55 return 0;
56 return chip->ns_rem; 53 return chip->ns_rem;
57 } 54 }
58 55
59 if (!atomic_read(&chip->timer_active))
60 return 0;
61 substream = chip->playback_substream; 56 substream = chip->playback_substream;
62 if (!substream) 57 if (!substream)
63 return 0; 58 return 0;
@@ -88,24 +83,17 @@ static unsigned long pcsp_timer_update(struct hrtimer *handle)
88 return ns; 83 return ns;
89} 84}
90 85
91enum hrtimer_restart pcsp_do_timer(struct hrtimer *handle) 86static void pcsp_pointer_update(struct snd_pcsp *chip)
92{ 87{
93 struct snd_pcsp *chip = container_of(handle, struct snd_pcsp, timer);
94 struct snd_pcm_substream *substream; 88 struct snd_pcm_substream *substream;
95 int periods_elapsed, pointer_update;
96 size_t period_bytes, buffer_bytes; 89 size_t period_bytes, buffer_bytes;
97 unsigned long ns; 90 int periods_elapsed;
98 unsigned long flags; 91 unsigned long flags;
99 92
100 pointer_update = !chip->thalf;
101 ns = pcsp_timer_update(handle);
102 if (!ns)
103 return HRTIMER_NORESTART;
104
105 /* update the playback position */ 93 /* update the playback position */
106 substream = chip->playback_substream; 94 substream = chip->playback_substream;
107 if (!substream) 95 if (!substream)
108 return HRTIMER_NORESTART; 96 return;
109 97
110 period_bytes = snd_pcm_lib_period_bytes(substream); 98 period_bytes = snd_pcm_lib_period_bytes(substream);
111 buffer_bytes = snd_pcm_lib_buffer_bytes(substream); 99 buffer_bytes = snd_pcm_lib_buffer_bytes(substream);
@@ -134,6 +122,26 @@ enum hrtimer_restart pcsp_do_timer(struct hrtimer *handle)
134 122
135 if (periods_elapsed) 123 if (periods_elapsed)
136 tasklet_schedule(&pcsp_pcm_tasklet); 124 tasklet_schedule(&pcsp_pcm_tasklet);
125}
126
127enum hrtimer_restart pcsp_do_timer(struct hrtimer *handle)
128{
129 struct snd_pcsp *chip = container_of(handle, struct snd_pcsp, timer);
130 int pointer_update;
131 u64 ns;
132
133 if (!atomic_read(&chip->timer_active) || !chip->playback_substream)
134 return HRTIMER_NORESTART;
135
136 pointer_update = !chip->thalf;
137 ns = pcsp_timer_update(chip);
138 if (!ns) {
139 printk(KERN_WARNING "PCSP: unexpected stop\n");
140 return HRTIMER_NORESTART;
141 }
142
143 if (pointer_update)
144 pcsp_pointer_update(chip);
137 145
138 hrtimer_forward(handle, hrtimer_get_expires(handle), ns_to_ktime(ns)); 146 hrtimer_forward(handle, hrtimer_get_expires(handle), ns_to_ktime(ns));
139 147
@@ -142,8 +150,6 @@ enum hrtimer_restart pcsp_do_timer(struct hrtimer *handle)
142 150
143static int pcsp_start_playing(struct snd_pcsp *chip) 151static int pcsp_start_playing(struct snd_pcsp *chip)
144{ 152{
145 unsigned long ns;
146
147#if PCSP_DEBUG 153#if PCSP_DEBUG
148 printk(KERN_INFO "PCSP: start_playing called\n"); 154 printk(KERN_INFO "PCSP: start_playing called\n");
149#endif 155#endif
@@ -159,11 +165,7 @@ static int pcsp_start_playing(struct snd_pcsp *chip)
159 atomic_set(&chip->timer_active, 1); 165 atomic_set(&chip->timer_active, 1);
160 chip->thalf = 0; 166 chip->thalf = 0;
161 167
162 ns = pcsp_timer_update(&pcsp_chip.timer); 168 hrtimer_start(&pcsp_chip.timer, ktime_set(0, 0), HRTIMER_MODE_REL);
163 if (!ns)
164 return -EIO;
165
166 hrtimer_start(&pcsp_chip.timer, ktime_set(0, ns), HRTIMER_MODE_REL);
167 return 0; 169 return 0;
168} 170}
169 171
@@ -232,21 +234,22 @@ static int snd_pcsp_playback_hw_free(struct snd_pcm_substream *substream)
232static int snd_pcsp_playback_prepare(struct snd_pcm_substream *substream) 234static int snd_pcsp_playback_prepare(struct snd_pcm_substream *substream)
233{ 235{
234 struct snd_pcsp *chip = snd_pcm_substream_chip(substream); 236 struct snd_pcsp *chip = snd_pcm_substream_chip(substream);
237 pcsp_sync_stop(chip);
238 chip->playback_ptr = 0;
239 chip->period_ptr = 0;
240 chip->fmt_size =
241 snd_pcm_format_physical_width(substream->runtime->format) >> 3;
242 chip->is_signed = snd_pcm_format_signed(substream->runtime->format);
235#if PCSP_DEBUG 243#if PCSP_DEBUG
236 printk(KERN_INFO "PCSP: prepare called, " 244 printk(KERN_INFO "PCSP: prepare called, "
237 "size=%zi psize=%zi f=%zi f1=%i\n", 245 "size=%zi psize=%zi f=%zi f1=%i fsize=%i\n",
238 snd_pcm_lib_buffer_bytes(substream), 246 snd_pcm_lib_buffer_bytes(substream),
239 snd_pcm_lib_period_bytes(substream), 247 snd_pcm_lib_period_bytes(substream),
240 snd_pcm_lib_buffer_bytes(substream) / 248 snd_pcm_lib_buffer_bytes(substream) /
241 snd_pcm_lib_period_bytes(substream), 249 snd_pcm_lib_period_bytes(substream),
242 substream->runtime->periods); 250 substream->runtime->periods,
251 chip->fmt_size);
243#endif 252#endif
244 pcsp_sync_stop(chip);
245 chip->playback_ptr = 0;
246 chip->period_ptr = 0;
247 chip->fmt_size =
248 snd_pcm_format_physical_width(substream->runtime->format) >> 3;
249 chip->is_signed = snd_pcm_format_signed(substream->runtime->format);
250 return 0; 253 return 0;
251} 254}
252 255
diff --git a/sound/drivers/pcsp/pcsp_mixer.c b/sound/drivers/pcsp/pcsp_mixer.c
index 199b03377142..903bc846763f 100644
--- a/sound/drivers/pcsp/pcsp_mixer.c
+++ b/sound/drivers/pcsp/pcsp_mixer.c
@@ -72,7 +72,7 @@ static int pcsp_treble_put(struct snd_kcontrol *kcontrol,
72 if (treble != chip->treble) { 72 if (treble != chip->treble) {
73 chip->treble = treble; 73 chip->treble = treble;
74#if PCSP_DEBUG 74#if PCSP_DEBUG
75 printk(KERN_INFO "PCSP: rate set to %i\n", PCSP_RATE()); 75 printk(KERN_INFO "PCSP: rate set to %li\n", PCSP_RATE());
76#endif 76#endif
77 changed = 1; 77 changed = 1;
78 } 78 }
diff --git a/sound/oss/dmasound/dmasound_core.c b/sound/oss/dmasound/dmasound_core.c
index 793b7f478433..3f3c3f71db4b 100644
--- a/sound/oss/dmasound/dmasound_core.c
+++ b/sound/oss/dmasound/dmasound_core.c
@@ -219,7 +219,9 @@ static int shared_resources_initialised;
219 * Mid level stuff 219 * Mid level stuff
220 */ 220 */
221 221
222struct sound_settings dmasound = { .lock = SPIN_LOCK_UNLOCKED }; 222struct sound_settings dmasound = {
223 .lock = __SPIN_LOCK_UNLOCKED(dmasound.lock)
224};
223 225
224static inline void sound_silence(void) 226static inline void sound_silence(void)
225{ 227{
diff --git a/sound/oss/hex2hex.c b/sound/oss/hex2hex.c
index 5460faae98c9..041ef5c52bc2 100644
--- a/sound/oss/hex2hex.c
+++ b/sound/oss/hex2hex.c
@@ -12,7 +12,7 @@
12#define MAX_SIZE (256*1024) 12#define MAX_SIZE (256*1024)
13unsigned char buf[MAX_SIZE]; 13unsigned char buf[MAX_SIZE];
14 14
15int loadhex(FILE *inf, unsigned char *buf) 15static int loadhex(FILE *inf, unsigned char *buf)
16{ 16{
17 int l=0, c, i; 17 int l=0, c, i;
18 18
diff --git a/sound/oss/sb_common.c b/sound/oss/sb_common.c
index 77d0e5efda76..ce4db49291f7 100644
--- a/sound/oss/sb_common.c
+++ b/sound/oss/sb_common.c
@@ -157,7 +157,7 @@ static void sb_intr (sb_devc *devc)
157 break; 157 break;
158 158
159 default: 159 default:
160 /* printk(KERN_WARN "Sound Blaster: Unexpected interrupt\n"); */ 160 /* printk(KERN_WARNING "Sound Blaster: Unexpected interrupt\n"); */
161 ; 161 ;
162 } 162 }
163 } 163 }
@@ -177,7 +177,7 @@ static void sb_intr (sb_devc *devc)
177 break; 177 break;
178 178
179 default: 179 default:
180 /* printk(KERN_WARN "Sound Blaster: Unexpected interrupt\n"); */ 180 /* printk(KERN_WARNING "Sound Blaster: Unexpected interrupt\n"); */
181 ; 181 ;
182 } 182 }
183 } 183 }
diff --git a/sound/oss/sb_ess.c b/sound/oss/sb_ess.c
index 180e95c87e3e..51a3d381a59e 100644
--- a/sound/oss/sb_ess.c
+++ b/sound/oss/sb_ess.c
@@ -782,7 +782,7 @@ printk(KERN_INFO "FKS: ess_handle_channel %s irq_mode=%d\n", channel, irq_mode);
782 break; 782 break;
783 783
784 default:; 784 default:;
785 /* printk(KERN_WARN "ESS: Unexpected interrupt\n"); */ 785 /* printk(KERN_WARNING "ESS: Unexpected interrupt\n"); */
786 } 786 }
787} 787}
788 788
diff --git a/sound/parisc/harmony.c b/sound/parisc/harmony.c
index e924492df21d..f47f9e226b08 100644
--- a/sound/parisc/harmony.c
+++ b/sound/parisc/harmony.c
@@ -624,6 +624,9 @@ snd_harmony_pcm_init(struct snd_harmony *h)
624 struct snd_pcm *pcm; 624 struct snd_pcm *pcm;
625 int err; 625 int err;
626 626
627 if (snd_BUG_ON(!h))
628 return -EINVAL;
629
627 harmony_disable_interrupts(h); 630 harmony_disable_interrupts(h);
628 631
629 err = snd_pcm_new(h->card, "harmony", 0, 1, 1, &pcm); 632 err = snd_pcm_new(h->card, "harmony", 0, 1, 1, &pcm);
@@ -865,11 +868,12 @@ snd_harmony_mixer_reset(struct snd_harmony *h)
865static int __devinit 868static int __devinit
866snd_harmony_mixer_init(struct snd_harmony *h) 869snd_harmony_mixer_init(struct snd_harmony *h)
867{ 870{
868 struct snd_card *card = h->card; 871 struct snd_card *card;
869 int idx, err; 872 int idx, err;
870 873
871 if (snd_BUG_ON(!h)) 874 if (snd_BUG_ON(!h))
872 return -EINVAL; 875 return -EINVAL;
876 card = h->card;
873 strcpy(card->mixername, "Harmony Gain control interface"); 877 strcpy(card->mixername, "Harmony Gain control interface");
874 878
875 for (idx = 0; idx < HARMONY_CONTROLS; idx++) { 879 for (idx = 0; idx < HARMONY_CONTROLS; idx++) {
diff --git a/sound/pci/Kconfig b/sound/pci/Kconfig
index fb5ee3cc3968..75c602b5b132 100644
--- a/sound/pci/Kconfig
+++ b/sound/pci/Kconfig
@@ -259,7 +259,6 @@ config SND_CS5530
259 259
260config SND_CS5535AUDIO 260config SND_CS5535AUDIO
261 tristate "CS5535/CS5536 Audio" 261 tristate "CS5535/CS5536 Audio"
262 depends on X86 && !X86_64
263 select SND_PCM 262 select SND_PCM
264 select SND_AC97_CODEC 263 select SND_AC97_CODEC
265 help 264 help
diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c
index b458d208720b..aaf4da68969c 100644
--- a/sound/pci/ali5451/ali5451.c
+++ b/sound/pci/ali5451/ali5451.c
@@ -973,7 +973,7 @@ static void snd_ali_free_voice(struct snd_ali * codec,
973 void *private_data; 973 void *private_data;
974 974
975 snd_ali_printk("free_voice: channel=%d\n",pvoice->number); 975 snd_ali_printk("free_voice: channel=%d\n",pvoice->number);
976 if (pvoice == NULL || !pvoice->use) 976 if (!pvoice->use)
977 return; 977 return;
978 snd_ali_clear_voices(codec, pvoice->number, pvoice->number); 978 snd_ali_clear_voices(codec, pvoice->number, pvoice->number);
979 spin_lock_irq(&codec->voice_alloc); 979 spin_lock_irq(&codec->voice_alloc);
diff --git a/sound/pci/bt87x.c b/sound/pci/bt87x.c
index 24585c6c6d01..4e2b925a94cc 100644
--- a/sound/pci/bt87x.c
+++ b/sound/pci/bt87x.c
@@ -808,6 +808,8 @@ static struct pci_device_id snd_bt87x_ids[] = {
808 BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_878, 0x1002, 0x0001, GENERIC), 808 BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_878, 0x1002, 0x0001, GENERIC),
809 /* Leadtek Winfast tv 2000xp delux */ 809 /* Leadtek Winfast tv 2000xp delux */
810 BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_878, 0x107d, 0x6606, GENERIC), 810 BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_878, 0x107d, 0x6606, GENERIC),
811 /* Pinnacle PCTV */
812 BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_878, 0x11bd, 0x0012, GENERIC),
811 /* Voodoo TV 200 */ 813 /* Voodoo TV 200 */
812 BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_878, 0x121a, 0x3000, GENERIC), 814 BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_878, 0x121a, 0x3000, GENERIC),
813 /* Askey Computer Corp. MagicTView'99 */ 815 /* Askey Computer Corp. MagicTView'99 */
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index c9ad182e1b4b..6517f589d01d 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -722,9 +722,10 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus,
722 chip->last_cmd[addr]); 722 chip->last_cmd[addr]);
723 chip->single_cmd = 1; 723 chip->single_cmd = 1;
724 bus->response_reset = 0; 724 bus->response_reset = 0;
725 /* re-initialize CORB/RIRB */ 725 /* release CORB/RIRB */
726 azx_free_cmd_io(chip); 726 azx_free_cmd_io(chip);
727 azx_init_cmd_io(chip); 727 /* disable unsolicited responses */
728 azx_writel(chip, GCTL, azx_readl(chip, GCTL) & ~ICH6_GCTL_UNSOL);
728 return -1; 729 return -1;
729} 730}
730 731
@@ -865,7 +866,9 @@ static int azx_reset(struct azx *chip)
865 } 866 }
866 867
867 /* Accept unsolicited responses */ 868 /* Accept unsolicited responses */
868 azx_writel(chip, GCTL, azx_readl(chip, GCTL) | ICH6_GCTL_UNSOL); 869 if (!chip->single_cmd)
870 azx_writel(chip, GCTL, azx_readl(chip, GCTL) |
871 ICH6_GCTL_UNSOL);
869 872
870 /* detect codecs */ 873 /* detect codecs */
871 if (!chip->codec_mask) { 874 if (!chip->codec_mask) {
@@ -980,7 +983,8 @@ static void azx_init_chip(struct azx *chip)
980 azx_int_enable(chip); 983 azx_int_enable(chip);
981 984
982 /* initialize the codec command I/O */ 985 /* initialize the codec command I/O */
983 azx_init_cmd_io(chip); 986 if (!chip->single_cmd)
987 azx_init_cmd_io(chip);
984 988
985 /* program the position buffer */ 989 /* program the position buffer */
986 azx_writel(chip, DPLBASE, (u32)chip->posbuf.addr); 990 azx_writel(chip, DPLBASE, (u32)chip->posbuf.addr);
@@ -2674,6 +2678,7 @@ static struct pci_device_id azx_ids[] = {
2674 { PCI_DEVICE(0x10de, 0x044b), .driver_data = AZX_DRIVER_NVIDIA }, 2678 { PCI_DEVICE(0x10de, 0x044b), .driver_data = AZX_DRIVER_NVIDIA },
2675 { PCI_DEVICE(0x10de, 0x055c), .driver_data = AZX_DRIVER_NVIDIA }, 2679 { PCI_DEVICE(0x10de, 0x055c), .driver_data = AZX_DRIVER_NVIDIA },
2676 { PCI_DEVICE(0x10de, 0x055d), .driver_data = AZX_DRIVER_NVIDIA }, 2680 { PCI_DEVICE(0x10de, 0x055d), .driver_data = AZX_DRIVER_NVIDIA },
2681 { PCI_DEVICE(0x10de, 0x0590), .driver_data = AZX_DRIVER_NVIDIA },
2677 { PCI_DEVICE(0x10de, 0x0774), .driver_data = AZX_DRIVER_NVIDIA }, 2682 { PCI_DEVICE(0x10de, 0x0774), .driver_data = AZX_DRIVER_NVIDIA },
2678 { PCI_DEVICE(0x10de, 0x0775), .driver_data = AZX_DRIVER_NVIDIA }, 2683 { PCI_DEVICE(0x10de, 0x0775), .driver_data = AZX_DRIVER_NVIDIA },
2679 { PCI_DEVICE(0x10de, 0x0776), .driver_data = AZX_DRIVER_NVIDIA }, 2684 { PCI_DEVICE(0x10de, 0x0776), .driver_data = AZX_DRIVER_NVIDIA },
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index 3fbbc8c01e70..905859d4f4df 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -110,6 +110,7 @@ struct conexant_spec {
110 110
111 unsigned int dell_automute; 111 unsigned int dell_automute;
112 unsigned int port_d_mode; 112 unsigned int port_d_mode;
113 unsigned char ext_mic_bias;
113}; 114};
114 115
115static int conexant_playback_pcm_open(struct hda_pcm_stream *hinfo, 116static int conexant_playback_pcm_open(struct hda_pcm_stream *hinfo,
@@ -1927,6 +1928,11 @@ static hda_nid_t cxt5066_adc_nids[3] = { 0x14, 0x15, 0x16 };
1927static hda_nid_t cxt5066_capsrc_nids[1] = { 0x17 }; 1928static hda_nid_t cxt5066_capsrc_nids[1] = { 0x17 };
1928#define CXT5066_SPDIF_OUT 0x21 1929#define CXT5066_SPDIF_OUT 0x21
1929 1930
1931/* OLPC's microphone port is DC coupled for use with external sensors,
1932 * therefore we use a 50% mic bias in order to center the input signal with
1933 * the DC input range of the codec. */
1934#define CXT5066_OLPC_EXT_MIC_BIAS PIN_VREF50
1935
1930static struct hda_channel_mode cxt5066_modes[1] = { 1936static struct hda_channel_mode cxt5066_modes[1] = {
1931 { 2, NULL }, 1937 { 2, NULL },
1932}; 1938};
@@ -1980,9 +1986,10 @@ static int cxt5066_hp_master_sw_put(struct snd_kcontrol *kcontrol,
1980/* toggle input of built-in and mic jack appropriately */ 1986/* toggle input of built-in and mic jack appropriately */
1981static void cxt5066_automic(struct hda_codec *codec) 1987static void cxt5066_automic(struct hda_codec *codec)
1982{ 1988{
1983 static struct hda_verb ext_mic_present[] = { 1989 struct conexant_spec *spec = codec->spec;
1990 struct hda_verb ext_mic_present[] = {
1984 /* enable external mic, port B */ 1991 /* enable external mic, port B */
1985 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, 1992 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, spec->ext_mic_bias},
1986 1993
1987 /* switch to external mic input */ 1994 /* switch to external mic input */
1988 {0x17, AC_VERB_SET_CONNECT_SEL, 0}, 1995 {0x17, AC_VERB_SET_CONNECT_SEL, 0},
@@ -2235,7 +2242,7 @@ static struct hda_verb cxt5066_init_verbs_olpc[] = {
2235 {0x19, AC_VERB_SET_CONNECT_SEL, 0x00}, /* DAC1 */ 2242 {0x19, AC_VERB_SET_CONNECT_SEL, 0x00}, /* DAC1 */
2236 2243
2237 /* Port B: external microphone */ 2244 /* Port B: external microphone */
2238 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, 2245 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, CXT5066_OLPC_EXT_MIC_BIAS},
2239 2246
2240 /* Port C: internal microphone */ 2247 /* Port C: internal microphone */
2241 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, 2248 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
@@ -2325,6 +2332,7 @@ static struct snd_pci_quirk cxt5066_cfg_tbl[] = {
2325 CXT5066_LAPTOP), 2332 CXT5066_LAPTOP),
2326 SND_PCI_QUIRK(0x1028, 0x02f5, "Dell", 2333 SND_PCI_QUIRK(0x1028, 0x02f5, "Dell",
2327 CXT5066_DELL_LAPTOP), 2334 CXT5066_DELL_LAPTOP),
2335 SND_PCI_QUIRK(0x152d, 0x0833, "OLPC XO-1.5", CXT5066_OLPC_XO_1_5),
2328 {} 2336 {}
2329}; 2337};
2330 2338
@@ -2352,6 +2360,7 @@ static int patch_cxt5066(struct hda_codec *codec)
2352 spec->input_mux = &cxt5066_capture_source; 2360 spec->input_mux = &cxt5066_capture_source;
2353 2361
2354 spec->port_d_mode = PIN_HP; 2362 spec->port_d_mode = PIN_HP;
2363 spec->ext_mic_bias = PIN_VREF80;
2355 2364
2356 spec->num_init_verbs = 1; 2365 spec->num_init_verbs = 1;
2357 spec->init_verbs[0] = cxt5066_init_verbs; 2366 spec->init_verbs[0] = cxt5066_init_verbs;
@@ -2383,6 +2392,7 @@ static int patch_cxt5066(struct hda_codec *codec)
2383 spec->mixers[spec->num_mixers++] = cxt5066_mixer_master_olpc; 2392 spec->mixers[spec->num_mixers++] = cxt5066_mixer_master_olpc;
2384 spec->mixers[spec->num_mixers++] = cxt5066_mixers; 2393 spec->mixers[spec->num_mixers++] = cxt5066_mixers;
2385 spec->port_d_mode = 0; 2394 spec->port_d_mode = 0;
2395 spec->ext_mic_bias = CXT5066_OLPC_EXT_MIC_BIAS;
2386 2396
2387 /* no S/PDIF out */ 2397 /* no S/PDIF out */
2388 spec->multiout.dig_out_nid = 0; 2398 spec->multiout.dig_out_nid = 0;
diff --git a/sound/pci/hda/patch_nvhdmi.c b/sound/pci/hda/patch_nvhdmi.c
index c8435c9a97f9..6afdab09bab7 100644
--- a/sound/pci/hda/patch_nvhdmi.c
+++ b/sound/pci/hda/patch_nvhdmi.c
@@ -29,6 +29,9 @@
29#include "hda_codec.h" 29#include "hda_codec.h"
30#include "hda_local.h" 30#include "hda_local.h"
31 31
32/* define below to restrict the supported rates and formats */
33/* #define LIMITED_RATE_FMT_SUPPORT */
34
32struct nvhdmi_spec { 35struct nvhdmi_spec {
33 struct hda_multi_out multiout; 36 struct hda_multi_out multiout;
34 37
@@ -60,6 +63,22 @@ static struct hda_verb nvhdmi_basic_init[] = {
60 {} /* terminator */ 63 {} /* terminator */
61}; 64};
62 65
66#ifdef LIMITED_RATE_FMT_SUPPORT
67/* support only the safe format and rate */
68#define SUPPORTED_RATES SNDRV_PCM_RATE_48000
69#define SUPPORTED_MAXBPS 16
70#define SUPPORTED_FORMATS SNDRV_PCM_FMTBIT_S16_LE
71#else
72/* support all rates and formats */
73#define SUPPORTED_RATES \
74 (SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 |\
75 SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 |\
76 SNDRV_PCM_RATE_192000)
77#define SUPPORTED_MAXBPS 24
78#define SUPPORTED_FORMATS \
79 (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE)
80#endif
81
63/* 82/*
64 * Controls 83 * Controls
65 */ 84 */
@@ -258,9 +277,9 @@ static struct hda_pcm_stream nvhdmi_pcm_digital_playback_8ch = {
258 .channels_min = 2, 277 .channels_min = 2,
259 .channels_max = 8, 278 .channels_max = 8,
260 .nid = Nv_Master_Convert_nid, 279 .nid = Nv_Master_Convert_nid,
261 .rates = SNDRV_PCM_RATE_48000, 280 .rates = SUPPORTED_RATES,
262 .maxbps = 16, 281 .maxbps = SUPPORTED_MAXBPS,
263 .formats = SNDRV_PCM_FMTBIT_S16_LE, 282 .formats = SUPPORTED_FORMATS,
264 .ops = { 283 .ops = {
265 .open = nvhdmi_dig_playback_pcm_open, 284 .open = nvhdmi_dig_playback_pcm_open,
266 .close = nvhdmi_dig_playback_pcm_close_8ch, 285 .close = nvhdmi_dig_playback_pcm_close_8ch,
@@ -273,9 +292,9 @@ static struct hda_pcm_stream nvhdmi_pcm_digital_playback_2ch = {
273 .channels_min = 2, 292 .channels_min = 2,
274 .channels_max = 2, 293 .channels_max = 2,
275 .nid = Nv_Master_Convert_nid, 294 .nid = Nv_Master_Convert_nid,
276 .rates = SNDRV_PCM_RATE_48000, 295 .rates = SUPPORTED_RATES,
277 .maxbps = 16, 296 .maxbps = SUPPORTED_MAXBPS,
278 .formats = SNDRV_PCM_FMTBIT_S16_LE, 297 .formats = SUPPORTED_FORMATS,
279 .ops = { 298 .ops = {
280 .open = nvhdmi_dig_playback_pcm_open, 299 .open = nvhdmi_dig_playback_pcm_open,
281 .close = nvhdmi_dig_playback_pcm_close_2ch, 300 .close = nvhdmi_dig_playback_pcm_close_2ch,
@@ -378,6 +397,7 @@ static int patch_nvhdmi_2ch(struct hda_codec *codec)
378static struct hda_codec_preset snd_hda_preset_nvhdmi[] = { 397static struct hda_codec_preset snd_hda_preset_nvhdmi[] = {
379 { .id = 0x10de0002, .name = "MCP78 HDMI", .patch = patch_nvhdmi_8ch }, 398 { .id = 0x10de0002, .name = "MCP78 HDMI", .patch = patch_nvhdmi_8ch },
380 { .id = 0x10de0003, .name = "MCP78 HDMI", .patch = patch_nvhdmi_8ch }, 399 { .id = 0x10de0003, .name = "MCP78 HDMI", .patch = patch_nvhdmi_8ch },
400 { .id = 0x10de0005, .name = "MCP78 HDMI", .patch = patch_nvhdmi_8ch },
381 { .id = 0x10de0006, .name = "MCP78 HDMI", .patch = patch_nvhdmi_8ch }, 401 { .id = 0x10de0006, .name = "MCP78 HDMI", .patch = patch_nvhdmi_8ch },
382 { .id = 0x10de0007, .name = "MCP7A HDMI", .patch = patch_nvhdmi_8ch }, 402 { .id = 0x10de0007, .name = "MCP7A HDMI", .patch = patch_nvhdmi_8ch },
383 { .id = 0x10de0067, .name = "MCP67 HDMI", .patch = patch_nvhdmi_2ch }, 403 { .id = 0x10de0067, .name = "MCP67 HDMI", .patch = patch_nvhdmi_2ch },
@@ -387,6 +407,7 @@ static struct hda_codec_preset snd_hda_preset_nvhdmi[] = {
387 407
388MODULE_ALIAS("snd-hda-codec-id:10de0002"); 408MODULE_ALIAS("snd-hda-codec-id:10de0002");
389MODULE_ALIAS("snd-hda-codec-id:10de0003"); 409MODULE_ALIAS("snd-hda-codec-id:10de0003");
410MODULE_ALIAS("snd-hda-codec-id:10de0005");
390MODULE_ALIAS("snd-hda-codec-id:10de0006"); 411MODULE_ALIAS("snd-hda-codec-id:10de0006");
391MODULE_ALIAS("snd-hda-codec-id:10de0007"); 412MODULE_ALIAS("snd-hda-codec-id:10de0007");
392MODULE_ALIAS("snd-hda-codec-id:10de0067"); 413MODULE_ALIAS("snd-hda-codec-id:10de0067");
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 7810d3dcad83..70583719282b 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -275,7 +275,7 @@ struct alc_spec {
275 struct snd_kcontrol_new *cap_mixer; /* capture mixer */ 275 struct snd_kcontrol_new *cap_mixer; /* capture mixer */
276 unsigned int beep_amp; /* beep amp value, set via set_beep_amp() */ 276 unsigned int beep_amp; /* beep amp value, set via set_beep_amp() */
277 277
278 const struct hda_verb *init_verbs[5]; /* initialization verbs 278 const struct hda_verb *init_verbs[10]; /* initialization verbs
279 * don't forget NULL 279 * don't forget NULL
280 * termination! 280 * termination!
281 */ 281 */
@@ -965,6 +965,8 @@ static void alc_automute_pin(struct hda_codec *codec)
965 unsigned int nid = spec->autocfg.hp_pins[0]; 965 unsigned int nid = spec->autocfg.hp_pins[0];
966 int i; 966 int i;
967 967
968 if (!nid)
969 return;
968 pincap = snd_hda_query_pin_caps(codec, nid); 970 pincap = snd_hda_query_pin_caps(codec, nid);
969 if (pincap & AC_PINCAP_TRIG_REQ) /* need trigger? */ 971 if (pincap & AC_PINCAP_TRIG_REQ) /* need trigger? */
970 snd_hda_codec_read(codec, nid, 0, AC_VERB_SET_PIN_SENSE, 0); 972 snd_hda_codec_read(codec, nid, 0, AC_VERB_SET_PIN_SENSE, 0);
@@ -1332,15 +1334,20 @@ do_sku:
1332 * when the external headphone out jack is plugged" 1334 * when the external headphone out jack is plugged"
1333 */ 1335 */
1334 if (!spec->autocfg.hp_pins[0]) { 1336 if (!spec->autocfg.hp_pins[0]) {
1337 hda_nid_t nid;
1335 tmp = (ass >> 11) & 0x3; /* HP to chassis */ 1338 tmp = (ass >> 11) & 0x3; /* HP to chassis */
1336 if (tmp == 0) 1339 if (tmp == 0)
1337 spec->autocfg.hp_pins[0] = porta; 1340 nid = porta;
1338 else if (tmp == 1) 1341 else if (tmp == 1)
1339 spec->autocfg.hp_pins[0] = porte; 1342 nid = porte;
1340 else if (tmp == 2) 1343 else if (tmp == 2)
1341 spec->autocfg.hp_pins[0] = portd; 1344 nid = portd;
1342 else 1345 else
1343 return 1; 1346 return 1;
1347 for (i = 0; i < spec->autocfg.line_outs; i++)
1348 if (spec->autocfg.line_out_pins[i] == nid)
1349 return 1;
1350 spec->autocfg.hp_pins[0] = nid;
1344 } 1351 }
1345 1352
1346 alc_init_auto_hp(codec); 1353 alc_init_auto_hp(codec);
@@ -1362,7 +1369,7 @@ static void alc_ssid_check(struct hda_codec *codec,
1362} 1369}
1363 1370
1364/* 1371/*
1365 * Fix-up pin default configurations 1372 * Fix-up pin default configurations and add default verbs
1366 */ 1373 */
1367 1374
1368struct alc_pincfg { 1375struct alc_pincfg {
@@ -1370,9 +1377,14 @@ struct alc_pincfg {
1370 u32 val; 1377 u32 val;
1371}; 1378};
1372 1379
1373static void alc_fix_pincfg(struct hda_codec *codec, 1380struct alc_fixup {
1381 const struct alc_pincfg *pins;
1382 const struct hda_verb *verbs;
1383};
1384
1385static void alc_pick_fixup(struct hda_codec *codec,
1374 const struct snd_pci_quirk *quirk, 1386 const struct snd_pci_quirk *quirk,
1375 const struct alc_pincfg **pinfix) 1387 const struct alc_fixup *fix)
1376{ 1388{
1377 const struct alc_pincfg *cfg; 1389 const struct alc_pincfg *cfg;
1378 1390
@@ -1380,9 +1392,14 @@ static void alc_fix_pincfg(struct hda_codec *codec,
1380 if (!quirk) 1392 if (!quirk)
1381 return; 1393 return;
1382 1394
1383 cfg = pinfix[quirk->value]; 1395 fix += quirk->value;
1384 for (; cfg->nid; cfg++) 1396 cfg = fix->pins;
1385 snd_hda_codec_set_pincfg(codec, cfg->nid, cfg->val); 1397 if (cfg) {
1398 for (; cfg->nid; cfg++)
1399 snd_hda_codec_set_pincfg(codec, cfg->nid, cfg->val);
1400 }
1401 if (fix->verbs)
1402 add_verb(codec->spec, fix->verbs);
1386} 1403}
1387 1404
1388/* 1405/*
@@ -4667,9 +4684,9 @@ static int alc880_parse_auto_config(struct hda_codec *codec)
4667 spec->multiout.dig_out_nid = dig_nid; 4684 spec->multiout.dig_out_nid = dig_nid;
4668 else { 4685 else {
4669 spec->multiout.slave_dig_outs = spec->slave_dig_outs; 4686 spec->multiout.slave_dig_outs = spec->slave_dig_outs;
4670 spec->slave_dig_outs[i - 1] = dig_nid; 4687 if (i >= ARRAY_SIZE(spec->slave_dig_outs) - 1)
4671 if (i == ARRAY_SIZE(spec->slave_dig_outs) - 1)
4672 break; 4688 break;
4689 spec->slave_dig_outs[i - 1] = dig_nid;
4673 } 4690 }
4674 } 4691 }
4675 if (spec->autocfg.dig_in_pin) 4692 if (spec->autocfg.dig_in_pin)
@@ -6232,7 +6249,7 @@ static struct snd_pci_quirk alc260_cfg_tbl[] = {
6232 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_ACER), 6249 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_ACER),
6233 SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FAVORIT100), 6250 SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FAVORIT100),
6234 SND_PCI_QUIRK(0x103c, 0x2808, "HP d5700", ALC260_HP_3013), 6251 SND_PCI_QUIRK(0x103c, 0x2808, "HP d5700", ALC260_HP_3013),
6235 SND_PCI_QUIRK(0x103c, 0x280a, "HP d5750", ALC260_HP_3013), 6252 SND_PCI_QUIRK(0x103c, 0x280a, "HP d5750", ALC260_AUTO), /* no quirk */
6236 SND_PCI_QUIRK(0x103c, 0x3010, "HP", ALC260_HP_3013), 6253 SND_PCI_QUIRK(0x103c, 0x3010, "HP", ALC260_HP_3013),
6237 SND_PCI_QUIRK(0x103c, 0x3011, "HP", ALC260_HP_3013), 6254 SND_PCI_QUIRK(0x103c, 0x3011, "HP", ALC260_HP_3013),
6238 SND_PCI_QUIRK(0x103c, 0x3012, "HP", ALC260_HP_DC7600), 6255 SND_PCI_QUIRK(0x103c, 0x3012, "HP", ALC260_HP_DC7600),
@@ -8894,10 +8911,11 @@ static struct snd_pci_quirk alc882_ssid_cfg_tbl[] = {
8894 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC885_MBP3), 8911 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC885_MBP3),
8895 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_IMAC24), 8912 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_IMAC24),
8896 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC885_MB5), 8913 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC885_MB5),
8897 /* FIXME: HP jack sense seems not working for MBP 5,1, so apparently 8914 /* FIXME: HP jack sense seems not working for MBP 5,1 or 5,2,
8898 * no perfect solution yet 8915 * so apparently no perfect solution yet
8899 */ 8916 */
8900 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC885_MB5), 8917 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC885_MB5),
8918 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC885_MB5),
8901 {} /* terminator */ 8919 {} /* terminator */
8902}; 8920};
8903 8921
@@ -9593,11 +9611,13 @@ static struct alc_pincfg alc882_abit_aw9d_pinfix[] = {
9593 { } 9611 { }
9594}; 9612};
9595 9613
9596static const struct alc_pincfg *alc882_pin_fixes[] = { 9614static const struct alc_fixup alc882_fixups[] = {
9597 [PINFIX_ABIT_AW9D_MAX] = alc882_abit_aw9d_pinfix, 9615 [PINFIX_ABIT_AW9D_MAX] = {
9616 .pins = alc882_abit_aw9d_pinfix
9617 },
9598}; 9618};
9599 9619
9600static struct snd_pci_quirk alc882_pinfix_tbl[] = { 9620static struct snd_pci_quirk alc882_fixup_tbl[] = {
9601 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", PINFIX_ABIT_AW9D_MAX), 9621 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", PINFIX_ABIT_AW9D_MAX),
9602 {} 9622 {}
9603}; 9623};
@@ -9794,9 +9814,9 @@ static int alc882_parse_auto_config(struct hda_codec *codec)
9794 spec->multiout.dig_out_nid = dig_nid; 9814 spec->multiout.dig_out_nid = dig_nid;
9795 else { 9815 else {
9796 spec->multiout.slave_dig_outs = spec->slave_dig_outs; 9816 spec->multiout.slave_dig_outs = spec->slave_dig_outs;
9797 spec->slave_dig_outs[i - 1] = dig_nid; 9817 if (i >= ARRAY_SIZE(spec->slave_dig_outs) - 1)
9798 if (i == ARRAY_SIZE(spec->slave_dig_outs) - 1)
9799 break; 9818 break;
9819 spec->slave_dig_outs[i - 1] = dig_nid;
9800 } 9820 }
9801 } 9821 }
9802 if (spec->autocfg.dig_in_pin) 9822 if (spec->autocfg.dig_in_pin)
@@ -9869,7 +9889,7 @@ static int patch_alc882(struct hda_codec *codec)
9869 board_config = ALC882_AUTO; 9889 board_config = ALC882_AUTO;
9870 } 9890 }
9871 9891
9872 alc_fix_pincfg(codec, alc882_pinfix_tbl, alc882_pin_fixes); 9892 alc_pick_fixup(codec, alc882_fixup_tbl, alc882_fixups);
9873 9893
9874 if (board_config == ALC882_AUTO) { 9894 if (board_config == ALC882_AUTO) {
9875 /* automatic parse from the BIOS config */ 9895 /* automatic parse from the BIOS config */
@@ -11441,6 +11461,8 @@ static struct snd_pci_quirk alc262_cfg_tbl[] = {
11441 SND_PCI_QUIRK(0x104d, 0x820f, "Sony ASSAMD", ALC262_SONY_ASSAMD), 11461 SND_PCI_QUIRK(0x104d, 0x820f, "Sony ASSAMD", ALC262_SONY_ASSAMD),
11442 SND_PCI_QUIRK(0x104d, 0x9016, "Sony VAIO", ALC262_AUTO), /* dig-only */ 11462 SND_PCI_QUIRK(0x104d, 0x9016, "Sony VAIO", ALC262_AUTO), /* dig-only */
11443 SND_PCI_QUIRK(0x104d, 0x9025, "Sony VAIO Z21MN", ALC262_TOSHIBA_S06), 11463 SND_PCI_QUIRK(0x104d, 0x9025, "Sony VAIO Z21MN", ALC262_TOSHIBA_S06),
11464 SND_PCI_QUIRK(0x104d, 0x9035, "Sony VAIO VGN-FW170J", ALC262_AUTO),
11465 SND_PCI_QUIRK(0x104d, 0x9047, "Sony VAIO Type G", ALC262_AUTO),
11444 SND_PCI_QUIRK_MASK(0x104d, 0xff00, 0x9000, "Sony VAIO", 11466 SND_PCI_QUIRK_MASK(0x104d, 0xff00, 0x9000, "Sony VAIO",
11445 ALC262_SONY_ASSAMD), 11467 ALC262_SONY_ASSAMD),
11446 SND_PCI_QUIRK(0x1179, 0x0001, "Toshiba dynabook SS RX1", 11468 SND_PCI_QUIRK(0x1179, 0x0001, "Toshiba dynabook SS RX1",
@@ -12585,7 +12607,8 @@ static struct snd_pci_quirk alc268_cfg_tbl[] = {
12585 SND_PCI_QUIRK(0x1025, 0x015b, "Acer Aspire One", 12607 SND_PCI_QUIRK(0x1025, 0x015b, "Acer Aspire One",
12586 ALC268_ACER_ASPIRE_ONE), 12608 ALC268_ACER_ASPIRE_ONE),
12587 SND_PCI_QUIRK(0x1028, 0x0253, "Dell OEM", ALC268_DELL), 12609 SND_PCI_QUIRK(0x1028, 0x0253, "Dell OEM", ALC268_DELL),
12588 SND_PCI_QUIRK(0x1028, 0x02b0, "Dell Inspiron Mini9", ALC268_DELL), 12610 SND_PCI_QUIRK_MASK(0x1028, 0xfff0, 0x02b0,
12611 "Dell Inspiron Mini9/Vostro A90", ALC268_DELL),
12589 /* almost compatible with toshiba but with optional digital outs; 12612 /* almost compatible with toshiba but with optional digital outs;
12590 * auto-probing seems working fine 12613 * auto-probing seems working fine
12591 */ 12614 */
@@ -12842,12 +12865,15 @@ static int patch_alc268(struct hda_codec *codec)
12842 unsigned int wcap = get_wcaps(codec, 0x07); 12865 unsigned int wcap = get_wcaps(codec, 0x07);
12843 int i; 12866 int i;
12844 12867
12868 spec->capsrc_nids = alc268_capsrc_nids;
12845 /* get type */ 12869 /* get type */
12846 wcap = get_wcaps_type(wcap); 12870 wcap = get_wcaps_type(wcap);
12847 if (spec->auto_mic || 12871 if (spec->auto_mic ||
12848 wcap != AC_WID_AUD_IN || spec->input_mux->num_items == 1) { 12872 wcap != AC_WID_AUD_IN || spec->input_mux->num_items == 1) {
12849 spec->adc_nids = alc268_adc_nids_alt; 12873 spec->adc_nids = alc268_adc_nids_alt;
12850 spec->num_adc_nids = ARRAY_SIZE(alc268_adc_nids_alt); 12874 spec->num_adc_nids = ARRAY_SIZE(alc268_adc_nids_alt);
12875 if (spec->auto_mic)
12876 fixup_automic_adc(codec);
12851 if (spec->auto_mic || spec->input_mux->num_items == 1) 12877 if (spec->auto_mic || spec->input_mux->num_items == 1)
12852 add_mixer(spec, alc268_capture_nosrc_mixer); 12878 add_mixer(spec, alc268_capture_nosrc_mixer);
12853 else 12879 else
@@ -12857,7 +12883,6 @@ static int patch_alc268(struct hda_codec *codec)
12857 spec->num_adc_nids = ARRAY_SIZE(alc268_adc_nids); 12883 spec->num_adc_nids = ARRAY_SIZE(alc268_adc_nids);
12858 add_mixer(spec, alc268_capture_mixer); 12884 add_mixer(spec, alc268_capture_mixer);
12859 } 12885 }
12860 spec->capsrc_nids = alc268_capsrc_nids;
12861 /* set default input source */ 12886 /* set default input source */
12862 for (i = 0; i < spec->num_adc_nids; i++) 12887 for (i = 0; i < spec->num_adc_nids; i++)
12863 snd_hda_codec_write_cache(codec, alc268_capsrc_nids[i], 12888 snd_hda_codec_write_cache(codec, alc268_capsrc_nids[i],
@@ -14357,15 +14382,16 @@ static void alc861_auto_init_multi_out(struct hda_codec *codec)
14357static void alc861_auto_init_hp_out(struct hda_codec *codec) 14382static void alc861_auto_init_hp_out(struct hda_codec *codec)
14358{ 14383{
14359 struct alc_spec *spec = codec->spec; 14384 struct alc_spec *spec = codec->spec;
14360 hda_nid_t pin;
14361 14385
14362 pin = spec->autocfg.hp_pins[0]; 14386 if (spec->autocfg.hp_outs)
14363 if (pin) 14387 alc861_auto_set_output_and_unmute(codec,
14364 alc861_auto_set_output_and_unmute(codec, pin, PIN_HP, 14388 spec->autocfg.hp_pins[0],
14389 PIN_HP,
14365 spec->multiout.hp_nid); 14390 spec->multiout.hp_nid);
14366 pin = spec->autocfg.speaker_pins[0]; 14391 if (spec->autocfg.speaker_outs)
14367 if (pin) 14392 alc861_auto_set_output_and_unmute(codec,
14368 alc861_auto_set_output_and_unmute(codec, pin, PIN_OUT, 14393 spec->autocfg.speaker_pins[0],
14394 PIN_OUT,
14369 spec->multiout.dac_nids[0]); 14395 spec->multiout.dac_nids[0]);
14370} 14396}
14371 14397
@@ -15158,7 +15184,7 @@ static struct snd_pci_quirk alc861vd_cfg_tbl[] = {
15158 SND_PCI_QUIRK(0x1019, 0xa88d, "Realtek ALC660 demo", ALC660VD_3ST), 15184 SND_PCI_QUIRK(0x1019, 0xa88d, "Realtek ALC660 demo", ALC660VD_3ST),
15159 SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_HP), 15185 SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_HP),
15160 SND_PCI_QUIRK(0x1043, 0x12e2, "Asus z35m", ALC660VD_3ST), 15186 SND_PCI_QUIRK(0x1043, 0x12e2, "Asus z35m", ALC660VD_3ST),
15161 SND_PCI_QUIRK(0x1043, 0x1339, "Asus G1", ALC660VD_3ST), 15187 /*SND_PCI_QUIRK(0x1043, 0x1339, "Asus G1", ALC660VD_3ST),*/ /* auto */
15162 SND_PCI_QUIRK(0x1043, 0x1633, "Asus V1Sn", ALC660VD_ASUS_V1S), 15188 SND_PCI_QUIRK(0x1043, 0x1633, "Asus V1Sn", ALC660VD_ASUS_V1S),
15163 SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS", ALC660VD_3ST_DIG), 15189 SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS", ALC660VD_3ST_DIG),
15164 SND_PCI_QUIRK(0x10de, 0x03f0, "Realtek ALC660 demo", ALC660VD_3ST), 15190 SND_PCI_QUIRK(0x10de, 0x03f0, "Realtek ALC660 demo", ALC660VD_3ST),
@@ -15551,6 +15577,29 @@ static void alc861vd_auto_init(struct hda_codec *codec)
15551 alc_inithook(codec); 15577 alc_inithook(codec);
15552} 15578}
15553 15579
15580enum {
15581 ALC660VD_FIX_ASUS_GPIO1
15582};
15583
15584/* reset GPIO1 */
15585static const struct hda_verb alc660vd_fix_asus_gpio1_verbs[] = {
15586 {0x01, AC_VERB_SET_GPIO_MASK, 0x03},
15587 {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x01},
15588 {0x01, AC_VERB_SET_GPIO_DATA, 0x01},
15589 { }
15590};
15591
15592static const struct alc_fixup alc861vd_fixups[] = {
15593 [ALC660VD_FIX_ASUS_GPIO1] = {
15594 .verbs = alc660vd_fix_asus_gpio1_verbs,
15595 },
15596};
15597
15598static struct snd_pci_quirk alc861vd_fixup_tbl[] = {
15599 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1),
15600 {}
15601};
15602
15554static int patch_alc861vd(struct hda_codec *codec) 15603static int patch_alc861vd(struct hda_codec *codec)
15555{ 15604{
15556 struct alc_spec *spec; 15605 struct alc_spec *spec;
@@ -15572,6 +15621,8 @@ static int patch_alc861vd(struct hda_codec *codec)
15572 board_config = ALC861VD_AUTO; 15621 board_config = ALC861VD_AUTO;
15573 } 15622 }
15574 15623
15624 alc_pick_fixup(codec, alc861vd_fixup_tbl, alc861vd_fixups);
15625
15575 if (board_config == ALC861VD_AUTO) { 15626 if (board_config == ALC861VD_AUTO) {
15576 /* automatic parse from the BIOS config */ 15627 /* automatic parse from the BIOS config */
15577 err = alc861vd_parse_auto_config(codec); 15628 err = alc861vd_parse_auto_config(codec);
@@ -17329,7 +17380,7 @@ static int alc662_auto_create_extra_out(struct hda_codec *codec, hda_nid_t pin,
17329 17380
17330/* create playback/capture controls for input pins */ 17381/* create playback/capture controls for input pins */
17331#define alc662_auto_create_input_ctls \ 17382#define alc662_auto_create_input_ctls \
17332 alc880_auto_create_input_ctls 17383 alc882_auto_create_input_ctls
17333 17384
17334static void alc662_auto_set_output_and_unmute(struct hda_codec *codec, 17385static void alc662_auto_set_output_and_unmute(struct hda_codec *codec,
17335 hda_nid_t nid, int pin_type, 17386 hda_nid_t nid, int pin_type,
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index a9b26828a651..86de305fc9f2 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -28,6 +28,7 @@
28#include <linux/delay.h> 28#include <linux/delay.h>
29#include <linux/slab.h> 29#include <linux/slab.h>
30#include <linux/pci.h> 30#include <linux/pci.h>
31#include <linux/dmi.h>
31#include <sound/core.h> 32#include <sound/core.h>
32#include <sound/asoundef.h> 33#include <sound/asoundef.h>
33#include <sound/jack.h> 34#include <sound/jack.h>
@@ -158,6 +159,7 @@ enum {
158 STAC_D965_5ST_NO_FP, 159 STAC_D965_5ST_NO_FP,
159 STAC_DELL_3ST, 160 STAC_DELL_3ST,
160 STAC_DELL_BIOS, 161 STAC_DELL_BIOS,
162 STAC_927X_VOLKNOB,
161 STAC_927X_MODELS 163 STAC_927X_MODELS
162}; 164};
163 165
@@ -907,6 +909,16 @@ static struct hda_verb d965_core_init[] = {
907 {} 909 {}
908}; 910};
909 911
912static struct hda_verb dell_3st_core_init[] = {
913 /* don't set delta bit */
914 {0x24, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0x7f},
915 /* unmute node 0x1b */
916 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000},
917 /* select node 0x03 as DAC */
918 {0x0b, AC_VERB_SET_CONNECT_SEL, 0x01},
919 {}
920};
921
910static struct hda_verb stac927x_core_init[] = { 922static struct hda_verb stac927x_core_init[] = {
911 /* set master volume and direct control */ 923 /* set master volume and direct control */
912 { 0x24, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xff}, 924 { 0x24, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xff},
@@ -915,6 +927,14 @@ static struct hda_verb stac927x_core_init[] = {
915 {} 927 {}
916}; 928};
917 929
930static struct hda_verb stac927x_volknob_core_init[] = {
931 /* don't set delta bit */
932 {0x24, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0x7f},
933 /* enable analog pc beep path */
934 {0x01, AC_VERB_SET_DIGI_CONVERT_2, 1 << 5},
935 {}
936};
937
918static struct hda_verb stac9205_core_init[] = { 938static struct hda_verb stac9205_core_init[] = {
919 /* set master volume and direct control */ 939 /* set master volume and direct control */
920 { 0x24, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xff}, 940 { 0x24, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xff},
@@ -1570,6 +1590,8 @@ static struct snd_pci_quirk stac92hd73xx_cfg_tbl[] = {
1570 "Dell Studio 17", STAC_DELL_M6_DMIC), 1590 "Dell Studio 17", STAC_DELL_M6_DMIC),
1571 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02be, 1591 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02be,
1572 "Dell Studio 1555", STAC_DELL_M6_DMIC), 1592 "Dell Studio 1555", STAC_DELL_M6_DMIC),
1593 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02bd,
1594 "Dell Studio 1557", STAC_DELL_M6_DMIC),
1573 {} /* terminator */ 1595 {} /* terminator */
1574}; 1596};
1575 1597
@@ -1674,6 +1696,8 @@ static struct snd_pci_quirk stac92hd71bxx_cfg_tbl[] = {
1674 "DFI LanParty", STAC_92HD71BXX_REF), 1696 "DFI LanParty", STAC_92HD71BXX_REF),
1675 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30fb, 1697 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30fb,
1676 "HP dv4-1222nr", STAC_HP_DV4_1222NR), 1698 "HP dv4-1222nr", STAC_HP_DV4_1222NR),
1699 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x1720,
1700 "HP", STAC_HP_DV5),
1677 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x3080, 1701 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x3080,
1678 "HP", STAC_HP_DV5), 1702 "HP", STAC_HP_DV5),
1679 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x30f0, 1703 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x30f0,
@@ -1999,6 +2023,7 @@ static unsigned int *stac927x_brd_tbl[STAC_927X_MODELS] = {
1999 [STAC_D965_5ST_NO_FP] = d965_5st_no_fp_pin_configs, 2023 [STAC_D965_5ST_NO_FP] = d965_5st_no_fp_pin_configs,
2000 [STAC_DELL_3ST] = dell_3st_pin_configs, 2024 [STAC_DELL_3ST] = dell_3st_pin_configs,
2001 [STAC_DELL_BIOS] = NULL, 2025 [STAC_DELL_BIOS] = NULL,
2026 [STAC_927X_VOLKNOB] = NULL,
2002}; 2027};
2003 2028
2004static const char *stac927x_models[STAC_927X_MODELS] = { 2029static const char *stac927x_models[STAC_927X_MODELS] = {
@@ -2010,6 +2035,7 @@ static const char *stac927x_models[STAC_927X_MODELS] = {
2010 [STAC_D965_5ST_NO_FP] = "5stack-no-fp", 2035 [STAC_D965_5ST_NO_FP] = "5stack-no-fp",
2011 [STAC_DELL_3ST] = "dell-3stack", 2036 [STAC_DELL_3ST] = "dell-3stack",
2012 [STAC_DELL_BIOS] = "dell-bios", 2037 [STAC_DELL_BIOS] = "dell-bios",
2038 [STAC_927X_VOLKNOB] = "volknob",
2013}; 2039};
2014 2040
2015static struct snd_pci_quirk stac927x_cfg_tbl[] = { 2041static struct snd_pci_quirk stac927x_cfg_tbl[] = {
@@ -2045,6 +2071,8 @@ static struct snd_pci_quirk stac927x_cfg_tbl[] = {
2045 "Intel D965", STAC_D965_5ST), 2071 "Intel D965", STAC_D965_5ST),
2046 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_INTEL, 0xff00, 0x2500, 2072 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_INTEL, 0xff00, 0x2500,
2047 "Intel D965", STAC_D965_5ST), 2073 "Intel D965", STAC_D965_5ST),
2074 /* volume-knob fixes */
2075 SND_PCI_QUIRK_VENDOR(0x10cf, "FSC", STAC_927X_VOLKNOB),
2048 {} /* terminator */ 2076 {} /* terminator */
2049}; 2077};
2050 2078
@@ -4642,6 +4670,26 @@ static void stac92xx_unsol_event(struct hda_codec *codec, unsigned int res)
4642 } 4670 }
4643} 4671}
4644 4672
4673static int hp_bseries_system(u32 subsystem_id)
4674{
4675 switch (subsystem_id) {
4676 case 0x103c307e:
4677 case 0x103c307f:
4678 case 0x103c3080:
4679 case 0x103c3081:
4680 case 0x103c1722:
4681 case 0x103c1723:
4682 case 0x103c1724:
4683 case 0x103c1725:
4684 case 0x103c1726:
4685 case 0x103c1727:
4686 case 0x103c1728:
4687 case 0x103c1729:
4688 return 1;
4689 }
4690 return 0;
4691}
4692
4645#ifdef CONFIG_PROC_FS 4693#ifdef CONFIG_PROC_FS
4646static void stac92hd_proc_hook(struct snd_info_buffer *buffer, 4694static void stac92hd_proc_hook(struct snd_info_buffer *buffer,
4647 struct hda_codec *codec, hda_nid_t nid) 4695 struct hda_codec *codec, hda_nid_t nid)
@@ -4731,6 +4779,11 @@ static int stac92xx_hp_check_power_status(struct hda_codec *codec,
4731 else 4779 else
4732 spec->gpio_data |= spec->gpio_led; /* white */ 4780 spec->gpio_data |= spec->gpio_led; /* white */
4733 4781
4782 if (hp_bseries_system(codec->subsystem_id)) {
4783 /* LED state is inverted on these systems */
4784 spec->gpio_data ^= spec->gpio_led;
4785 }
4786
4734 stac_gpio_set(codec, spec->gpio_mask, 4787 stac_gpio_set(codec, spec->gpio_mask,
4735 spec->gpio_dir, 4788 spec->gpio_dir,
4736 spec->gpio_data); 4789 spec->gpio_data);
@@ -5220,6 +5273,7 @@ static int patch_stac92hd71bxx(struct hda_codec *codec)
5220{ 5273{
5221 struct sigmatel_spec *spec; 5274 struct sigmatel_spec *spec;
5222 struct hda_verb *unmute_init = stac92hd71bxx_unmute_core_init; 5275 struct hda_verb *unmute_init = stac92hd71bxx_unmute_core_init;
5276 unsigned int pin_cfg;
5223 int err = 0; 5277 int err = 0;
5224 5278
5225 spec = kzalloc(sizeof(*spec), GFP_KERNEL); 5279 spec = kzalloc(sizeof(*spec), GFP_KERNEL);
@@ -5403,6 +5457,45 @@ again:
5403 break; 5457 break;
5404 } 5458 }
5405 5459
5460 if (hp_bseries_system(codec->subsystem_id)) {
5461 pin_cfg = snd_hda_codec_get_pincfg(codec, 0x0f);
5462 if (get_defcfg_device(pin_cfg) == AC_JACK_LINE_OUT ||
5463 get_defcfg_device(pin_cfg) == AC_JACK_SPEAKER ||
5464 get_defcfg_device(pin_cfg) == AC_JACK_HP_OUT) {
5465 /* It was changed in the BIOS to just satisfy MS DTM.
5466 * Lets turn it back into slaved HP
5467 */
5468 pin_cfg = (pin_cfg & (~AC_DEFCFG_DEVICE))
5469 | (AC_JACK_HP_OUT <<
5470 AC_DEFCFG_DEVICE_SHIFT);
5471 pin_cfg = (pin_cfg & (~(AC_DEFCFG_DEF_ASSOC
5472 | AC_DEFCFG_SEQUENCE)))
5473 | 0x1f;
5474 snd_hda_codec_set_pincfg(codec, 0x0f, pin_cfg);
5475 }
5476 }
5477
5478 if ((codec->subsystem_id >> 16) == PCI_VENDOR_ID_HP) {
5479 const struct dmi_device *dev = NULL;
5480 while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING,
5481 NULL, dev))) {
5482 if (strcmp(dev->name, "HP_Mute_LED_1")) {
5483 switch (codec->vendor_id) {
5484 case 0x111d7608:
5485 spec->gpio_led = 0x01;
5486 break;
5487 case 0x111d7600:
5488 case 0x111d7601:
5489 case 0x111d7602:
5490 case 0x111d7603:
5491 spec->gpio_led = 0x08;
5492 break;
5493 }
5494 break;
5495 }
5496 }
5497 }
5498
5406#ifdef CONFIG_SND_HDA_POWER_SAVE 5499#ifdef CONFIG_SND_HDA_POWER_SAVE
5407 if (spec->gpio_led) { 5500 if (spec->gpio_led) {
5408 spec->gpio_mask |= spec->gpio_led; 5501 spec->gpio_mask |= spec->gpio_led;
@@ -5612,10 +5705,14 @@ static int patch_stac927x(struct hda_codec *codec)
5612 spec->dmic_nids = stac927x_dmic_nids; 5705 spec->dmic_nids = stac927x_dmic_nids;
5613 spec->num_dmics = STAC927X_NUM_DMICS; 5706 spec->num_dmics = STAC927X_NUM_DMICS;
5614 5707
5615 spec->init = d965_core_init; 5708 spec->init = dell_3st_core_init;
5616 spec->dmux_nids = stac927x_dmux_nids; 5709 spec->dmux_nids = stac927x_dmux_nids;
5617 spec->num_dmuxes = ARRAY_SIZE(stac927x_dmux_nids); 5710 spec->num_dmuxes = ARRAY_SIZE(stac927x_dmux_nids);
5618 break; 5711 break;
5712 case STAC_927X_VOLKNOB:
5713 spec->num_dmics = 0;
5714 spec->init = stac927x_volknob_core_init;
5715 break;
5619 default: 5716 default:
5620 spec->num_dmics = 0; 5717 spec->num_dmics = 0;
5621 spec->init = stac927x_core_init; 5718 spec->init = stac927x_core_init;
diff --git a/sound/pci/ice1712/amp.c b/sound/pci/ice1712/amp.c
index 37564300b50d..6da21a2bcade 100644
--- a/sound/pci/ice1712/amp.c
+++ b/sound/pci/ice1712/amp.c
@@ -52,11 +52,13 @@ static int __devinit snd_vt1724_amp_init(struct snd_ice1712 *ice)
52 52
53 /* only use basic functionality for now */ 53 /* only use basic functionality for now */
54 54
55 ice->num_total_dacs = 2; /* only PSDOUT0 is connected */ 55 /* VT1616 6ch codec connected to PSDOUT0 using packed mode */
56 ice->num_total_dacs = 6;
56 ice->num_total_adcs = 2; 57 ice->num_total_adcs = 2;
57 58
58 /* Chaintech AV-710 has another codecs, which need initialization */ 59 /* Chaintech AV-710 has another WM8728 codec connected to PSDOUT4
59 /* initialize WM8728 codec */ 60 (shared with the SPDIF output). Mixer control for this codec
61 is not yet supported. */
60 if (ice->eeprom.subvendor == VT1724_SUBDEVICE_AV710) { 62 if (ice->eeprom.subvendor == VT1724_SUBDEVICE_AV710) {
61 for (i = 0; i < ARRAY_SIZE(wm_inits); i += 2) 63 for (i = 0; i < ARRAY_SIZE(wm_inits); i += 2)
62 wm_put(ice, wm_inits[i], wm_inits[i+1]); 64 wm_put(ice, wm_inits[i], wm_inits[i+1]);
diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c
index cecf1ffeeaaa..d74033a2cfbe 100644
--- a/sound/pci/ice1712/ice1712.c
+++ b/sound/pci/ice1712/ice1712.c
@@ -2259,7 +2259,7 @@ static int snd_ice1712_pro_peak_get(struct snd_kcontrol *kcontrol,
2259} 2259}
2260 2260
2261static struct snd_kcontrol_new snd_ice1712_mixer_pro_peak __devinitdata = { 2261static struct snd_kcontrol_new snd_ice1712_mixer_pro_peak __devinitdata = {
2262 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2262 .iface = SNDRV_CTL_ELEM_IFACE_PCM,
2263 .name = "Multi Track Peak", 2263 .name = "Multi Track Peak",
2264 .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, 2264 .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE,
2265 .info = snd_ice1712_pro_peak_info, 2265 .info = snd_ice1712_pro_peak_info,
diff --git a/sound/pci/ice1712/ice1712.h b/sound/pci/ice1712/ice1712.h
index 9da2dae64c5b..d063149e7047 100644
--- a/sound/pci/ice1712/ice1712.h
+++ b/sound/pci/ice1712/ice1712.h
@@ -382,8 +382,8 @@ struct snd_ice1712 {
382#ifdef CONFIG_PM 382#ifdef CONFIG_PM
383 int (*pm_suspend)(struct snd_ice1712 *); 383 int (*pm_suspend)(struct snd_ice1712 *);
384 int (*pm_resume)(struct snd_ice1712 *); 384 int (*pm_resume)(struct snd_ice1712 *);
385 int pm_suspend_enabled:1; 385 unsigned int pm_suspend_enabled:1;
386 int pm_saved_is_spdif_master:1; 386 unsigned int pm_saved_is_spdif_master:1;
387 unsigned int pm_saved_spdif_ctrl; 387 unsigned int pm_saved_spdif_ctrl;
388 unsigned char pm_saved_spdif_cfg; 388 unsigned char pm_saved_spdif_cfg;
389 unsigned int pm_saved_route; 389 unsigned int pm_saved_route;
diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c
index af6e00148621..10fc92c05574 100644
--- a/sound/pci/ice1712/ice1724.c
+++ b/sound/pci/ice1712/ice1724.c
@@ -648,7 +648,7 @@ static int snd_vt1724_set_pro_rate(struct snd_ice1712 *ice, unsigned int rate,
648 (inb(ICEMT1724(ice, DMA_PAUSE)) & DMA_PAUSES)) { 648 (inb(ICEMT1724(ice, DMA_PAUSE)) & DMA_PAUSES)) {
649 /* running? we cannot change the rate now... */ 649 /* running? we cannot change the rate now... */
650 spin_unlock_irqrestore(&ice->reg_lock, flags); 650 spin_unlock_irqrestore(&ice->reg_lock, flags);
651 return -EBUSY; 651 return ((rate == ice->cur_rate) && !force) ? 0 : -EBUSY;
652 } 652 }
653 if (!force && is_pro_rate_locked(ice)) { 653 if (!force && is_pro_rate_locked(ice)) {
654 spin_unlock_irqrestore(&ice->reg_lock, flags); 654 spin_unlock_irqrestore(&ice->reg_lock, flags);
@@ -1294,7 +1294,7 @@ static int __devinit snd_vt1724_pcm_spdif(struct snd_ice1712 *ice, int device)
1294 1294
1295 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, 1295 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
1296 snd_dma_pci_data(ice->pci), 1296 snd_dma_pci_data(ice->pci),
1297 64*1024, 64*1024); 1297 256*1024, 256*1024);
1298 1298
1299 ice->pcm = pcm; 1299 ice->pcm = pcm;
1300 1300
@@ -1408,7 +1408,7 @@ static int __devinit snd_vt1724_pcm_indep(struct snd_ice1712 *ice, int device)
1408 1408
1409 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, 1409 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
1410 snd_dma_pci_data(ice->pci), 1410 snd_dma_pci_data(ice->pci),
1411 64*1024, 64*1024); 1411 256*1024, 256*1024);
1412 1412
1413 ice->pcm_ds = pcm; 1413 ice->pcm_ds = pcm;
1414 1414
@@ -2110,7 +2110,7 @@ static int snd_vt1724_pro_peak_get(struct snd_kcontrol *kcontrol,
2110} 2110}
2111 2111
2112static struct snd_kcontrol_new snd_vt1724_mixer_pro_peak __devinitdata = { 2112static struct snd_kcontrol_new snd_vt1724_mixer_pro_peak __devinitdata = {
2113 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2113 .iface = SNDRV_CTL_ELEM_IFACE_PCM,
2114 .name = "Multi Track Peak", 2114 .name = "Multi Track Peak",
2115 .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, 2115 .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE,
2116 .info = snd_vt1724_pro_peak_info, 2116 .info = snd_vt1724_pro_peak_info,
diff --git a/sound/pci/ice1712/prodigy_hifi.c b/sound/pci/ice1712/prodigy_hifi.c
index c75515f5be6f..6a9fee3ee78f 100644
--- a/sound/pci/ice1712/prodigy_hifi.c
+++ b/sound/pci/ice1712/prodigy_hifi.c
@@ -1100,7 +1100,7 @@ static void ak4396_init(struct snd_ice1712 *ice)
1100} 1100}
1101 1101
1102#ifdef CONFIG_PM 1102#ifdef CONFIG_PM
1103static int __devinit prodigy_hd2_resume(struct snd_ice1712 *ice) 1103static int prodigy_hd2_resume(struct snd_ice1712 *ice)
1104{ 1104{
1105 /* initialize ak4396 codec and restore previous mixer volumes */ 1105 /* initialize ak4396 codec and restore previous mixer volumes */
1106 struct prodigy_hifi_spec *spec = ice->spec; 1106 struct prodigy_hifi_spec *spec = ice->spec;
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
index 754867ed4785..aac20fb4aad2 100644
--- a/sound/pci/intel8x0.c
+++ b/sound/pci/intel8x0.c
@@ -1950,6 +1950,12 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = {
1950 }, 1950 },
1951 { 1951 {
1952 .subvendor = 0x104d, 1952 .subvendor = 0x104d,
1953 .subdevice = 0x8144,
1954 .name = "Sony",
1955 .type = AC97_TUNE_INV_EAPD
1956 },
1957 {
1958 .subvendor = 0x104d,
1953 .subdevice = 0x8197, 1959 .subdevice = 0x8197,
1954 .name = "Sony S1XP", 1960 .name = "Sony S1XP",
1955 .type = AC97_TUNE_INV_EAPD 1961 .type = AC97_TUNE_INV_EAPD
diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c
index acfa4760da49..8a332d2f615c 100644
--- a/sound/pci/via82xx.c
+++ b/sound/pci/via82xx.c
@@ -386,6 +386,7 @@ struct via82xx {
386 386
387 struct snd_pcm *pcms[2]; 387 struct snd_pcm *pcms[2];
388 struct snd_rawmidi *rmidi; 388 struct snd_rawmidi *rmidi;
389 struct snd_kcontrol *dxs_controls[4];
389 390
390 struct snd_ac97_bus *ac97_bus; 391 struct snd_ac97_bus *ac97_bus;
391 struct snd_ac97 *ac97; 392 struct snd_ac97 *ac97;
@@ -1216,9 +1217,9 @@ static int snd_via82xx_pcm_open(struct via82xx *chip, struct viadev *viadev,
1216 1217
1217 1218
1218/* 1219/*
1219 * open callback for playback on via686 and via823x DSX 1220 * open callback for playback on via686
1220 */ 1221 */
1221static int snd_via82xx_playback_open(struct snd_pcm_substream *substream) 1222static int snd_via686_playback_open(struct snd_pcm_substream *substream)
1222{ 1223{
1223 struct via82xx *chip = snd_pcm_substream_chip(substream); 1224 struct via82xx *chip = snd_pcm_substream_chip(substream);
1224 struct viadev *viadev = &chip->devs[chip->playback_devno + substream->number]; 1225 struct viadev *viadev = &chip->devs[chip->playback_devno + substream->number];
@@ -1230,6 +1231,32 @@ static int snd_via82xx_playback_open(struct snd_pcm_substream *substream)
1230} 1231}
1231 1232
1232/* 1233/*
1234 * open callback for playback on via823x DXS
1235 */
1236static int snd_via8233_playback_open(struct snd_pcm_substream *substream)
1237{
1238 struct via82xx *chip = snd_pcm_substream_chip(substream);
1239 struct viadev *viadev;
1240 unsigned int stream;
1241 int err;
1242
1243 viadev = &chip->devs[chip->playback_devno + substream->number];
1244 if ((err = snd_via82xx_pcm_open(chip, viadev, substream)) < 0)
1245 return err;
1246 stream = viadev->reg_offset / 0x10;
1247 if (chip->dxs_controls[stream]) {
1248 chip->playback_volume[stream][0] = 0;
1249 chip->playback_volume[stream][1] = 0;
1250 chip->dxs_controls[stream]->vd[0].access &=
1251 ~SNDRV_CTL_ELEM_ACCESS_INACTIVE;
1252 snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE |
1253 SNDRV_CTL_EVENT_MASK_INFO,
1254 &chip->dxs_controls[stream]->id);
1255 }
1256 return 0;
1257}
1258
1259/*
1233 * open callback for playback on via823x multi-channel 1260 * open callback for playback on via823x multi-channel
1234 */ 1261 */
1235static int snd_via8233_multi_open(struct snd_pcm_substream *substream) 1262static int snd_via8233_multi_open(struct snd_pcm_substream *substream)
@@ -1302,10 +1329,26 @@ static int snd_via82xx_pcm_close(struct snd_pcm_substream *substream)
1302 return 0; 1329 return 0;
1303} 1330}
1304 1331
1332static int snd_via8233_playback_close(struct snd_pcm_substream *substream)
1333{
1334 struct via82xx *chip = snd_pcm_substream_chip(substream);
1335 struct viadev *viadev = substream->runtime->private_data;
1336 unsigned int stream;
1337
1338 stream = viadev->reg_offset / 0x10;
1339 if (chip->dxs_controls[stream]) {
1340 chip->dxs_controls[stream]->vd[0].access |=
1341 SNDRV_CTL_ELEM_ACCESS_INACTIVE;
1342 snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_INFO,
1343 &chip->dxs_controls[stream]->id);
1344 }
1345 return snd_via82xx_pcm_close(substream);
1346}
1347
1305 1348
1306/* via686 playback callbacks */ 1349/* via686 playback callbacks */
1307static struct snd_pcm_ops snd_via686_playback_ops = { 1350static struct snd_pcm_ops snd_via686_playback_ops = {
1308 .open = snd_via82xx_playback_open, 1351 .open = snd_via686_playback_open,
1309 .close = snd_via82xx_pcm_close, 1352 .close = snd_via82xx_pcm_close,
1310 .ioctl = snd_pcm_lib_ioctl, 1353 .ioctl = snd_pcm_lib_ioctl,
1311 .hw_params = snd_via82xx_hw_params, 1354 .hw_params = snd_via82xx_hw_params,
@@ -1331,8 +1374,8 @@ static struct snd_pcm_ops snd_via686_capture_ops = {
1331 1374
1332/* via823x DSX playback callbacks */ 1375/* via823x DSX playback callbacks */
1333static struct snd_pcm_ops snd_via8233_playback_ops = { 1376static struct snd_pcm_ops snd_via8233_playback_ops = {
1334 .open = snd_via82xx_playback_open, 1377 .open = snd_via8233_playback_open,
1335 .close = snd_via82xx_pcm_close, 1378 .close = snd_via8233_playback_close,
1336 .ioctl = snd_pcm_lib_ioctl, 1379 .ioctl = snd_pcm_lib_ioctl,
1337 .hw_params = snd_via82xx_hw_params, 1380 .hw_params = snd_via82xx_hw_params,
1338 .hw_free = snd_via82xx_hw_free, 1381 .hw_free = snd_via82xx_hw_free,
@@ -1626,7 +1669,7 @@ static int snd_via8233_dxs_volume_get(struct snd_kcontrol *kcontrol,
1626 struct snd_ctl_elem_value *ucontrol) 1669 struct snd_ctl_elem_value *ucontrol)
1627{ 1670{
1628 struct via82xx *chip = snd_kcontrol_chip(kcontrol); 1671 struct via82xx *chip = snd_kcontrol_chip(kcontrol);
1629 unsigned int idx = snd_ctl_get_ioff(kcontrol, &ucontrol->id); 1672 unsigned int idx = kcontrol->id.subdevice;
1630 1673
1631 ucontrol->value.integer.value[0] = VIA_DXS_MAX_VOLUME - chip->playback_volume[idx][0]; 1674 ucontrol->value.integer.value[0] = VIA_DXS_MAX_VOLUME - chip->playback_volume[idx][0];
1632 ucontrol->value.integer.value[1] = VIA_DXS_MAX_VOLUME - chip->playback_volume[idx][1]; 1675 ucontrol->value.integer.value[1] = VIA_DXS_MAX_VOLUME - chip->playback_volume[idx][1];
@@ -1646,7 +1689,7 @@ static int snd_via8233_dxs_volume_put(struct snd_kcontrol *kcontrol,
1646 struct snd_ctl_elem_value *ucontrol) 1689 struct snd_ctl_elem_value *ucontrol)
1647{ 1690{
1648 struct via82xx *chip = snd_kcontrol_chip(kcontrol); 1691 struct via82xx *chip = snd_kcontrol_chip(kcontrol);
1649 unsigned int idx = snd_ctl_get_ioff(kcontrol, &ucontrol->id); 1692 unsigned int idx = kcontrol->id.subdevice;
1650 unsigned long port = chip->port + 0x10 * idx; 1693 unsigned long port = chip->port + 0x10 * idx;
1651 unsigned char val; 1694 unsigned char val;
1652 int i, change = 0; 1695 int i, change = 0;
@@ -1705,11 +1748,13 @@ static struct snd_kcontrol_new snd_via8233_pcmdxs_volume_control __devinitdata =
1705}; 1748};
1706 1749
1707static struct snd_kcontrol_new snd_via8233_dxs_volume_control __devinitdata = { 1750static struct snd_kcontrol_new snd_via8233_dxs_volume_control __devinitdata = {
1708 .name = "VIA DXS Playback Volume", 1751 .iface = SNDRV_CTL_ELEM_IFACE_PCM,
1709 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1752 .device = 0,
1710 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE | 1753 /* .subdevice set later */
1711 SNDRV_CTL_ELEM_ACCESS_TLV_READ), 1754 .name = "PCM Playback Volume",
1712 .count = 4, 1755 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE |
1756 SNDRV_CTL_ELEM_ACCESS_TLV_READ |
1757 SNDRV_CTL_ELEM_ACCESS_INACTIVE,
1713 .info = snd_via8233_dxs_volume_info, 1758 .info = snd_via8233_dxs_volume_info,
1714 .get = snd_via8233_dxs_volume_get, 1759 .get = snd_via8233_dxs_volume_get,
1715 .put = snd_via8233_dxs_volume_put, 1760 .put = snd_via8233_dxs_volume_put,
@@ -1936,10 +1981,19 @@ static int __devinit snd_via8233_init_misc(struct via82xx *chip)
1936 } 1981 }
1937 else /* Using DXS when PCM emulation is enabled is really weird */ 1982 else /* Using DXS when PCM emulation is enabled is really weird */
1938 { 1983 {
1939 /* Standalone DXS controls */ 1984 for (i = 0; i < 4; ++i) {
1940 err = snd_ctl_add(chip->card, snd_ctl_new1(&snd_via8233_dxs_volume_control, chip)); 1985 struct snd_kcontrol *kctl;
1941 if (err < 0) 1986
1942 return err; 1987 kctl = snd_ctl_new1(
1988 &snd_via8233_dxs_volume_control, chip);
1989 if (!kctl)
1990 return -ENOMEM;
1991 kctl->id.subdevice = i;
1992 err = snd_ctl_add(chip->card, kctl);
1993 if (err < 0)
1994 return err;
1995 chip->dxs_controls[i] = kctl;
1996 }
1943 } 1997 }
1944 } 1998 }
1945 /* select spdif data slot 10/11 */ 1999 /* select spdif data slot 10/11 */
diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf.c b/sound/pcmcia/pdaudiocf/pdaudiocf.c
index 7dea74b71cf1..64b859925c0b 100644
--- a/sound/pcmcia/pdaudiocf/pdaudiocf.c
+++ b/sound/pcmcia/pdaudiocf/pdaudiocf.c
@@ -217,20 +217,25 @@ static void snd_pdacf_detach(struct pcmcia_device *link)
217 * configuration callback 217 * configuration callback
218 */ 218 */
219 219
220#define CS_CHECK(fn, ret) \
221do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
222
223static int pdacf_config(struct pcmcia_device *link) 220static int pdacf_config(struct pcmcia_device *link)
224{ 221{
225 struct snd_pdacf *pdacf = link->priv; 222 struct snd_pdacf *pdacf = link->priv;
226 int last_fn, last_ret; 223 int ret;
227 224
228 snd_printdd(KERN_DEBUG "pdacf_config called\n"); 225 snd_printdd(KERN_DEBUG "pdacf_config called\n");
229 link->conf.ConfigIndex = 0x5; 226 link->conf.ConfigIndex = 0x5;
230 227
231 CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io)); 228 ret = pcmcia_request_io(link, &link->io);
232 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 229 if (ret)
233 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 230 goto failed;
231
232 ret = pcmcia_request_irq(link, &link->irq);
233 if (ret)
234 goto failed;
235
236 ret = pcmcia_request_configuration(link, &link->conf);
237 if (ret)
238 goto failed;
234 239
235 if (snd_pdacf_assign_resources(pdacf, link->io.BasePort1, link->irq.AssignedIRQ) < 0) 240 if (snd_pdacf_assign_resources(pdacf, link->io.BasePort1, link->irq.AssignedIRQ) < 0)
236 goto failed; 241 goto failed;
@@ -238,8 +243,6 @@ static int pdacf_config(struct pcmcia_device *link)
238 link->dev_node = &pdacf->node; 243 link->dev_node = &pdacf->node;
239 return 0; 244 return 0;
240 245
241cs_failed:
242 cs_error(link, last_fn, last_ret);
243failed: 246failed:
244 pcmcia_disable_device(link); 247 pcmcia_disable_device(link);
245 return -ENODEV; 248 return -ENODEV;
diff --git a/sound/pcmcia/vx/vxpocket.c b/sound/pcmcia/vx/vxpocket.c
index 7445cc8a47d3..1492744ad67f 100644
--- a/sound/pcmcia/vx/vxpocket.c
+++ b/sound/pcmcia/vx/vxpocket.c
@@ -213,14 +213,11 @@ static int snd_vxpocket_assign_resources(struct vx_core *chip, int port, int irq
213 * configuration callback 213 * configuration callback
214 */ 214 */
215 215
216#define CS_CHECK(fn, ret) \
217do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
218
219static int vxpocket_config(struct pcmcia_device *link) 216static int vxpocket_config(struct pcmcia_device *link)
220{ 217{
221 struct vx_core *chip = link->priv; 218 struct vx_core *chip = link->priv;
222 struct snd_vxpocket *vxp = (struct snd_vxpocket *)chip; 219 struct snd_vxpocket *vxp = (struct snd_vxpocket *)chip;
223 int last_fn, last_ret; 220 int ret;
224 221
225 snd_printdd(KERN_DEBUG "vxpocket_config called\n"); 222 snd_printdd(KERN_DEBUG "vxpocket_config called\n");
226 223
@@ -235,9 +232,17 @@ static int vxpocket_config(struct pcmcia_device *link)
235 strcpy(chip->card->driver, vxp440_hw.name); 232 strcpy(chip->card->driver, vxp440_hw.name);
236 } 233 }
237 234
238 CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io)); 235 ret = pcmcia_request_io(link, &link->io);
239 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 236 if (ret)
240 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 237 goto failed;
238
239 ret = pcmcia_request_irq(link, &link->irq);
240 if (ret)
241 goto failed;
242
243 ret = pcmcia_request_configuration(link, &link->conf);
244 if (ret)
245 goto failed;
241 246
242 chip->dev = &handle_to_dev(link); 247 chip->dev = &handle_to_dev(link);
243 snd_card_set_dev(chip->card, chip->dev); 248 snd_card_set_dev(chip->card, chip->dev);
@@ -248,8 +253,6 @@ static int vxpocket_config(struct pcmcia_device *link)
248 link->dev_node = &vxp->node; 253 link->dev_node = &vxp->node;
249 return 0; 254 return 0;
250 255
251cs_failed:
252 cs_error(link, last_fn, last_ret);
253failed: 256failed:
254 pcmcia_disable_device(link); 257 pcmcia_disable_device(link);
255 return -ENODEV; 258 return -ENODEV;
diff --git a/sound/ppc/Kconfig b/sound/ppc/Kconfig
index bd2338ab2ced..0519c60f5be1 100644
--- a/sound/ppc/Kconfig
+++ b/sound/ppc/Kconfig
@@ -2,7 +2,7 @@
2 2
3menuconfig SND_PPC 3menuconfig SND_PPC
4 bool "PowerPC sound devices" 4 bool "PowerPC sound devices"
5 depends on PPC64 || PPC32 5 depends on PPC
6 default y 6 default y
7 help 7 help
8 Support for sound devices specific to PowerPC architectures. 8 Support for sound devices specific to PowerPC architectures.
diff --git a/sound/sh/aica.c b/sound/sh/aica.c
index 583a3693df75..a0df401ebb9f 100644
--- a/sound/sh/aica.c
+++ b/sound/sh/aica.c
@@ -49,6 +49,7 @@ MODULE_AUTHOR("Adrian McMenamin <adrian@mcmen.demon.co.uk>");
49MODULE_DESCRIPTION("Dreamcast AICA sound (pcm) driver"); 49MODULE_DESCRIPTION("Dreamcast AICA sound (pcm) driver");
50MODULE_LICENSE("GPL"); 50MODULE_LICENSE("GPL");
51MODULE_SUPPORTED_DEVICE("{{Yamaha/SEGA, AICA}}"); 51MODULE_SUPPORTED_DEVICE("{{Yamaha/SEGA, AICA}}");
52MODULE_FIRMWARE("aica_firmware.bin");
52 53
53/* module parameters */ 54/* module parameters */
54#define CARD_NAME "AICA" 55#define CARD_NAME "AICA"
diff --git a/sound/soc/codecs/tlv320aic23.c b/sound/soc/codecs/tlv320aic23.c
index 0b8dcb5cd729..6b24d8bb02bb 100644
--- a/sound/soc/codecs/tlv320aic23.c
+++ b/sound/soc/codecs/tlv320aic23.c
@@ -265,8 +265,8 @@ static const int bosr_usb_divisor_table[] = {
265#define UPPER_GROUP ((1<<8) | (1<<9) | (1<<10) | (1<<11) | (1<<15)) 265#define UPPER_GROUP ((1<<8) | (1<<9) | (1<<10) | (1<<11) | (1<<15))
266static const unsigned short sr_valid_mask[] = { 266static const unsigned short sr_valid_mask[] = {
267 LOWER_GROUP|UPPER_GROUP, /* Normal, bosr - 0*/ 267 LOWER_GROUP|UPPER_GROUP, /* Normal, bosr - 0*/
268 LOWER_GROUP|UPPER_GROUP, /* Normal, bosr - 1*/
269 LOWER_GROUP, /* Usb, bosr - 0*/ 268 LOWER_GROUP, /* Usb, bosr - 0*/
269 LOWER_GROUP|UPPER_GROUP, /* Normal, bosr - 1*/
270 UPPER_GROUP, /* Usb, bosr - 1*/ 270 UPPER_GROUP, /* Usb, bosr - 1*/
271}; 271};
272/* 272/*
diff --git a/sound/soc/codecs/wm8350.c b/sound/soc/codecs/wm8350.c
index 3ff0373dff89..593d5b9c9f03 100644
--- a/sound/soc/codecs/wm8350.c
+++ b/sound/soc/codecs/wm8350.c
@@ -579,7 +579,7 @@ static const struct snd_kcontrol_new wm8350_left_capt_mixer_controls[] = {
579 SOC_DAPM_SINGLE_TLV("L3 Capture Volume", 579 SOC_DAPM_SINGLE_TLV("L3 Capture Volume",
580 WM8350_INPUT_MIXER_VOLUME_L, 9, 7, 0, out_mix_tlv), 580 WM8350_INPUT_MIXER_VOLUME_L, 9, 7, 0, out_mix_tlv),
581 SOC_DAPM_SINGLE("PGA Capture Switch", 581 SOC_DAPM_SINGLE("PGA Capture Switch",
582 WM8350_LEFT_INPUT_VOLUME, 14, 1, 0), 582 WM8350_LEFT_INPUT_VOLUME, 14, 1, 1),
583}; 583};
584 584
585/* Right Input Mixer */ 585/* Right Input Mixer */
@@ -589,7 +589,7 @@ static const struct snd_kcontrol_new wm8350_right_capt_mixer_controls[] = {
589 SOC_DAPM_SINGLE_TLV("L3 Capture Volume", 589 SOC_DAPM_SINGLE_TLV("L3 Capture Volume",
590 WM8350_INPUT_MIXER_VOLUME_R, 13, 7, 0, out_mix_tlv), 590 WM8350_INPUT_MIXER_VOLUME_R, 13, 7, 0, out_mix_tlv),
591 SOC_DAPM_SINGLE("PGA Capture Switch", 591 SOC_DAPM_SINGLE("PGA Capture Switch",
592 WM8350_RIGHT_INPUT_VOLUME, 14, 1, 0), 592 WM8350_RIGHT_INPUT_VOLUME, 14, 1, 1),
593}; 593};
594 594
595/* Left Mic Mixer */ 595/* Left Mic Mixer */
diff --git a/sound/soc/codecs/wm8940.c b/sound/soc/codecs/wm8940.c
index da97aae475a2..1ef2454c5205 100644
--- a/sound/soc/codecs/wm8940.c
+++ b/sound/soc/codecs/wm8940.c
@@ -790,7 +790,7 @@ static int wm8940_register(struct wm8940_priv *wm8940,
790 codec->reg_cache = &wm8940->reg_cache; 790 codec->reg_cache = &wm8940->reg_cache;
791 791
792 ret = snd_soc_codec_set_cache_io(codec, 8, 16, control); 792 ret = snd_soc_codec_set_cache_io(codec, 8, 16, control);
793 if (ret == 0) { 793 if (ret < 0) {
794 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret); 794 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
795 return ret; 795 return ret;
796 } 796 }
diff --git a/sound/soc/imx/mxc-ssi.c b/sound/soc/imx/mxc-ssi.c
index 3806ff2c0cd4..ccdefe60e752 100644
--- a/sound/soc/imx/mxc-ssi.c
+++ b/sound/soc/imx/mxc-ssi.c
@@ -397,14 +397,6 @@ static int imx_ssi_set_dai_fmt(struct snd_soc_dai *cpu_dai,
397 break; 397 break;
398 } 398 }
399 399
400 /* sync */
401 if (!(fmt & SND_SOC_DAIFMT_ASYNC))
402 scr |= SSI_SCR_SYN;
403
404 /* tdm - only for stereo atm */
405 if (fmt & SND_SOC_DAIFMT_TDM)
406 scr |= SSI_SCR_NET;
407
408 if (cpu_dai->id == IMX_DAI_SSI0 || cpu_dai->id == IMX_DAI_SSI2) { 400 if (cpu_dai->id == IMX_DAI_SSI0 || cpu_dai->id == IMX_DAI_SSI2) {
409 SSI1_STCR = stcr; 401 SSI1_STCR = stcr;
410 SSI1_SRCR = srcr; 402 SSI1_SRCR = srcr;
diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig
index 2dee9839be86..653a362425df 100644
--- a/sound/soc/omap/Kconfig
+++ b/sound/soc/omap/Kconfig
@@ -21,7 +21,18 @@ config SND_OMAP_SOC_AMS_DELTA
21 select SND_OMAP_SOC_MCBSP 21 select SND_OMAP_SOC_MCBSP
22 select SND_SOC_CX20442 22 select SND_SOC_CX20442
23 help 23 help
24 Say Y if you want to add support for SoC audio on Amstrad Delta. 24 Say Y if you want to add support for SoC audio device connected to
25 a handset and a speakerphone found on Amstrad E3 (Delta) videophone.
26
27 Note that in order to get those devices fully supported, you have to
28 build the kernel with standard serial port driver included and
29 configured for at least 4 ports. Then, from userspace, you must load
30 a line discipline #19 on the modem (ttyS3) serial line. The simplest
31 way to achieve this is to install util-linux-ng and use the included
32 ldattach utility. This can be started automatically from udev,
33 a simple rule like this one should do the trick (it does for me):
34 ACTION=="add", KERNEL=="controlC0", \
35 RUN+="/usr/sbin/ldattach 19 /dev/ttyS3"
25 36
26config SND_OMAP_SOC_OSK5912 37config SND_OMAP_SOC_OSK5912
27 tristate "SoC Audio support for omap osk5912" 38 tristate "SoC Audio support for omap osk5912"
diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c
index 5735945788bf..6a829eef2a4f 100644
--- a/sound/soc/omap/omap-pcm.c
+++ b/sound/soc/omap/omap-pcm.c
@@ -195,8 +195,12 @@ static int omap_pcm_prepare(struct snd_pcm_substream *substream)
195 else 195 else
196 omap_enable_dma_irq(prtd->dma_ch, OMAP_DMA_FRAME_IRQ); 196 omap_enable_dma_irq(prtd->dma_ch, OMAP_DMA_FRAME_IRQ);
197 197
198 omap_set_dma_src_burst_mode(prtd->dma_ch, OMAP_DMA_DATA_BURST_16); 198 if (!(cpu_class_is_omap1())) {
199 omap_set_dma_dest_burst_mode(prtd->dma_ch, OMAP_DMA_DATA_BURST_16); 199 omap_set_dma_src_burst_mode(prtd->dma_ch,
200 OMAP_DMA_DATA_BURST_16);
201 omap_set_dma_dest_burst_mode(prtd->dma_ch,
202 OMAP_DMA_DATA_BURST_16);
203 }
200 204
201 return 0; 205 return 0;
202} 206}
diff --git a/sound/soc/omap/omap3evm.c b/sound/soc/omap/omap3evm.c
index 9114c263077b..13aa380de162 100644
--- a/sound/soc/omap/omap3evm.c
+++ b/sound/soc/omap/omap3evm.c
@@ -144,4 +144,4 @@ module_exit(omap3evm_soc_exit);
144 144
145MODULE_AUTHOR("Anuj Aggarwal <anuj.aggarwal@ti.com>"); 145MODULE_AUTHOR("Anuj Aggarwal <anuj.aggarwal@ti.com>");
146MODULE_DESCRIPTION("ALSA SoC OMAP3 EVM"); 146MODULE_DESCRIPTION("ALSA SoC OMAP3 EVM");
147MODULE_LICENSE("GPLv2"); 147MODULE_LICENSE("GPL v2");
diff --git a/sound/soc/omap/omap3pandora.c b/sound/soc/omap/omap3pandora.c
index ad219aaf7cb8..0cd06f5dd356 100644
--- a/sound/soc/omap/omap3pandora.c
+++ b/sound/soc/omap/omap3pandora.c
@@ -134,7 +134,7 @@ static int omap3pandora_hp_event(struct snd_soc_dapm_widget *w,
134 * |P| <--- TWL4030 <--------- Line In and MICs 134 * |P| <--- TWL4030 <--------- Line In and MICs
135 */ 135 */
136static const struct snd_soc_dapm_widget omap3pandora_out_dapm_widgets[] = { 136static const struct snd_soc_dapm_widget omap3pandora_out_dapm_widgets[] = {
137 SND_SOC_DAPM_DAC("PCM DAC", "Playback", SND_SOC_NOPM, 0, 0), 137 SND_SOC_DAPM_DAC("PCM DAC", "HiFi Playback", SND_SOC_NOPM, 0, 0),
138 SND_SOC_DAPM_PGA_E("Headphone Amplifier", SND_SOC_NOPM, 138 SND_SOC_DAPM_PGA_E("Headphone Amplifier", SND_SOC_NOPM,
139 0, 0, NULL, 0, omap3pandora_hp_event, 139 0, 0, NULL, 0, omap3pandora_hp_event,
140 SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD), 140 SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
@@ -181,6 +181,7 @@ static int omap3pandora_out_init(struct snd_soc_codec *codec)
181 snd_soc_dapm_nc_pin(codec, "CARKITR"); 181 snd_soc_dapm_nc_pin(codec, "CARKITR");
182 snd_soc_dapm_nc_pin(codec, "HFL"); 182 snd_soc_dapm_nc_pin(codec, "HFL");
183 snd_soc_dapm_nc_pin(codec, "HFR"); 183 snd_soc_dapm_nc_pin(codec, "HFR");
184 snd_soc_dapm_nc_pin(codec, "VIBRA");
184 185
185 ret = snd_soc_dapm_new_controls(codec, omap3pandora_out_dapm_widgets, 186 ret = snd_soc_dapm_new_controls(codec, omap3pandora_out_dapm_widgets,
186 ARRAY_SIZE(omap3pandora_out_dapm_widgets)); 187 ARRAY_SIZE(omap3pandora_out_dapm_widgets));
diff --git a/sound/soc/s3c24xx/s3c24xx-pcm.c b/sound/soc/s3c24xx/s3c24xx-pcm.c
index 5cbbdc80fde3..1f35c6fcf5fd 100644
--- a/sound/soc/s3c24xx/s3c24xx-pcm.c
+++ b/sound/soc/s3c24xx/s3c24xx-pcm.c
@@ -75,11 +75,19 @@ static void s3c24xx_pcm_enqueue(struct snd_pcm_substream *substream)
75{ 75{
76 struct s3c24xx_runtime_data *prtd = substream->runtime->private_data; 76 struct s3c24xx_runtime_data *prtd = substream->runtime->private_data;
77 dma_addr_t pos = prtd->dma_pos; 77 dma_addr_t pos = prtd->dma_pos;
78 unsigned int limit;
78 int ret; 79 int ret;
79 80
80 pr_debug("Entered %s\n", __func__); 81 pr_debug("Entered %s\n", __func__);
81 82
82 while (prtd->dma_loaded < prtd->dma_limit) { 83 if (s3c_dma_has_circular()) {
84 limit = (prtd->dma_end - prtd->dma_start) / prtd->dma_period;
85 } else
86 limit = prtd->dma_limit;
87
88 pr_debug("%s: loaded %d, limit %d\n", __func__, prtd->dma_loaded, limit);
89
90 while (prtd->dma_loaded < limit) {
83 unsigned long len = prtd->dma_period; 91 unsigned long len = prtd->dma_period;
84 92
85 pr_debug("dma_loaded: %d\n", prtd->dma_loaded); 93 pr_debug("dma_loaded: %d\n", prtd->dma_loaded);
@@ -123,7 +131,7 @@ static void s3c24xx_audio_buffdone(struct s3c2410_dma_chan *channel,
123 snd_pcm_period_elapsed(substream); 131 snd_pcm_period_elapsed(substream);
124 132
125 spin_lock(&prtd->lock); 133 spin_lock(&prtd->lock);
126 if (prtd->state & ST_RUNNING) { 134 if (prtd->state & ST_RUNNING && !s3c_dma_has_circular()) {
127 prtd->dma_loaded--; 135 prtd->dma_loaded--;
128 s3c24xx_pcm_enqueue(substream); 136 s3c24xx_pcm_enqueue(substream);
129 } 137 }
@@ -164,6 +172,11 @@ static int s3c24xx_pcm_hw_params(struct snd_pcm_substream *substream,
164 printk(KERN_ERR "failed to get dma channel\n"); 172 printk(KERN_ERR "failed to get dma channel\n");
165 return ret; 173 return ret;
166 } 174 }
175
176 /* use the circular buffering if we have it available. */
177 if (s3c_dma_has_circular())
178 s3c2410_dma_setflags(prtd->params->channel,
179 S3C2410_DMAF_CIRCULAR);
167 } 180 }
168 181
169 s3c2410_dma_set_buffdone_fn(prtd->params->channel, 182 s3c2410_dma_set_buffdone_fn(prtd->params->channel,
diff --git a/sound/soc/s3c24xx/s3c64xx-i2s.c b/sound/soc/s3c24xx/s3c64xx-i2s.c
index 3c06c401d0fb..105a77eeded0 100644
--- a/sound/soc/s3c24xx/s3c64xx-i2s.c
+++ b/sound/soc/s3c24xx/s3c64xx-i2s.c
@@ -220,6 +220,8 @@ static __devinit int s3c64xx_iis_dev_probe(struct platform_device *pdev)
220 goto err; 220 goto err;
221 } 221 }
222 222
223 clk_enable(i2s->iis_cclk);
224
223 ret = s3c_i2sv2_probe(pdev, dai, i2s, 0); 225 ret = s3c_i2sv2_probe(pdev, dai, i2s, 0);
224 if (ret) 226 if (ret)
225 goto err_clk; 227 goto err_clk;
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 7ff04ad2a97e..0a1b2f64bbee 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -834,6 +834,9 @@ EXPORT_SYMBOL_GPL(snd_soc_resume_device);
834#define soc_resume NULL 834#define soc_resume NULL
835#endif 835#endif
836 836
837static struct snd_soc_dai_ops null_dai_ops = {
838};
839
837static void snd_soc_instantiate_card(struct snd_soc_card *card) 840static void snd_soc_instantiate_card(struct snd_soc_card *card)
838{ 841{
839 struct platform_device *pdev = container_of(card->dev, 842 struct platform_device *pdev = container_of(card->dev,
@@ -877,6 +880,11 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card)
877 ac97 = 1; 880 ac97 = 1;
878 } 881 }
879 882
883 for (i = 0; i < card->num_links; i++) {
884 if (!card->dai_link[i].codec_dai->ops)
885 card->dai_link[i].codec_dai->ops = &null_dai_ops;
886 }
887
880 /* If we have AC97 in the system then don't wait for the 888 /* If we have AC97 in the system then don't wait for the
881 * codec. This will need revisiting if we have to handle 889 * codec. This will need revisiting if we have to handle
882 * systems with mixed AC97 and non-AC97 parts. Only check for 890 * systems with mixed AC97 and non-AC97 parts. Only check for
@@ -2329,9 +2337,6 @@ static int snd_soc_unregister_card(struct snd_soc_card *card)
2329 return 0; 2337 return 0;
2330} 2338}
2331 2339
2332static struct snd_soc_dai_ops null_dai_ops = {
2333};
2334
2335/** 2340/**
2336 * snd_soc_register_dai - Register a DAI with the ASoC core 2341 * snd_soc_register_dai - Register a DAI with the ASoC core
2337 * 2342 *
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index f79711b9fa5b..d89f6dc00908 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -524,7 +524,7 @@ static int is_connected_output_ep(struct snd_soc_dapm_widget *widget)
524 524
525 /* connected jack or spk ? */ 525 /* connected jack or spk ? */
526 if (widget->id == snd_soc_dapm_hp || widget->id == snd_soc_dapm_spk || 526 if (widget->id == snd_soc_dapm_hp || widget->id == snd_soc_dapm_spk ||
527 widget->id == snd_soc_dapm_line) 527 (widget->id == snd_soc_dapm_line && !list_empty(&widget->sources)))
528 return 1; 528 return 1;
529 } 529 }
530 530
@@ -573,7 +573,8 @@ static int is_connected_input_ep(struct snd_soc_dapm_widget *widget)
573 return 1; 573 return 1;
574 574
575 /* connected jack ? */ 575 /* connected jack ? */
576 if (widget->id == snd_soc_dapm_mic || widget->id == snd_soc_dapm_line) 576 if (widget->id == snd_soc_dapm_mic ||
577 (widget->id == snd_soc_dapm_line && !list_empty(&widget->sinks)))
577 return 1; 578 return 1;
578 } 579 }
579 580
@@ -2071,9 +2072,9 @@ int snd_soc_dapm_stream_event(struct snd_soc_codec *codec,
2071 } 2072 }
2072 } 2073 }
2073 } 2074 }
2074 mutex_unlock(&codec->mutex);
2075 2075
2076 dapm_power_widgets(codec, event); 2076 dapm_power_widgets(codec, event);
2077 mutex_unlock(&codec->mutex);
2077 dump_dapm(codec, __func__); 2078 dump_dapm(codec, __func__);
2078 return 0; 2079 return 0;
2079} 2080}
diff --git a/sound/usb/caiaq/audio.c b/sound/usb/caiaq/audio.c
index 121af0644fd9..86b2c3b92df5 100644
--- a/sound/usb/caiaq/audio.c
+++ b/sound/usb/caiaq/audio.c
@@ -62,10 +62,14 @@ static void
62activate_substream(struct snd_usb_caiaqdev *dev, 62activate_substream(struct snd_usb_caiaqdev *dev,
63 struct snd_pcm_substream *sub) 63 struct snd_pcm_substream *sub)
64{ 64{
65 spin_lock(&dev->spinlock);
66
65 if (sub->stream == SNDRV_PCM_STREAM_PLAYBACK) 67 if (sub->stream == SNDRV_PCM_STREAM_PLAYBACK)
66 dev->sub_playback[sub->number] = sub; 68 dev->sub_playback[sub->number] = sub;
67 else 69 else
68 dev->sub_capture[sub->number] = sub; 70 dev->sub_capture[sub->number] = sub;
71
72 spin_unlock(&dev->spinlock);
69} 73}
70 74
71static void 75static void
@@ -269,16 +273,22 @@ snd_usb_caiaq_pcm_pointer(struct snd_pcm_substream *sub)
269{ 273{
270 int index = sub->number; 274 int index = sub->number;
271 struct snd_usb_caiaqdev *dev = snd_pcm_substream_chip(sub); 275 struct snd_usb_caiaqdev *dev = snd_pcm_substream_chip(sub);
276 snd_pcm_uframes_t ptr;
277
278 spin_lock(&dev->spinlock);
272 279
273 if (dev->input_panic || dev->output_panic) 280 if (dev->input_panic || dev->output_panic)
274 return SNDRV_PCM_POS_XRUN; 281 ptr = SNDRV_PCM_POS_XRUN;
275 282
276 if (sub->stream == SNDRV_PCM_STREAM_PLAYBACK) 283 if (sub->stream == SNDRV_PCM_STREAM_PLAYBACK)
277 return bytes_to_frames(sub->runtime, 284 ptr = bytes_to_frames(sub->runtime,
278 dev->audio_out_buf_pos[index]); 285 dev->audio_out_buf_pos[index]);
279 else 286 else
280 return bytes_to_frames(sub->runtime, 287 ptr = bytes_to_frames(sub->runtime,
281 dev->audio_in_buf_pos[index]); 288 dev->audio_in_buf_pos[index]);
289
290 spin_unlock(&dev->spinlock);
291 return ptr;
282} 292}
283 293
284/* operators for both playback and capture */ 294/* operators for both playback and capture */
diff --git a/sound/usb/caiaq/device.c b/sound/usb/caiaq/device.c
index 83e6c1312d47..a3f02dd97440 100644
--- a/sound/usb/caiaq/device.c
+++ b/sound/usb/caiaq/device.c
@@ -35,7 +35,7 @@
35#include "input.h" 35#include "input.h"
36 36
37MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>"); 37MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>");
38MODULE_DESCRIPTION("caiaq USB audio, version 1.3.19"); 38MODULE_DESCRIPTION("caiaq USB audio, version 1.3.20");
39MODULE_LICENSE("GPL"); 39MODULE_LICENSE("GPL");
40MODULE_SUPPORTED_DEVICE("{{Native Instruments, RigKontrol2}," 40MODULE_SUPPORTED_DEVICE("{{Native Instruments, RigKontrol2},"
41 "{Native Instruments, RigKontrol3}," 41 "{Native Instruments, RigKontrol3},"
diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h
index 8e7f78941ba6..e9a3a9dca15c 100644
--- a/sound/usb/usbaudio.h
+++ b/sound/usb/usbaudio.h
@@ -210,7 +210,7 @@ struct snd_usb_midi_endpoint_info {
210/* 210/*
211 */ 211 */
212 212
213#define combine_word(s) ((*s) | ((unsigned int)(s)[1] << 8)) 213#define combine_word(s) ((*(s)) | ((unsigned int)(s)[1] << 8))
214#define combine_triple(s) (combine_word(s) | ((unsigned int)(s)[2] << 16)) 214#define combine_triple(s) (combine_word(s) | ((unsigned int)(s)[2] << 16))
215#define combine_quad(s) (combine_triple(s) | ((unsigned int)(s)[3] << 24)) 215#define combine_quad(s) (combine_triple(s) | ((unsigned int)(s)[3] << 24))
216 216
diff --git a/sound/usb/usbmixer.c b/sound/usb/usbmixer.c
index 9efcfd08d747..c998220b99c6 100644
--- a/sound/usb/usbmixer.c
+++ b/sound/usb/usbmixer.c
@@ -1071,6 +1071,15 @@ static int parse_audio_feature_unit(struct mixer_build *state, int unitid, unsig
1071 channels = (ftr[0] - 7) / csize - 1; 1071 channels = (ftr[0] - 7) / csize - 1;
1072 1072
1073 master_bits = snd_usb_combine_bytes(ftr + 6, csize); 1073 master_bits = snd_usb_combine_bytes(ftr + 6, csize);
1074 /* master configuration quirks */
1075 switch (state->chip->usb_id) {
1076 case USB_ID(0x08bb, 0x2702):
1077 snd_printk(KERN_INFO
1078 "usbmixer: master volume quirk for PCM2702 chip\n");
1079 /* disable non-functional volume control */
1080 master_bits &= ~(1 << (USB_FEATURE_VOLUME - 1));
1081 break;
1082 }
1074 if (channels > 0) 1083 if (channels > 0)
1075 first_ch_bits = snd_usb_combine_bytes(ftr + 6 + csize, csize); 1084 first_ch_bits = snd_usb_combine_bytes(ftr + 6 + csize, csize);
1076 else 1085 else