aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-08-21 12:17:05 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-08-21 12:17:05 -0400
commit4459f3974ad69a0a65d89af2a31cab425708c67e (patch)
treeace3775986d8b18d4a6767f2ff1c885053e7491c
parentf341861fb0b701139849f8a85c2d3cdff466e8e8 (diff)
parent53e1719f3da0f095b8db1461bd12dd79f3246b84 (diff)
Merge tag 'sound-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "This update became slightly bigger than usual for rc3, but most of the commits are small and trivial. A large chunk is found for HD-audio ca0132 codec, which is mostly a clean up of the specific code, to make SPDIF working properly, and also in the new ASoC Arizona driver. One important fix is for usb-audio Oops fix since 3.5. We still see some EHCI related bandwidth problem, but usb-audio should be more stabilized now. Other than that, a Kconfig fix is spread over files, and various HD-audio and ASoC fixes as usual, in addition to Julia's error path fixes." * tag 'sound-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (42 commits) ALSA: snd-als100: fix suspend/resume ALSA: hda - Fix leftover codec->power_transition ALSA: hda - don't create dysfunctional mixer controls for ca0132 ALSA: sound/ppc/snd_ps3.c: fix error return code ALSA: sound/pci/rme9652/hdspm.c: fix error return code ALSA: sound/pci/sis7019.c: fix error return code ALSA: sound/pci/ctxfi/ctatc.c: fix error return code ALSA: sound/atmel/ac97c.c: fix error return code ALSA: sound/atmel/abdac.c: fix error return code ALSA: fix pcm.h kernel-doc warning and notation sound: oss/sb_audio: prevent divide by zero bug ASoC: wm9712: Fix inverted capture volume ASoC: wm9712: Fix microphone source selection ASoC: wm5102: Remove DRC2 ALSA: hda - Don't send invalid volume knob command on IDT 92hd75bxx ALSA: usb-audio: Fix scheduling-while-atomic bug in PCM capture stream ALSA: lx6464es: Add a missing error check ALSA: hda - Fix 'Beep Playback Switch' with no underlying mute switch ASoC: jack: Always notify full jack status ASoC: wm5110: Add missing input PGA routes ...
-rw-r--r--MAINTAINERS7
-rw-r--r--include/sound/pcm.h3
-rw-r--r--sound/arm/pxa2xx-ac97.c4
-rw-r--r--sound/atmel/abdac.c3
-rw-r--r--sound/atmel/ac97c.c14
-rw-r--r--sound/drivers/aloop.c2
-rw-r--r--sound/drivers/dummy.c2
-rw-r--r--sound/drivers/pcsp/pcsp.c4
-rw-r--r--sound/isa/als100.c2
-rw-r--r--sound/oss/sb_audio.c4
-rw-r--r--sound/pci/cs46xx/cs46xx_lib.c2
-rw-r--r--sound/pci/ctxfi/ctatc.c4
-rw-r--r--sound/pci/hda/hda_beep.c29
-rw-r--r--sound/pci/hda/hda_codec.c73
-rw-r--r--sound/pci/hda/hda_codec.h1
-rw-r--r--sound/pci/hda/hda_intel.c9
-rw-r--r--sound/pci/hda/hda_proc.c2
-rw-r--r--sound/pci/hda/patch_ca0132.c174
-rw-r--r--sound/pci/hda/patch_sigmatel.c9
-rw-r--r--sound/pci/hda/patch_via.c8
-rw-r--r--sound/pci/lx6464es/lx6464es.c2
-rw-r--r--sound/pci/rme9652/hdspm.c2
-rw-r--r--sound/pci/sis7019.c5
-rw-r--r--sound/ppc/powermac.c2
-rw-r--r--sound/ppc/snd_ps3.c1
-rw-r--r--sound/soc/blackfin/bf6xx-sport.c7
-rw-r--r--sound/soc/codecs/wm5102.c25
-rw-r--r--sound/soc/codecs/wm5110.c12
-rw-r--r--sound/soc/codecs/wm8962.c15
-rw-r--r--sound/soc/codecs/wm8994.c2
-rw-r--r--sound/soc/codecs/wm9712.c21
-rw-r--r--sound/soc/davinci/davinci-mcasp.c10
-rw-r--r--sound/soc/fsl/imx-ssi.c5
-rw-r--r--sound/soc/mxs/Kconfig2
-rw-r--r--sound/soc/omap/mcbsp.c2
-rw-r--r--sound/soc/samsung/pcm.c2
-rw-r--r--sound/soc/soc-core.c10
-rw-r--r--sound/soc/soc-jack.c2
-rw-r--r--sound/usb/endpoint.c4
-rw-r--r--sound/usb/pcm.c3
40 files changed, 257 insertions, 233 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index 3aed8325a902..21372f36c158 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -7670,23 +7670,28 @@ S: Supported
7670F: Documentation/hwmon/wm83?? 7670F: Documentation/hwmon/wm83??
7671F: arch/arm/mach-s3c64xx/mach-crag6410* 7671F: arch/arm/mach-s3c64xx/mach-crag6410*
7672F: drivers/clk/clk-wm83*.c 7672F: drivers/clk/clk-wm83*.c
7673F: drivers/extcon/extcon-arizona.c
7673F: drivers/leds/leds-wm83*.c 7674F: drivers/leds/leds-wm83*.c
7674F: drivers/gpio/gpio-*wm*.c 7675F: drivers/gpio/gpio-*wm*.c
7676F: drivers/gpio/gpio-arizona.c
7675F: drivers/hwmon/wm83??-hwmon.c 7677F: drivers/hwmon/wm83??-hwmon.c
7676F: drivers/input/misc/wm831x-on.c 7678F: drivers/input/misc/wm831x-on.c
7677F: drivers/input/touchscreen/wm831x-ts.c 7679F: drivers/input/touchscreen/wm831x-ts.c
7678F: drivers/input/touchscreen/wm97*.c 7680F: drivers/input/touchscreen/wm97*.c
7679F: drivers/mfd/wm8*.c 7681F: drivers/mfd/arizona*
7682F: drivers/mfd/wm*.c
7680F: drivers/power/wm83*.c 7683F: drivers/power/wm83*.c
7681F: drivers/rtc/rtc-wm83*.c 7684F: drivers/rtc/rtc-wm83*.c
7682F: drivers/regulator/wm8*.c 7685F: drivers/regulator/wm8*.c
7683F: drivers/video/backlight/wm83*_bl.c 7686F: drivers/video/backlight/wm83*_bl.c
7684F: drivers/watchdog/wm83*_wdt.c 7687F: drivers/watchdog/wm83*_wdt.c
7688F: include/linux/mfd/arizona/
7685F: include/linux/mfd/wm831x/ 7689F: include/linux/mfd/wm831x/
7686F: include/linux/mfd/wm8350/ 7690F: include/linux/mfd/wm8350/
7687F: include/linux/mfd/wm8400* 7691F: include/linux/mfd/wm8400*
7688F: include/linux/wm97xx.h 7692F: include/linux/wm97xx.h
7689F: include/sound/wm????.h 7693F: include/sound/wm????.h
7694F: sound/soc/codecs/arizona.?
7690F: sound/soc/codecs/wm* 7695F: sound/soc/codecs/wm*
7691 7696
7692WORKQUEUE 7697WORKQUEUE
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index c75c0d1a85e2..cdca2ab1e711 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -1075,7 +1075,8 @@ static inline void snd_pcm_limit_isa_dma_size(int dma, size_t *max)
1075const char *snd_pcm_format_name(snd_pcm_format_t format); 1075const char *snd_pcm_format_name(snd_pcm_format_t format);
1076 1076
1077/** 1077/**
1078 * Get a string naming the direction of a stream 1078 * snd_pcm_stream_str - Get a string naming the direction of a stream
1079 * @substream: the pcm substream instance
1079 */ 1080 */
1080static inline const char *snd_pcm_stream_str(struct snd_pcm_substream *substream) 1081static inline const char *snd_pcm_stream_str(struct snd_pcm_substream *substream)
1081{ 1082{
diff --git a/sound/arm/pxa2xx-ac97.c b/sound/arm/pxa2xx-ac97.c
index 0d7b25e81643..4e1fda75c1c9 100644
--- a/sound/arm/pxa2xx-ac97.c
+++ b/sound/arm/pxa2xx-ac97.c
@@ -106,7 +106,7 @@ static struct pxa2xx_pcm_client pxa2xx_ac97_pcm_client = {
106 .prepare = pxa2xx_ac97_pcm_prepare, 106 .prepare = pxa2xx_ac97_pcm_prepare,
107}; 107};
108 108
109#ifdef CONFIG_PM 109#ifdef CONFIG_PM_SLEEP
110 110
111static int pxa2xx_ac97_do_suspend(struct snd_card *card) 111static int pxa2xx_ac97_do_suspend(struct snd_card *card)
112{ 112{
@@ -243,7 +243,7 @@ static struct platform_driver pxa2xx_ac97_driver = {
243 .driver = { 243 .driver = {
244 .name = "pxa2xx-ac97", 244 .name = "pxa2xx-ac97",
245 .owner = THIS_MODULE, 245 .owner = THIS_MODULE,
246#ifdef CONFIG_PM 246#ifdef CONFIG_PM_SLEEP
247 .pm = &pxa2xx_ac97_pm_ops, 247 .pm = &pxa2xx_ac97_pm_ops,
248#endif 248#endif
249 }, 249 },
diff --git a/sound/atmel/abdac.c b/sound/atmel/abdac.c
index eb4ceb71123e..277ebce23a45 100644
--- a/sound/atmel/abdac.c
+++ b/sound/atmel/abdac.c
@@ -452,6 +452,7 @@ static int __devinit atmel_abdac_probe(struct platform_device *pdev)
452 dac->regs = ioremap(regs->start, resource_size(regs)); 452 dac->regs = ioremap(regs->start, resource_size(regs));
453 if (!dac->regs) { 453 if (!dac->regs) {
454 dev_dbg(&pdev->dev, "could not remap register memory\n"); 454 dev_dbg(&pdev->dev, "could not remap register memory\n");
455 retval = -ENOMEM;
455 goto out_free_card; 456 goto out_free_card;
456 } 457 }
457 458
@@ -534,7 +535,7 @@ out_put_pclk:
534 return retval; 535 return retval;
535} 536}
536 537
537#ifdef CONFIG_PM 538#ifdef CONFIG_PM_SLEEP
538static int atmel_abdac_suspend(struct device *pdev) 539static int atmel_abdac_suspend(struct device *pdev)
539{ 540{
540 struct snd_card *card = dev_get_drvdata(pdev); 541 struct snd_card *card = dev_get_drvdata(pdev);
diff --git a/sound/atmel/ac97c.c b/sound/atmel/ac97c.c
index bf47025bdf45..9052aff37f64 100644
--- a/sound/atmel/ac97c.c
+++ b/sound/atmel/ac97c.c
@@ -278,14 +278,9 @@ static int atmel_ac97c_capture_hw_params(struct snd_pcm_substream *substream,
278 if (retval < 0) 278 if (retval < 0)
279 return retval; 279 return retval;
280 /* snd_pcm_lib_malloc_pages returns 1 if buffer is changed. */ 280 /* snd_pcm_lib_malloc_pages returns 1 if buffer is changed. */
281 if (cpu_is_at32ap7000()) { 281 if (cpu_is_at32ap7000() && retval == 1)
282 if (retval < 0) 282 if (test_and_clear_bit(DMA_RX_READY, &chip->flags))
283 return retval; 283 dw_dma_cyclic_free(chip->dma.rx_chan);
284 /* snd_pcm_lib_malloc_pages returns 1 if buffer is changed. */
285 if (retval == 1)
286 if (test_and_clear_bit(DMA_RX_READY, &chip->flags))
287 dw_dma_cyclic_free(chip->dma.rx_chan);
288 }
289 284
290 /* Set restrictions to params. */ 285 /* Set restrictions to params. */
291 mutex_lock(&opened_mutex); 286 mutex_lock(&opened_mutex);
@@ -980,6 +975,7 @@ static int __devinit atmel_ac97c_probe(struct platform_device *pdev)
980 975
981 if (!chip->regs) { 976 if (!chip->regs) {
982 dev_dbg(&pdev->dev, "could not remap register memory\n"); 977 dev_dbg(&pdev->dev, "could not remap register memory\n");
978 retval = -ENOMEM;
983 goto err_ioremap; 979 goto err_ioremap;
984 } 980 }
985 981
@@ -1134,7 +1130,7 @@ err_snd_card_new:
1134 return retval; 1130 return retval;
1135} 1131}
1136 1132
1137#ifdef CONFIG_PM 1133#ifdef CONFIG_PM_SLEEP
1138static int atmel_ac97c_suspend(struct device *pdev) 1134static int atmel_ac97c_suspend(struct device *pdev)
1139{ 1135{
1140 struct snd_card *card = dev_get_drvdata(pdev); 1136 struct snd_card *card = dev_get_drvdata(pdev);
diff --git a/sound/drivers/aloop.c b/sound/drivers/aloop.c
index 1128b35b2b05..5a34355e78e8 100644
--- a/sound/drivers/aloop.c
+++ b/sound/drivers/aloop.c
@@ -1176,7 +1176,7 @@ static int __devexit loopback_remove(struct platform_device *devptr)
1176 return 0; 1176 return 0;
1177} 1177}
1178 1178
1179#ifdef CONFIG_PM 1179#ifdef CONFIG_PM_SLEEP
1180static int loopback_suspend(struct device *pdev) 1180static int loopback_suspend(struct device *pdev)
1181{ 1181{
1182 struct snd_card *card = dev_get_drvdata(pdev); 1182 struct snd_card *card = dev_get_drvdata(pdev);
diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c
index f7d3bfc6bca8..54bb6644a598 100644
--- a/sound/drivers/dummy.c
+++ b/sound/drivers/dummy.c
@@ -1064,7 +1064,7 @@ static int __devexit snd_dummy_remove(struct platform_device *devptr)
1064 return 0; 1064 return 0;
1065} 1065}
1066 1066
1067#ifdef CONFIG_PM 1067#ifdef CONFIG_PM_SLEEP
1068static int snd_dummy_suspend(struct device *pdev) 1068static int snd_dummy_suspend(struct device *pdev)
1069{ 1069{
1070 struct snd_card *card = dev_get_drvdata(pdev); 1070 struct snd_card *card = dev_get_drvdata(pdev);
diff --git a/sound/drivers/pcsp/pcsp.c b/sound/drivers/pcsp/pcsp.c
index 6ca59fc6dcb9..ef171295f6d4 100644
--- a/sound/drivers/pcsp/pcsp.c
+++ b/sound/drivers/pcsp/pcsp.c
@@ -199,7 +199,7 @@ static void pcsp_stop_beep(struct snd_pcsp *chip)
199 pcspkr_stop_sound(); 199 pcspkr_stop_sound();
200} 200}
201 201
202#ifdef CONFIG_PM 202#ifdef CONFIG_PM_SLEEP
203static int pcsp_suspend(struct device *dev) 203static int pcsp_suspend(struct device *dev)
204{ 204{
205 struct snd_pcsp *chip = dev_get_drvdata(dev); 205 struct snd_pcsp *chip = dev_get_drvdata(dev);
@@ -212,7 +212,7 @@ static SIMPLE_DEV_PM_OPS(pcsp_pm, pcsp_suspend, NULL);
212#define PCSP_PM_OPS &pcsp_pm 212#define PCSP_PM_OPS &pcsp_pm
213#else 213#else
214#define PCSP_PM_OPS NULL 214#define PCSP_PM_OPS NULL
215#endif /* CONFIG_PM */ 215#endif /* CONFIG_PM_SLEEP */
216 216
217static void pcsp_shutdown(struct platform_device *dev) 217static void pcsp_shutdown(struct platform_device *dev)
218{ 218{
diff --git a/sound/isa/als100.c b/sound/isa/als100.c
index 2d67c78c9f4b..f7cdaf51512d 100644
--- a/sound/isa/als100.c
+++ b/sound/isa/als100.c
@@ -233,7 +233,7 @@ static int __devinit snd_card_als100_probe(int dev,
233 irq[dev], dma8[dev], dma16[dev]); 233 irq[dev], dma8[dev], dma16[dev]);
234 } 234 }
235 235
236 if ((error = snd_sb16dsp_pcm(chip, 0, NULL)) < 0) { 236 if ((error = snd_sb16dsp_pcm(chip, 0, &chip->pcm)) < 0) {
237 snd_card_free(card); 237 snd_card_free(card);
238 return error; 238 return error;
239 } 239 }
diff --git a/sound/oss/sb_audio.c b/sound/oss/sb_audio.c
index 733b014ec7d1..b2b3c014221a 100644
--- a/sound/oss/sb_audio.c
+++ b/sound/oss/sb_audio.c
@@ -575,13 +575,15 @@ static int jazz16_audio_set_speed(int dev, int speed)
575 if (speed > 0) 575 if (speed > 0)
576 { 576 {
577 int tmp; 577 int tmp;
578 int s = speed * devc->channels; 578 int s;
579 579
580 if (speed < 5000) 580 if (speed < 5000)
581 speed = 5000; 581 speed = 5000;
582 if (speed > 44100) 582 if (speed > 44100)
583 speed = 44100; 583 speed = 44100;
584 584
585 s = speed * devc->channels;
586
585 devc->tconst = (256 - ((1000000 + s / 2) / s)) & 0xff; 587 devc->tconst = (256 - ((1000000 + s / 2) / s)) & 0xff;
586 588
587 tmp = 256 - devc->tconst; 589 tmp = 256 - devc->tconst;
diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c
index f75f5ffdfdfb..a71d1c14a0f6 100644
--- a/sound/pci/cs46xx/cs46xx_lib.c
+++ b/sound/pci/cs46xx/cs46xx_lib.c
@@ -94,7 +94,7 @@ static unsigned short snd_cs46xx_codec_read(struct snd_cs46xx *chip,
94 94
95 if (snd_BUG_ON(codec_index != CS46XX_PRIMARY_CODEC_INDEX && 95 if (snd_BUG_ON(codec_index != CS46XX_PRIMARY_CODEC_INDEX &&
96 codec_index != CS46XX_SECONDARY_CODEC_INDEX)) 96 codec_index != CS46XX_SECONDARY_CODEC_INDEX))
97 return -EINVAL; 97 return 0xffff;
98 98
99 chip->active_ctrl(chip, 1); 99 chip->active_ctrl(chip, 1);
100 100
diff --git a/sound/pci/ctxfi/ctatc.c b/sound/pci/ctxfi/ctatc.c
index 8e40262d4117..2f6e9c762d3f 100644
--- a/sound/pci/ctxfi/ctatc.c
+++ b/sound/pci/ctxfi/ctatc.c
@@ -1725,8 +1725,10 @@ int __devinit ct_atc_create(struct snd_card *card, struct pci_dev *pci,
1725 atc_connect_resources(atc); 1725 atc_connect_resources(atc);
1726 1726
1727 atc->timer = ct_timer_new(atc); 1727 atc->timer = ct_timer_new(atc);
1728 if (!atc->timer) 1728 if (!atc->timer) {
1729 err = -ENOMEM;
1729 goto error1; 1730 goto error1;
1731 }
1730 1732
1731 err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, atc, &ops); 1733 err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, atc, &ops);
1732 if (err < 0) 1734 if (err < 0)
diff --git a/sound/pci/hda/hda_beep.c b/sound/pci/hda/hda_beep.c
index 0bc2315b181d..0849aac449f2 100644
--- a/sound/pci/hda/hda_beep.c
+++ b/sound/pci/hda/hda_beep.c
@@ -231,16 +231,22 @@ void snd_hda_detach_beep_device(struct hda_codec *codec)
231} 231}
232EXPORT_SYMBOL_HDA(snd_hda_detach_beep_device); 232EXPORT_SYMBOL_HDA(snd_hda_detach_beep_device);
233 233
234static bool ctl_has_mute(struct snd_kcontrol *kcontrol)
235{
236 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
237 return query_amp_caps(codec, get_amp_nid(kcontrol),
238 get_amp_direction(kcontrol)) & AC_AMPCAP_MUTE;
239}
240
234/* get/put callbacks for beep mute mixer switches */ 241/* get/put callbacks for beep mute mixer switches */
235int snd_hda_mixer_amp_switch_get_beep(struct snd_kcontrol *kcontrol, 242int snd_hda_mixer_amp_switch_get_beep(struct snd_kcontrol *kcontrol,
236 struct snd_ctl_elem_value *ucontrol) 243 struct snd_ctl_elem_value *ucontrol)
237{ 244{
238 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); 245 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
239 struct hda_beep *beep = codec->beep; 246 struct hda_beep *beep = codec->beep;
240 if (beep) { 247 if (beep && (!beep->enabled || !ctl_has_mute(kcontrol))) {
241 ucontrol->value.integer.value[0] = 248 ucontrol->value.integer.value[0] =
242 ucontrol->value.integer.value[1] = 249 ucontrol->value.integer.value[1] = beep->enabled;
243 beep->enabled;
244 return 0; 250 return 0;
245 } 251 }
246 return snd_hda_mixer_amp_switch_get(kcontrol, ucontrol); 252 return snd_hda_mixer_amp_switch_get(kcontrol, ucontrol);
@@ -252,9 +258,20 @@ int snd_hda_mixer_amp_switch_put_beep(struct snd_kcontrol *kcontrol,
252{ 258{
253 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); 259 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
254 struct hda_beep *beep = codec->beep; 260 struct hda_beep *beep = codec->beep;
255 if (beep) 261 if (beep) {
256 snd_hda_enable_beep_device(codec, 262 u8 chs = get_amp_channels(kcontrol);
257 *ucontrol->value.integer.value); 263 int enable = 0;
264 long *valp = ucontrol->value.integer.value;
265 if (chs & 1) {
266 enable |= *valp;
267 valp++;
268 }
269 if (chs & 2)
270 enable |= *valp;
271 snd_hda_enable_beep_device(codec, enable);
272 }
273 if (!ctl_has_mute(kcontrol))
274 return 0;
258 return snd_hda_mixer_amp_switch_put(kcontrol, ucontrol); 275 return snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
259} 276}
260EXPORT_SYMBOL_HDA(snd_hda_mixer_amp_switch_put_beep); 277EXPORT_SYMBOL_HDA(snd_hda_mixer_amp_switch_put_beep);
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 88a9c20eb7a2..f560051a949e 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -1386,6 +1386,44 @@ int snd_hda_codec_configure(struct hda_codec *codec)
1386} 1386}
1387EXPORT_SYMBOL_HDA(snd_hda_codec_configure); 1387EXPORT_SYMBOL_HDA(snd_hda_codec_configure);
1388 1388
1389/* update the stream-id if changed */
1390static void update_pcm_stream_id(struct hda_codec *codec,
1391 struct hda_cvt_setup *p, hda_nid_t nid,
1392 u32 stream_tag, int channel_id)
1393{
1394 unsigned int oldval, newval;
1395
1396 if (p->stream_tag != stream_tag || p->channel_id != channel_id) {
1397 oldval = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_CONV, 0);
1398 newval = (stream_tag << 4) | channel_id;
1399 if (oldval != newval)
1400 snd_hda_codec_write(codec, nid, 0,
1401 AC_VERB_SET_CHANNEL_STREAMID,
1402 newval);
1403 p->stream_tag = stream_tag;
1404 p->channel_id = channel_id;
1405 }
1406}
1407
1408/* update the format-id if changed */
1409static void update_pcm_format(struct hda_codec *codec, struct hda_cvt_setup *p,
1410 hda_nid_t nid, int format)
1411{
1412 unsigned int oldval;
1413
1414 if (p->format_id != format) {
1415 oldval = snd_hda_codec_read(codec, nid, 0,
1416 AC_VERB_GET_STREAM_FORMAT, 0);
1417 if (oldval != format) {
1418 msleep(1);
1419 snd_hda_codec_write(codec, nid, 0,
1420 AC_VERB_SET_STREAM_FORMAT,
1421 format);
1422 }
1423 p->format_id = format;
1424 }
1425}
1426
1389/** 1427/**
1390 * snd_hda_codec_setup_stream - set up the codec for streaming 1428 * snd_hda_codec_setup_stream - set up the codec for streaming
1391 * @codec: the CODEC to set up 1429 * @codec: the CODEC to set up
@@ -1400,7 +1438,6 @@ void snd_hda_codec_setup_stream(struct hda_codec *codec, hda_nid_t nid,
1400{ 1438{
1401 struct hda_codec *c; 1439 struct hda_codec *c;
1402 struct hda_cvt_setup *p; 1440 struct hda_cvt_setup *p;
1403 unsigned int oldval, newval;
1404 int type; 1441 int type;
1405 int i; 1442 int i;
1406 1443
@@ -1413,29 +1450,13 @@ void snd_hda_codec_setup_stream(struct hda_codec *codec, hda_nid_t nid,
1413 p = get_hda_cvt_setup(codec, nid); 1450 p = get_hda_cvt_setup(codec, nid);
1414 if (!p) 1451 if (!p)
1415 return; 1452 return;
1416 /* update the stream-id if changed */ 1453
1417 if (p->stream_tag != stream_tag || p->channel_id != channel_id) { 1454 if (codec->pcm_format_first)
1418 oldval = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_CONV, 0); 1455 update_pcm_format(codec, p, nid, format);
1419 newval = (stream_tag << 4) | channel_id; 1456 update_pcm_stream_id(codec, p, nid, stream_tag, channel_id);
1420 if (oldval != newval) 1457 if (!codec->pcm_format_first)
1421 snd_hda_codec_write(codec, nid, 0, 1458 update_pcm_format(codec, p, nid, format);
1422 AC_VERB_SET_CHANNEL_STREAMID, 1459
1423 newval);
1424 p->stream_tag = stream_tag;
1425 p->channel_id = channel_id;
1426 }
1427 /* update the format-id if changed */
1428 if (p->format_id != format) {
1429 oldval = snd_hda_codec_read(codec, nid, 0,
1430 AC_VERB_GET_STREAM_FORMAT, 0);
1431 if (oldval != format) {
1432 msleep(1);
1433 snd_hda_codec_write(codec, nid, 0,
1434 AC_VERB_SET_STREAM_FORMAT,
1435 format);
1436 }
1437 p->format_id = format;
1438 }
1439 p->active = 1; 1460 p->active = 1;
1440 p->dirty = 0; 1461 p->dirty = 0;
1441 1462
@@ -3497,7 +3518,7 @@ static bool snd_hda_codec_get_supported_ps(struct hda_codec *codec, hda_nid_t fg
3497{ 3518{
3498 int sup = snd_hda_param_read(codec, fg, AC_PAR_POWER_STATE); 3519 int sup = snd_hda_param_read(codec, fg, AC_PAR_POWER_STATE);
3499 3520
3500 if (sup < 0) 3521 if (sup == -1)
3501 return false; 3522 return false;
3502 if (sup & power_state) 3523 if (sup & power_state)
3503 return true; 3524 return true;
@@ -4433,6 +4454,8 @@ static void __snd_hda_power_up(struct hda_codec *codec, bool wait_power_down)
4433 * then there is no need to go through power up here. 4454 * then there is no need to go through power up here.
4434 */ 4455 */
4435 if (codec->power_on) { 4456 if (codec->power_on) {
4457 if (codec->power_transition < 0)
4458 codec->power_transition = 0;
4436 spin_unlock(&codec->power_lock); 4459 spin_unlock(&codec->power_lock);
4437 return; 4460 return;
4438 } 4461 }
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h
index c422d330ca54..7fbc1bcaf1a9 100644
--- a/sound/pci/hda/hda_codec.h
+++ b/sound/pci/hda/hda_codec.h
@@ -861,6 +861,7 @@ struct hda_codec {
861 unsigned int no_trigger_sense:1; /* don't trigger at pin-sensing */ 861 unsigned int no_trigger_sense:1; /* don't trigger at pin-sensing */
862 unsigned int ignore_misc_bit:1; /* ignore MISC_NO_PRESENCE bit */ 862 unsigned int ignore_misc_bit:1; /* ignore MISC_NO_PRESENCE bit */
863 unsigned int no_jack_detect:1; /* Machine has no jack-detection */ 863 unsigned int no_jack_detect:1; /* Machine has no jack-detection */
864 unsigned int pcm_format_first:1; /* PCM format must be set first */
864#ifdef CONFIG_SND_HDA_POWER_SAVE 865#ifdef CONFIG_SND_HDA_POWER_SAVE
865 unsigned int power_on :1; /* current (global) power-state */ 866 unsigned int power_on :1; /* current (global) power-state */
866 int power_transition; /* power-state in transition */ 867 int power_transition; /* power-state in transition */
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index c8aced182fd1..60882c62f180 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -151,6 +151,7 @@ MODULE_SUPPORTED_DEVICE("{{Intel, ICH6},"
151 "{Intel, CPT}," 151 "{Intel, CPT},"
152 "{Intel, PPT}," 152 "{Intel, PPT},"
153 "{Intel, LPT}," 153 "{Intel, LPT},"
154 "{Intel, LPT_LP},"
154 "{Intel, HPT}," 155 "{Intel, HPT},"
155 "{Intel, PBG}," 156 "{Intel, PBG},"
156 "{Intel, SCH}," 157 "{Intel, SCH},"
@@ -3270,6 +3271,14 @@ static DEFINE_PCI_DEVICE_TABLE(azx_ids) = {
3270 { PCI_DEVICE(0x8086, 0x8c20), 3271 { PCI_DEVICE(0x8086, 0x8c20),
3271 .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_SCH_SNOOP | 3272 .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_SCH_SNOOP |
3272 AZX_DCAPS_BUFSIZE | AZX_DCAPS_POSFIX_COMBO }, 3273 AZX_DCAPS_BUFSIZE | AZX_DCAPS_POSFIX_COMBO },
3274 /* Lynx Point-LP */
3275 { PCI_DEVICE(0x8086, 0x9c20),
3276 .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_SCH_SNOOP |
3277 AZX_DCAPS_BUFSIZE | AZX_DCAPS_POSFIX_COMBO },
3278 /* Lynx Point-LP */
3279 { PCI_DEVICE(0x8086, 0x9c21),
3280 .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_SCH_SNOOP |
3281 AZX_DCAPS_BUFSIZE | AZX_DCAPS_POSFIX_COMBO },
3273 /* Haswell */ 3282 /* Haswell */
3274 { PCI_DEVICE(0x8086, 0x0c0c), 3283 { PCI_DEVICE(0x8086, 0x0c0c),
3275 .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_SCH_SNOOP | 3284 .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_SCH_SNOOP |
diff --git a/sound/pci/hda/hda_proc.c b/sound/pci/hda/hda_proc.c
index 7e46258fc700..6894ec66258c 100644
--- a/sound/pci/hda/hda_proc.c
+++ b/sound/pci/hda/hda_proc.c
@@ -412,7 +412,7 @@ static void print_digital_conv(struct snd_info_buffer *buffer,
412 if (digi1 & AC_DIG1_EMPHASIS) 412 if (digi1 & AC_DIG1_EMPHASIS)
413 snd_iprintf(buffer, " Preemphasis"); 413 snd_iprintf(buffer, " Preemphasis");
414 if (digi1 & AC_DIG1_COPYRIGHT) 414 if (digi1 & AC_DIG1_COPYRIGHT)
415 snd_iprintf(buffer, " Copyright"); 415 snd_iprintf(buffer, " Non-Copyright");
416 if (digi1 & AC_DIG1_NONAUDIO) 416 if (digi1 & AC_DIG1_NONAUDIO)
417 snd_iprintf(buffer, " Non-Audio"); 417 snd_iprintf(buffer, " Non-Audio");
418 if (digi1 & AC_DIG1_PROFESSIONAL) 418 if (digi1 & AC_DIG1_PROFESSIONAL)
diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c
index d0d3540e39e7..49750a96d649 100644
--- a/sound/pci/hda/patch_ca0132.c
+++ b/sound/pci/hda/patch_ca0132.c
@@ -246,7 +246,7 @@ static void init_output(struct hda_codec *codec, hda_nid_t pin, hda_nid_t dac)
246 AC_VERB_SET_AMP_GAIN_MUTE, 246 AC_VERB_SET_AMP_GAIN_MUTE,
247 AMP_OUT_UNMUTE); 247 AMP_OUT_UNMUTE);
248 } 248 }
249 if (dac) 249 if (dac && (get_wcaps(codec, dac) & AC_WCAP_OUT_AMP))
250 snd_hda_codec_write(codec, dac, 0, 250 snd_hda_codec_write(codec, dac, 0,
251 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO); 251 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO);
252} 252}
@@ -261,7 +261,7 @@ static void init_input(struct hda_codec *codec, hda_nid_t pin, hda_nid_t adc)
261 AC_VERB_SET_AMP_GAIN_MUTE, 261 AC_VERB_SET_AMP_GAIN_MUTE,
262 AMP_IN_UNMUTE(0)); 262 AMP_IN_UNMUTE(0));
263 } 263 }
264 if (adc) 264 if (adc && (get_wcaps(codec, adc) & AC_WCAP_IN_AMP))
265 snd_hda_codec_write(codec, adc, 0, AC_VERB_SET_AMP_GAIN_MUTE, 265 snd_hda_codec_write(codec, adc, 0, AC_VERB_SET_AMP_GAIN_MUTE,
266 AMP_IN_UNMUTE(0)); 266 AMP_IN_UNMUTE(0));
267} 267}
@@ -275,6 +275,10 @@ static int _add_switch(struct hda_codec *codec, hda_nid_t nid, const char *pfx,
275 int type = dir ? HDA_INPUT : HDA_OUTPUT; 275 int type = dir ? HDA_INPUT : HDA_OUTPUT;
276 struct snd_kcontrol_new knew = 276 struct snd_kcontrol_new knew =
277 HDA_CODEC_MUTE_MONO(namestr, nid, chan, 0, type); 277 HDA_CODEC_MUTE_MONO(namestr, nid, chan, 0, type);
278 if ((query_amp_caps(codec, nid, type) & AC_AMPCAP_MUTE) == 0) {
279 snd_printdd("Skipping '%s %s Switch' (no mute on node 0x%x)\n", pfx, dirstr[dir], nid);
280 return 0;
281 }
278 sprintf(namestr, "%s %s Switch", pfx, dirstr[dir]); 282 sprintf(namestr, "%s %s Switch", pfx, dirstr[dir]);
279 return snd_hda_ctl_add(codec, nid, snd_ctl_new1(&knew, codec)); 283 return snd_hda_ctl_add(codec, nid, snd_ctl_new1(&knew, codec));
280} 284}
@@ -286,6 +290,10 @@ static int _add_volume(struct hda_codec *codec, hda_nid_t nid, const char *pfx,
286 int type = dir ? HDA_INPUT : HDA_OUTPUT; 290 int type = dir ? HDA_INPUT : HDA_OUTPUT;
287 struct snd_kcontrol_new knew = 291 struct snd_kcontrol_new knew =
288 HDA_CODEC_VOLUME_MONO(namestr, nid, chan, 0, type); 292 HDA_CODEC_VOLUME_MONO(namestr, nid, chan, 0, type);
293 if ((query_amp_caps(codec, nid, type) & AC_AMPCAP_NUM_STEPS) == 0) {
294 snd_printdd("Skipping '%s %s Volume' (no amp on node 0x%x)\n", pfx, dirstr[dir], nid);
295 return 0;
296 }
289 sprintf(namestr, "%s %s Volume", pfx, dirstr[dir]); 297 sprintf(namestr, "%s %s Volume", pfx, dirstr[dir]);
290 return snd_hda_ctl_add(codec, nid, snd_ctl_new1(&knew, codec)); 298 return snd_hda_ctl_add(codec, nid, snd_ctl_new1(&knew, codec));
291} 299}
@@ -464,50 +472,17 @@ exit:
464} 472}
465 473
466/* 474/*
467 * PCM stuffs 475 * PCM callbacks
468 */ 476 */
469static void ca0132_setup_stream(struct hda_codec *codec, hda_nid_t nid, 477static int ca0132_playback_pcm_open(struct hda_pcm_stream *hinfo,
470 u32 stream_tag, 478 struct hda_codec *codec,
471 int channel_id, int format) 479 struct snd_pcm_substream *substream)
472{ 480{
473 unsigned int oldval, newval; 481 struct ca0132_spec *spec = codec->spec;
474 482 return snd_hda_multi_out_analog_open(codec, &spec->multiout, substream,
475 if (!nid) 483 hinfo);
476 return;
477
478 snd_printdd("ca0132_setup_stream: "
479 "NID=0x%x, stream=0x%x, channel=%d, format=0x%x\n",
480 nid, stream_tag, channel_id, format);
481
482 /* update the format-id if changed */
483 oldval = snd_hda_codec_read(codec, nid, 0,
484 AC_VERB_GET_STREAM_FORMAT,
485 0);
486 if (oldval != format) {
487 msleep(20);
488 snd_hda_codec_write(codec, nid, 0,
489 AC_VERB_SET_STREAM_FORMAT,
490 format);
491 }
492
493 oldval = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_CONV, 0);
494 newval = (stream_tag << 4) | channel_id;
495 if (oldval != newval) {
496 snd_hda_codec_write(codec, nid, 0,
497 AC_VERB_SET_CHANNEL_STREAMID,
498 newval);
499 }
500}
501
502static void ca0132_cleanup_stream(struct hda_codec *codec, hda_nid_t nid)
503{
504 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_STREAM_FORMAT, 0);
505 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_CHANNEL_STREAMID, 0);
506} 484}
507 485
508/*
509 * PCM callbacks
510 */
511static int ca0132_playback_pcm_prepare(struct hda_pcm_stream *hinfo, 486static int ca0132_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
512 struct hda_codec *codec, 487 struct hda_codec *codec,
513 unsigned int stream_tag, 488 unsigned int stream_tag,
@@ -515,10 +490,8 @@ static int ca0132_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
515 struct snd_pcm_substream *substream) 490 struct snd_pcm_substream *substream)
516{ 491{
517 struct ca0132_spec *spec = codec->spec; 492 struct ca0132_spec *spec = codec->spec;
518 493 return snd_hda_multi_out_analog_prepare(codec, &spec->multiout,
519 ca0132_setup_stream(codec, spec->dacs[0], stream_tag, 0, format); 494 stream_tag, format, substream);
520
521 return 0;
522} 495}
523 496
524static int ca0132_playback_pcm_cleanup(struct hda_pcm_stream *hinfo, 497static int ca0132_playback_pcm_cleanup(struct hda_pcm_stream *hinfo,
@@ -526,92 +499,45 @@ static int ca0132_playback_pcm_cleanup(struct hda_pcm_stream *hinfo,
526 struct snd_pcm_substream *substream) 499 struct snd_pcm_substream *substream)
527{ 500{
528 struct ca0132_spec *spec = codec->spec; 501 struct ca0132_spec *spec = codec->spec;
529 502 return snd_hda_multi_out_analog_cleanup(codec, &spec->multiout);
530 ca0132_cleanup_stream(codec, spec->dacs[0]);
531
532 return 0;
533} 503}
534 504
535/* 505/*
536 * Digital out 506 * Digital out
537 */ 507 */
538static int ca0132_dig_playback_pcm_prepare(struct hda_pcm_stream *hinfo, 508static int ca0132_dig_playback_pcm_open(struct hda_pcm_stream *hinfo,
539 struct hda_codec *codec, 509 struct hda_codec *codec,
540 unsigned int stream_tag, 510 struct snd_pcm_substream *substream)
541 unsigned int format,
542 struct snd_pcm_substream *substream)
543{ 511{
544 struct ca0132_spec *spec = codec->spec; 512 struct ca0132_spec *spec = codec->spec;
545 513 return snd_hda_multi_out_dig_open(codec, &spec->multiout);
546 ca0132_setup_stream(codec, spec->dig_out, stream_tag, 0, format);
547
548 return 0;
549} 514}
550 515
551static int ca0132_dig_playback_pcm_cleanup(struct hda_pcm_stream *hinfo, 516static int ca0132_dig_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
552 struct hda_codec *codec,
553 struct snd_pcm_substream *substream)
554{
555 struct ca0132_spec *spec = codec->spec;
556
557 ca0132_cleanup_stream(codec, spec->dig_out);
558
559 return 0;
560}
561
562/*
563 * Analog capture
564 */
565static int ca0132_capture_pcm_prepare(struct hda_pcm_stream *hinfo,
566 struct hda_codec *codec, 517 struct hda_codec *codec,
567 unsigned int stream_tag, 518 unsigned int stream_tag,
568 unsigned int format, 519 unsigned int format,
569 struct snd_pcm_substream *substream) 520 struct snd_pcm_substream *substream)
570{ 521{
571 struct ca0132_spec *spec = codec->spec; 522 struct ca0132_spec *spec = codec->spec;
572 523 return snd_hda_multi_out_dig_prepare(codec, &spec->multiout,
573 ca0132_setup_stream(codec, spec->adcs[substream->number], 524 stream_tag, format, substream);
574 stream_tag, 0, format);
575
576 return 0;
577} 525}
578 526
579static int ca0132_capture_pcm_cleanup(struct hda_pcm_stream *hinfo, 527static int ca0132_dig_playback_pcm_cleanup(struct hda_pcm_stream *hinfo,
580 struct hda_codec *codec, 528 struct hda_codec *codec,
581 struct snd_pcm_substream *substream) 529 struct snd_pcm_substream *substream)
582{ 530{
583 struct ca0132_spec *spec = codec->spec; 531 struct ca0132_spec *spec = codec->spec;
584 532 return snd_hda_multi_out_dig_cleanup(codec, &spec->multiout);
585 ca0132_cleanup_stream(codec, spec->adcs[substream->number]);
586
587 return 0;
588} 533}
589 534
590/* 535static int ca0132_dig_playback_pcm_close(struct hda_pcm_stream *hinfo,
591 * Digital capture 536 struct hda_codec *codec,
592 */ 537 struct snd_pcm_substream *substream)
593static int ca0132_dig_capture_pcm_prepare(struct hda_pcm_stream *hinfo,
594 struct hda_codec *codec,
595 unsigned int stream_tag,
596 unsigned int format,
597 struct snd_pcm_substream *substream)
598{ 538{
599 struct ca0132_spec *spec = codec->spec; 539 struct ca0132_spec *spec = codec->spec;
600 540 return snd_hda_multi_out_dig_close(codec, &spec->multiout);
601 ca0132_setup_stream(codec, spec->dig_in, stream_tag, 0, format);
602
603 return 0;
604}
605
606static int ca0132_dig_capture_pcm_cleanup(struct hda_pcm_stream *hinfo,
607 struct hda_codec *codec,
608 struct snd_pcm_substream *substream)
609{
610 struct ca0132_spec *spec = codec->spec;
611
612 ca0132_cleanup_stream(codec, spec->dig_in);
613
614 return 0;
615} 541}
616 542
617/* 543/*
@@ -621,6 +547,7 @@ static struct hda_pcm_stream ca0132_pcm_analog_playback = {
621 .channels_min = 2, 547 .channels_min = 2,
622 .channels_max = 2, 548 .channels_max = 2,
623 .ops = { 549 .ops = {
550 .open = ca0132_playback_pcm_open,
624 .prepare = ca0132_playback_pcm_prepare, 551 .prepare = ca0132_playback_pcm_prepare,
625 .cleanup = ca0132_playback_pcm_cleanup 552 .cleanup = ca0132_playback_pcm_cleanup
626 }, 553 },
@@ -630,10 +557,6 @@ static struct hda_pcm_stream ca0132_pcm_analog_capture = {
630 .substreams = 1, 557 .substreams = 1,
631 .channels_min = 2, 558 .channels_min = 2,
632 .channels_max = 2, 559 .channels_max = 2,
633 .ops = {
634 .prepare = ca0132_capture_pcm_prepare,
635 .cleanup = ca0132_capture_pcm_cleanup
636 },
637}; 560};
638 561
639static struct hda_pcm_stream ca0132_pcm_digital_playback = { 562static struct hda_pcm_stream ca0132_pcm_digital_playback = {
@@ -641,6 +564,8 @@ static struct hda_pcm_stream ca0132_pcm_digital_playback = {
641 .channels_min = 2, 564 .channels_min = 2,
642 .channels_max = 2, 565 .channels_max = 2,
643 .ops = { 566 .ops = {
567 .open = ca0132_dig_playback_pcm_open,
568 .close = ca0132_dig_playback_pcm_close,
644 .prepare = ca0132_dig_playback_pcm_prepare, 569 .prepare = ca0132_dig_playback_pcm_prepare,
645 .cleanup = ca0132_dig_playback_pcm_cleanup 570 .cleanup = ca0132_dig_playback_pcm_cleanup
646 }, 571 },
@@ -650,10 +575,6 @@ static struct hda_pcm_stream ca0132_pcm_digital_capture = {
650 .substreams = 1, 575 .substreams = 1,
651 .channels_min = 2, 576 .channels_min = 2,
652 .channels_max = 2, 577 .channels_max = 2,
653 .ops = {
654 .prepare = ca0132_dig_capture_pcm_prepare,
655 .cleanup = ca0132_dig_capture_pcm_cleanup
656 },
657}; 578};
658 579
659static int ca0132_build_pcms(struct hda_codec *codec) 580static int ca0132_build_pcms(struct hda_codec *codec)
@@ -928,18 +849,16 @@ static int ca0132_build_controls(struct hda_codec *codec)
928 spec->dig_out); 849 spec->dig_out);
929 if (err < 0) 850 if (err < 0)
930 return err; 851 return err;
931 err = add_out_volume(codec, spec->dig_out, "IEC958"); 852 err = snd_hda_create_spdif_share_sw(codec, &spec->multiout);
932 if (err < 0) 853 if (err < 0)
933 return err; 854 return err;
855 /* spec->multiout.share_spdif = 1; */
934 } 856 }
935 857
936 if (spec->dig_in) { 858 if (spec->dig_in) {
937 err = snd_hda_create_spdif_in_ctls(codec, spec->dig_in); 859 err = snd_hda_create_spdif_in_ctls(codec, spec->dig_in);
938 if (err < 0) 860 if (err < 0)
939 return err; 861 return err;
940 err = add_in_volume(codec, spec->dig_in, "IEC958");
941 if (err < 0)
942 return err;
943 } 862 }
944 return 0; 863 return 0;
945} 864}
@@ -961,6 +880,9 @@ static void ca0132_config(struct hda_codec *codec)
961 struct ca0132_spec *spec = codec->spec; 880 struct ca0132_spec *spec = codec->spec;
962 struct auto_pin_cfg *cfg = &spec->autocfg; 881 struct auto_pin_cfg *cfg = &spec->autocfg;
963 882
883 codec->pcm_format_first = 1;
884 codec->no_sticky_stream = 1;
885
964 /* line-outs */ 886 /* line-outs */
965 cfg->line_outs = 1; 887 cfg->line_outs = 1;
966 cfg->line_out_pins[0] = 0x0b; /* front */ 888 cfg->line_out_pins[0] = 0x0b; /* front */
@@ -988,14 +910,24 @@ static void ca0132_config(struct hda_codec *codec)
988 910
989 /* Mic-in */ 911 /* Mic-in */
990 spec->input_pins[0] = 0x12; 912 spec->input_pins[0] = 0x12;
991 spec->input_labels[0] = "Mic-In"; 913 spec->input_labels[0] = "Mic";
992 spec->adcs[0] = 0x07; 914 spec->adcs[0] = 0x07;
993 915
994 /* Line-In */ 916 /* Line-In */
995 spec->input_pins[1] = 0x11; 917 spec->input_pins[1] = 0x11;
996 spec->input_labels[1] = "Line-In"; 918 spec->input_labels[1] = "Line";
997 spec->adcs[1] = 0x08; 919 spec->adcs[1] = 0x08;
998 spec->num_inputs = 2; 920 spec->num_inputs = 2;
921
922 /* SPDIF I/O */
923 spec->dig_out = 0x05;
924 spec->multiout.dig_out_nid = spec->dig_out;
925 cfg->dig_out_pins[0] = 0x0c;
926 cfg->dig_outs = 1;
927 cfg->dig_out_type[0] = HDA_PCM_TYPE_SPDIF;
928 spec->dig_in = 0x09;
929 cfg->dig_in_pin = 0x0e;
930 cfg->dig_in_type = HDA_PCM_TYPE_SPDIF;
999} 931}
1000 932
1001static void ca0132_init_chip(struct hda_codec *codec) 933static void ca0132_init_chip(struct hda_codec *codec)
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 94040ccf8e8f..ea5775a1a7db 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -4272,7 +4272,8 @@ static int stac92xx_init(struct hda_codec *codec)
4272 unsigned int gpio; 4272 unsigned int gpio;
4273 int i; 4273 int i;
4274 4274
4275 snd_hda_sequence_write(codec, spec->init); 4275 if (spec->init)
4276 snd_hda_sequence_write(codec, spec->init);
4276 4277
4277 /* power down adcs initially */ 4278 /* power down adcs initially */
4278 if (spec->powerdown_adcs) 4279 if (spec->powerdown_adcs)
@@ -5748,7 +5749,6 @@ again:
5748 /* fallthru */ 5749 /* fallthru */
5749 case 0x111d76b4: /* 6 Port without Analog Mixer */ 5750 case 0x111d76b4: /* 6 Port without Analog Mixer */
5750 case 0x111d76b5: 5751 case 0x111d76b5:
5751 spec->init = stac92hd71bxx_core_init;
5752 codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs; 5752 codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs;
5753 spec->num_dmics = stac92xx_connected_ports(codec, 5753 spec->num_dmics = stac92xx_connected_ports(codec,
5754 stac92hd71bxx_dmic_nids, 5754 stac92hd71bxx_dmic_nids,
@@ -5773,7 +5773,6 @@ again:
5773 spec->stream_delay = 40; /* 40 milliseconds */ 5773 spec->stream_delay = 40; /* 40 milliseconds */
5774 5774
5775 /* disable VSW */ 5775 /* disable VSW */
5776 spec->init = stac92hd71bxx_core_init;
5777 unmute_init++; 5776 unmute_init++;
5778 snd_hda_codec_set_pincfg(codec, 0x0f, 0x40f000f0); 5777 snd_hda_codec_set_pincfg(codec, 0x0f, 0x40f000f0);
5779 snd_hda_codec_set_pincfg(codec, 0x19, 0x40f000f3); 5778 snd_hda_codec_set_pincfg(codec, 0x19, 0x40f000f3);
@@ -5788,7 +5787,6 @@ again:
5788 5787
5789 /* fallthru */ 5788 /* fallthru */
5790 default: 5789 default:
5791 spec->init = stac92hd71bxx_core_init;
5792 codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs; 5790 codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs;
5793 spec->num_dmics = stac92xx_connected_ports(codec, 5791 spec->num_dmics = stac92xx_connected_ports(codec,
5794 stac92hd71bxx_dmic_nids, 5792 stac92hd71bxx_dmic_nids,
@@ -5796,6 +5794,9 @@ again:
5796 break; 5794 break;
5797 } 5795 }
5798 5796
5797 if (get_wcaps_type(get_wcaps(codec, 0x28)) == AC_WID_VOL_KNB)
5798 spec->init = stac92hd71bxx_core_init;
5799
5799 if (get_wcaps(codec, 0xa) & AC_WCAP_IN_AMP) 5800 if (get_wcaps(codec, 0xa) & AC_WCAP_IN_AMP)
5800 snd_hda_sequence_write_cache(codec, unmute_init); 5801 snd_hda_sequence_write_cache(codec, unmute_init);
5801 5802
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c
index 80d90cb42853..430771776915 100644
--- a/sound/pci/hda/patch_via.c
+++ b/sound/pci/hda/patch_via.c
@@ -1752,6 +1752,14 @@ static int via_suspend(struct hda_codec *codec)
1752{ 1752{
1753 struct via_spec *spec = codec->spec; 1753 struct via_spec *spec = codec->spec;
1754 vt1708_stop_hp_work(spec); 1754 vt1708_stop_hp_work(spec);
1755
1756 if (spec->codec_type == VT1802) {
1757 /* Fix pop noise on headphones */
1758 int i;
1759 for (i = 0; i < spec->autocfg.hp_outs; i++)
1760 snd_hda_set_pin_ctl(codec, spec->autocfg.hp_pins[i], 0);
1761 }
1762
1755 return 0; 1763 return 0;
1756} 1764}
1757#endif 1765#endif
diff --git a/sound/pci/lx6464es/lx6464es.c b/sound/pci/lx6464es/lx6464es.c
index d1ab43706735..5579b08bb35b 100644
--- a/sound/pci/lx6464es/lx6464es.c
+++ b/sound/pci/lx6464es/lx6464es.c
@@ -851,6 +851,8 @@ static int __devinit lx_pcm_create(struct lx6464es *chip)
851 /* hardcoded device name & channel count */ 851 /* hardcoded device name & channel count */
852 err = snd_pcm_new(chip->card, (char *)card_name, 0, 852 err = snd_pcm_new(chip->card, (char *)card_name, 0,
853 1, 1, &pcm); 853 1, 1, &pcm);
854 if (err < 0)
855 return err;
854 856
855 pcm->private_data = chip; 857 pcm->private_data = chip;
856 858
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c
index b8ac8710f47f..b12308b5ba2a 100644
--- a/sound/pci/rme9652/hdspm.c
+++ b/sound/pci/rme9652/hdspm.c
@@ -6585,7 +6585,7 @@ static int __devinit snd_hdspm_create(struct snd_card *card,
6585 snd_printk(KERN_ERR "HDSPM: " 6585 snd_printk(KERN_ERR "HDSPM: "
6586 "unable to kmalloc Mixer memory of %d Bytes\n", 6586 "unable to kmalloc Mixer memory of %d Bytes\n",
6587 (int)sizeof(struct hdspm_mixer)); 6587 (int)sizeof(struct hdspm_mixer));
6588 return err; 6588 return -ENOMEM;
6589 } 6589 }
6590 6590
6591 hdspm->port_names_in = NULL; 6591 hdspm->port_names_in = NULL;
diff --git a/sound/pci/sis7019.c b/sound/pci/sis7019.c
index 512434efcc31..805ab6e9a78f 100644
--- a/sound/pci/sis7019.c
+++ b/sound/pci/sis7019.c
@@ -1377,8 +1377,9 @@ static int __devinit sis_chip_create(struct snd_card *card,
1377 if (rc) 1377 if (rc)
1378 goto error_out_cleanup; 1378 goto error_out_cleanup;
1379 1379
1380 if (request_irq(pci->irq, sis_interrupt, IRQF_SHARED, KBUILD_MODNAME, 1380 rc = request_irq(pci->irq, sis_interrupt, IRQF_SHARED, KBUILD_MODNAME,
1381 sis)) { 1381 sis);
1382 if (rc) {
1382 dev_err(&pci->dev, "unable to allocate irq %d\n", sis->irq); 1383 dev_err(&pci->dev, "unable to allocate irq %d\n", sis->irq);
1383 goto error_out_cleanup; 1384 goto error_out_cleanup;
1384 } 1385 }
diff --git a/sound/ppc/powermac.c b/sound/ppc/powermac.c
index f5ceb6f282de..210cafe04890 100644
--- a/sound/ppc/powermac.c
+++ b/sound/ppc/powermac.c
@@ -143,7 +143,7 @@ static int __devexit snd_pmac_remove(struct platform_device *devptr)
143 return 0; 143 return 0;
144} 144}
145 145
146#ifdef CONFIG_PM 146#ifdef CONFIG_PM_SLEEP
147static int snd_pmac_driver_suspend(struct device *dev) 147static int snd_pmac_driver_suspend(struct device *dev)
148{ 148{
149 struct snd_card *card = dev_get_drvdata(dev); 149 struct snd_card *card = dev_get_drvdata(dev);
diff --git a/sound/ppc/snd_ps3.c b/sound/ppc/snd_ps3.c
index 1aa52eff526a..9b18b5243a56 100644
--- a/sound/ppc/snd_ps3.c
+++ b/sound/ppc/snd_ps3.c
@@ -1040,6 +1040,7 @@ static int __devinit snd_ps3_driver_probe(struct ps3_system_bus_device *dev)
1040 GFP_KERNEL); 1040 GFP_KERNEL);
1041 if (!the_card.null_buffer_start_vaddr) { 1041 if (!the_card.null_buffer_start_vaddr) {
1042 pr_info("%s: nullbuffer alloc failed\n", __func__); 1042 pr_info("%s: nullbuffer alloc failed\n", __func__);
1043 ret = -ENOMEM;
1043 goto clean_preallocate; 1044 goto clean_preallocate;
1044 } 1045 }
1045 pr_debug("%s: null vaddr=%p dma=%#llx\n", __func__, 1046 pr_debug("%s: null vaddr=%p dma=%#llx\n", __func__,
diff --git a/sound/soc/blackfin/bf6xx-sport.c b/sound/soc/blackfin/bf6xx-sport.c
index 318c5ba5360f..dfb744381c42 100644
--- a/sound/soc/blackfin/bf6xx-sport.c
+++ b/sound/soc/blackfin/bf6xx-sport.c
@@ -413,7 +413,14 @@ EXPORT_SYMBOL(sport_create);
413 413
414void sport_delete(struct sport_device *sport) 414void sport_delete(struct sport_device *sport)
415{ 415{
416 if (sport->tx_desc)
417 dma_free_coherent(NULL, sport->tx_desc_size,
418 sport->tx_desc, 0);
419 if (sport->rx_desc)
420 dma_free_coherent(NULL, sport->rx_desc_size,
421 sport->rx_desc, 0);
416 sport_free_resource(sport); 422 sport_free_resource(sport);
423 kfree(sport);
417} 424}
418EXPORT_SYMBOL(sport_delete); 425EXPORT_SYMBOL(sport_delete);
419 426
diff --git a/sound/soc/codecs/wm5102.c b/sound/soc/codecs/wm5102.c
index 6537f16d383e..e33d327396ad 100644
--- a/sound/soc/codecs/wm5102.c
+++ b/sound/soc/codecs/wm5102.c
@@ -128,13 +128,9 @@ SOC_SINGLE_TLV("EQ4 B5 Volume", ARIZONA_EQ4_2, ARIZONA_EQ4_B5_GAIN_SHIFT,
128 128
129ARIZONA_MIXER_CONTROLS("DRC1L", ARIZONA_DRC1LMIX_INPUT_1_SOURCE), 129ARIZONA_MIXER_CONTROLS("DRC1L", ARIZONA_DRC1LMIX_INPUT_1_SOURCE),
130ARIZONA_MIXER_CONTROLS("DRC1R", ARIZONA_DRC1RMIX_INPUT_1_SOURCE), 130ARIZONA_MIXER_CONTROLS("DRC1R", ARIZONA_DRC1RMIX_INPUT_1_SOURCE),
131ARIZONA_MIXER_CONTROLS("DRC2L", ARIZONA_DRC2LMIX_INPUT_1_SOURCE),
132ARIZONA_MIXER_CONTROLS("DRC2R", ARIZONA_DRC2RMIX_INPUT_1_SOURCE),
133 131
134SND_SOC_BYTES_MASK("DRC1", ARIZONA_DRC1_CTRL1, 5, 132SND_SOC_BYTES_MASK("DRC1", ARIZONA_DRC1_CTRL1, 5,
135 ARIZONA_DRC1R_ENA | ARIZONA_DRC1L_ENA), 133 ARIZONA_DRC1R_ENA | ARIZONA_DRC1L_ENA),
136SND_SOC_BYTES_MASK("DRC2", ARIZONA_DRC2_CTRL1, 5,
137 ARIZONA_DRC2R_ENA | ARIZONA_DRC2L_ENA),
138 134
139ARIZONA_MIXER_CONTROLS("LHPF1", ARIZONA_HPLP1MIX_INPUT_1_SOURCE), 135ARIZONA_MIXER_CONTROLS("LHPF1", ARIZONA_HPLP1MIX_INPUT_1_SOURCE),
140ARIZONA_MIXER_CONTROLS("LHPF2", ARIZONA_HPLP2MIX_INPUT_1_SOURCE), 136ARIZONA_MIXER_CONTROLS("LHPF2", ARIZONA_HPLP2MIX_INPUT_1_SOURCE),
@@ -236,8 +232,6 @@ ARIZONA_MIXER_ENUMS(EQ4, ARIZONA_EQ4MIX_INPUT_1_SOURCE);
236 232
237ARIZONA_MIXER_ENUMS(DRC1L, ARIZONA_DRC1LMIX_INPUT_1_SOURCE); 233ARIZONA_MIXER_ENUMS(DRC1L, ARIZONA_DRC1LMIX_INPUT_1_SOURCE);
238ARIZONA_MIXER_ENUMS(DRC1R, ARIZONA_DRC1RMIX_INPUT_1_SOURCE); 234ARIZONA_MIXER_ENUMS(DRC1R, ARIZONA_DRC1RMIX_INPUT_1_SOURCE);
239ARIZONA_MIXER_ENUMS(DRC2L, ARIZONA_DRC2LMIX_INPUT_1_SOURCE);
240ARIZONA_MIXER_ENUMS(DRC2R, ARIZONA_DRC2RMIX_INPUT_1_SOURCE);
241 235
242ARIZONA_MIXER_ENUMS(LHPF1, ARIZONA_HPLP1MIX_INPUT_1_SOURCE); 236ARIZONA_MIXER_ENUMS(LHPF1, ARIZONA_HPLP1MIX_INPUT_1_SOURCE);
243ARIZONA_MIXER_ENUMS(LHPF2, ARIZONA_HPLP2MIX_INPUT_1_SOURCE); 237ARIZONA_MIXER_ENUMS(LHPF2, ARIZONA_HPLP2MIX_INPUT_1_SOURCE);
@@ -349,10 +343,6 @@ SND_SOC_DAPM_PGA("DRC1L", ARIZONA_DRC1_CTRL1, ARIZONA_DRC1L_ENA_SHIFT, 0,
349 NULL, 0), 343 NULL, 0),
350SND_SOC_DAPM_PGA("DRC1R", ARIZONA_DRC1_CTRL1, ARIZONA_DRC1R_ENA_SHIFT, 0, 344SND_SOC_DAPM_PGA("DRC1R", ARIZONA_DRC1_CTRL1, ARIZONA_DRC1R_ENA_SHIFT, 0,
351 NULL, 0), 345 NULL, 0),
352SND_SOC_DAPM_PGA("DRC2L", ARIZONA_DRC2_CTRL1, ARIZONA_DRC2L_ENA_SHIFT, 0,
353 NULL, 0),
354SND_SOC_DAPM_PGA("DRC2R", ARIZONA_DRC2_CTRL1, ARIZONA_DRC2R_ENA_SHIFT, 0,
355 NULL, 0),
356 346
357SND_SOC_DAPM_PGA("LHPF1", ARIZONA_HPLPF1_1, ARIZONA_LHPF1_ENA_SHIFT, 0, 347SND_SOC_DAPM_PGA("LHPF1", ARIZONA_HPLPF1_1, ARIZONA_LHPF1_ENA_SHIFT, 0,
358 NULL, 0), 348 NULL, 0),
@@ -466,8 +456,6 @@ ARIZONA_MIXER_WIDGETS(EQ4, "EQ4"),
466 456
467ARIZONA_MIXER_WIDGETS(DRC1L, "DRC1L"), 457ARIZONA_MIXER_WIDGETS(DRC1L, "DRC1L"),
468ARIZONA_MIXER_WIDGETS(DRC1R, "DRC1R"), 458ARIZONA_MIXER_WIDGETS(DRC1R, "DRC1R"),
469ARIZONA_MIXER_WIDGETS(DRC2L, "DRC2L"),
470ARIZONA_MIXER_WIDGETS(DRC2R, "DRC2R"),
471 459
472ARIZONA_MIXER_WIDGETS(LHPF1, "LHPF1"), 460ARIZONA_MIXER_WIDGETS(LHPF1, "LHPF1"),
473ARIZONA_MIXER_WIDGETS(LHPF2, "LHPF2"), 461ARIZONA_MIXER_WIDGETS(LHPF2, "LHPF2"),
@@ -553,8 +541,6 @@ SND_SOC_DAPM_OUTPUT("SPKDAT1R"),
553 { name, "EQ4", "EQ4" }, \ 541 { name, "EQ4", "EQ4" }, \
554 { name, "DRC1L", "DRC1L" }, \ 542 { name, "DRC1L", "DRC1L" }, \
555 { name, "DRC1R", "DRC1R" }, \ 543 { name, "DRC1R", "DRC1R" }, \
556 { name, "DRC2L", "DRC2L" }, \
557 { name, "DRC2R", "DRC2R" }, \
558 { name, "LHPF1", "LHPF1" }, \ 544 { name, "LHPF1", "LHPF1" }, \
559 { name, "LHPF2", "LHPF2" }, \ 545 { name, "LHPF2", "LHPF2" }, \
560 { name, "LHPF3", "LHPF3" }, \ 546 { name, "LHPF3", "LHPF3" }, \
@@ -639,6 +625,15 @@ static const struct snd_soc_dapm_route wm5102_dapm_routes[] = {
639 { "AIF2 Capture", NULL, "SYSCLK" }, 625 { "AIF2 Capture", NULL, "SYSCLK" },
640 { "AIF3 Capture", NULL, "SYSCLK" }, 626 { "AIF3 Capture", NULL, "SYSCLK" },
641 627
628 { "IN1L PGA", NULL, "IN1L" },
629 { "IN1R PGA", NULL, "IN1R" },
630
631 { "IN2L PGA", NULL, "IN2L" },
632 { "IN2R PGA", NULL, "IN2R" },
633
634 { "IN3L PGA", NULL, "IN3L" },
635 { "IN3R PGA", NULL, "IN3R" },
636
642 ARIZONA_MIXER_ROUTES("OUT1L", "HPOUT1L"), 637 ARIZONA_MIXER_ROUTES("OUT1L", "HPOUT1L"),
643 ARIZONA_MIXER_ROUTES("OUT1R", "HPOUT1R"), 638 ARIZONA_MIXER_ROUTES("OUT1R", "HPOUT1R"),
644 ARIZONA_MIXER_ROUTES("OUT2L", "HPOUT2L"), 639 ARIZONA_MIXER_ROUTES("OUT2L", "HPOUT2L"),
@@ -675,8 +670,6 @@ static const struct snd_soc_dapm_route wm5102_dapm_routes[] = {
675 670
676 ARIZONA_MIXER_ROUTES("DRC1L", "DRC1L"), 671 ARIZONA_MIXER_ROUTES("DRC1L", "DRC1L"),
677 ARIZONA_MIXER_ROUTES("DRC1R", "DRC1R"), 672 ARIZONA_MIXER_ROUTES("DRC1R", "DRC1R"),
678 ARIZONA_MIXER_ROUTES("DRC2L", "DRC2L"),
679 ARIZONA_MIXER_ROUTES("DRC2R", "DRC2R"),
680 673
681 ARIZONA_MIXER_ROUTES("LHPF1", "LHPF1"), 674 ARIZONA_MIXER_ROUTES("LHPF1", "LHPF1"),
682 ARIZONA_MIXER_ROUTES("LHPF2", "LHPF2"), 675 ARIZONA_MIXER_ROUTES("LHPF2", "LHPF2"),
diff --git a/sound/soc/codecs/wm5110.c b/sound/soc/codecs/wm5110.c
index 8033f7065189..01ebbcc5c6a4 100644
--- a/sound/soc/codecs/wm5110.c
+++ b/sound/soc/codecs/wm5110.c
@@ -681,6 +681,18 @@ static const struct snd_soc_dapm_route wm5110_dapm_routes[] = {
681 { "AIF2 Capture", NULL, "SYSCLK" }, 681 { "AIF2 Capture", NULL, "SYSCLK" },
682 { "AIF3 Capture", NULL, "SYSCLK" }, 682 { "AIF3 Capture", NULL, "SYSCLK" },
683 683
684 { "IN1L PGA", NULL, "IN1L" },
685 { "IN1R PGA", NULL, "IN1R" },
686
687 { "IN2L PGA", NULL, "IN2L" },
688 { "IN2R PGA", NULL, "IN2R" },
689
690 { "IN3L PGA", NULL, "IN3L" },
691 { "IN3R PGA", NULL, "IN3R" },
692
693 { "IN4L PGA", NULL, "IN4L" },
694 { "IN4R PGA", NULL, "IN4R" },
695
684 ARIZONA_MIXER_ROUTES("OUT1L", "HPOUT1L"), 696 ARIZONA_MIXER_ROUTES("OUT1L", "HPOUT1L"),
685 ARIZONA_MIXER_ROUTES("OUT1R", "HPOUT1R"), 697 ARIZONA_MIXER_ROUTES("OUT1R", "HPOUT1R"),
686 ARIZONA_MIXER_ROUTES("OUT2L", "HPOUT2L"), 698 ARIZONA_MIXER_ROUTES("OUT2L", "HPOUT2L"),
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
index aa9ce9dd7d8a..ce6720073798 100644
--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -3733,21 +3733,6 @@ static int wm8962_runtime_resume(struct device *dev)
3733 3733
3734 regcache_sync(wm8962->regmap); 3734 regcache_sync(wm8962->regmap);
3735 3735
3736 regmap_update_bits(wm8962->regmap, WM8962_ANTI_POP,
3737 WM8962_STARTUP_BIAS_ENA | WM8962_VMID_BUF_ENA,
3738 WM8962_STARTUP_BIAS_ENA | WM8962_VMID_BUF_ENA);
3739
3740 /* Bias enable at 2*50k for ramp */
3741 regmap_update_bits(wm8962->regmap, WM8962_PWR_MGMT_1,
3742 WM8962_VMID_SEL_MASK | WM8962_BIAS_ENA,
3743 WM8962_BIAS_ENA | 0x180);
3744
3745 msleep(5);
3746
3747 /* VMID back to 2x250k for standby */
3748 regmap_update_bits(wm8962->regmap, WM8962_PWR_MGMT_1,
3749 WM8962_VMID_SEL_MASK, 0x100);
3750
3751 return 0; 3736 return 0;
3752} 3737}
3753 3738
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
index 04ef03175c51..6c9eeca85b95 100644
--- a/sound/soc/codecs/wm8994.c
+++ b/sound/soc/codecs/wm8994.c
@@ -4038,6 +4038,8 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec)
4038 break; 4038 break;
4039 case WM8958: 4039 case WM8958:
4040 if (wm8994->revision < 1) { 4040 if (wm8994->revision < 1) {
4041 snd_soc_dapm_add_routes(dapm, wm8994_intercon,
4042 ARRAY_SIZE(wm8994_intercon));
4041 snd_soc_dapm_add_routes(dapm, wm8994_revd_intercon, 4043 snd_soc_dapm_add_routes(dapm, wm8994_revd_intercon,
4042 ARRAY_SIZE(wm8994_revd_intercon)); 4044 ARRAY_SIZE(wm8994_revd_intercon));
4043 snd_soc_dapm_add_routes(dapm, wm8994_lateclk_revd_intercon, 4045 snd_soc_dapm_add_routes(dapm, wm8994_lateclk_revd_intercon,
diff --git a/sound/soc/codecs/wm9712.c b/sound/soc/codecs/wm9712.c
index f16fb361a4eb..c6d2076a796b 100644
--- a/sound/soc/codecs/wm9712.c
+++ b/sound/soc/codecs/wm9712.c
@@ -148,7 +148,7 @@ SOC_SINGLE("Treble Volume", AC97_MASTER_TONE, 0, 15, 1),
148 148
149SOC_SINGLE("Capture ADC Switch", AC97_REC_GAIN, 15, 1, 1), 149SOC_SINGLE("Capture ADC Switch", AC97_REC_GAIN, 15, 1, 1),
150SOC_ENUM("Capture Volume Steps", wm9712_enum[6]), 150SOC_ENUM("Capture Volume Steps", wm9712_enum[6]),
151SOC_DOUBLE("Capture Volume", AC97_REC_GAIN, 8, 0, 63, 1), 151SOC_DOUBLE("Capture Volume", AC97_REC_GAIN, 8, 0, 63, 0),
152SOC_SINGLE("Capture ZC Switch", AC97_REC_GAIN, 7, 1, 0), 152SOC_SINGLE("Capture ZC Switch", AC97_REC_GAIN, 7, 1, 0),
153 153
154SOC_SINGLE_TLV("Mic 1 Volume", AC97_MIC, 8, 31, 1, main_tlv), 154SOC_SINGLE_TLV("Mic 1 Volume", AC97_MIC, 8, 31, 1, main_tlv),
@@ -272,7 +272,7 @@ SOC_DAPM_ENUM("Route", wm9712_enum[9]);
272 272
273/* Mic select */ 273/* Mic select */
274static const struct snd_kcontrol_new wm9712_mic_src_controls = 274static const struct snd_kcontrol_new wm9712_mic_src_controls =
275SOC_DAPM_ENUM("Route", wm9712_enum[7]); 275SOC_DAPM_ENUM("Mic Source Select", wm9712_enum[7]);
276 276
277/* diff select */ 277/* diff select */
278static const struct snd_kcontrol_new wm9712_diff_sel_controls = 278static const struct snd_kcontrol_new wm9712_diff_sel_controls =
@@ -291,7 +291,9 @@ SND_SOC_DAPM_MUX("Left Capture Select", SND_SOC_NOPM, 0, 0,
291 &wm9712_capture_selectl_controls), 291 &wm9712_capture_selectl_controls),
292SND_SOC_DAPM_MUX("Right Capture Select", SND_SOC_NOPM, 0, 0, 292SND_SOC_DAPM_MUX("Right Capture Select", SND_SOC_NOPM, 0, 0,
293 &wm9712_capture_selectr_controls), 293 &wm9712_capture_selectr_controls),
294SND_SOC_DAPM_MUX("Mic Select Source", SND_SOC_NOPM, 0, 0, 294SND_SOC_DAPM_MUX("Left Mic Select Source", SND_SOC_NOPM, 0, 0,
295 &wm9712_mic_src_controls),
296SND_SOC_DAPM_MUX("Right Mic Select Source", SND_SOC_NOPM, 0, 0,
295 &wm9712_mic_src_controls), 297 &wm9712_mic_src_controls),
296SND_SOC_DAPM_MUX("Differential Source", SND_SOC_NOPM, 0, 0, 298SND_SOC_DAPM_MUX("Differential Source", SND_SOC_NOPM, 0, 0,
297 &wm9712_diff_sel_controls), 299 &wm9712_diff_sel_controls),
@@ -319,6 +321,7 @@ SND_SOC_DAPM_PGA("Out 3 PGA", AC97_INT_PAGING, 5, 1, NULL, 0),
319SND_SOC_DAPM_PGA("Line PGA", AC97_INT_PAGING, 2, 1, NULL, 0), 321SND_SOC_DAPM_PGA("Line PGA", AC97_INT_PAGING, 2, 1, NULL, 0),
320SND_SOC_DAPM_PGA("Phone PGA", AC97_INT_PAGING, 1, 1, NULL, 0), 322SND_SOC_DAPM_PGA("Phone PGA", AC97_INT_PAGING, 1, 1, NULL, 0),
321SND_SOC_DAPM_PGA("Mic PGA", AC97_INT_PAGING, 0, 1, NULL, 0), 323SND_SOC_DAPM_PGA("Mic PGA", AC97_INT_PAGING, 0, 1, NULL, 0),
324SND_SOC_DAPM_PGA("Differential Mic", SND_SOC_NOPM, 0, 0, NULL, 0),
322SND_SOC_DAPM_MICBIAS("Mic Bias", AC97_INT_PAGING, 10, 1), 325SND_SOC_DAPM_MICBIAS("Mic Bias", AC97_INT_PAGING, 10, 1),
323SND_SOC_DAPM_OUTPUT("MONOOUT"), 326SND_SOC_DAPM_OUTPUT("MONOOUT"),
324SND_SOC_DAPM_OUTPUT("HPOUTL"), 327SND_SOC_DAPM_OUTPUT("HPOUTL"),
@@ -379,6 +382,18 @@ static const struct snd_soc_dapm_route wm9712_audio_map[] = {
379 {"Mic PGA", NULL, "MIC1"}, 382 {"Mic PGA", NULL, "MIC1"},
380 {"Mic PGA", NULL, "MIC2"}, 383 {"Mic PGA", NULL, "MIC2"},
381 384
385 /* microphones */
386 {"Differential Mic", NULL, "MIC1"},
387 {"Differential Mic", NULL, "MIC2"},
388 {"Left Mic Select Source", "Mic 1", "MIC1"},
389 {"Left Mic Select Source", "Mic 2", "MIC2"},
390 {"Left Mic Select Source", "Stereo", "MIC1"},
391 {"Left Mic Select Source", "Differential", "Differential Mic"},
392 {"Right Mic Select Source", "Mic 1", "MIC1"},
393 {"Right Mic Select Source", "Mic 2", "MIC2"},
394 {"Right Mic Select Source", "Stereo", "MIC2"},
395 {"Right Mic Select Source", "Differential", "Differential Mic"},
396
382 /* left capture selector */ 397 /* left capture selector */
383 {"Left Capture Select", "Mic", "MIC1"}, 398 {"Left Capture Select", "Mic", "MIC1"},
384 {"Left Capture Select", "Speaker Mixer", "Speaker Mixer"}, 399 {"Left Capture Select", "Speaker Mixer", "Speaker Mixer"},
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
index 95441bfc8190..ce5e5cd254dd 100644
--- a/sound/soc/davinci/davinci-mcasp.c
+++ b/sound/soc/davinci/davinci-mcasp.c
@@ -380,14 +380,20 @@ static void mcasp_start_tx(struct davinci_audio_dev *dev)
380static void davinci_mcasp_start(struct davinci_audio_dev *dev, int stream) 380static void davinci_mcasp_start(struct davinci_audio_dev *dev, int stream)
381{ 381{
382 if (stream == SNDRV_PCM_STREAM_PLAYBACK) { 382 if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
383 if (dev->txnumevt) /* enable FIFO */ 383 if (dev->txnumevt) { /* enable FIFO */
384 mcasp_clr_bits(dev->base + DAVINCI_MCASP_WFIFOCTL,
385 FIFO_ENABLE);
384 mcasp_set_bits(dev->base + DAVINCI_MCASP_WFIFOCTL, 386 mcasp_set_bits(dev->base + DAVINCI_MCASP_WFIFOCTL,
385 FIFO_ENABLE); 387 FIFO_ENABLE);
388 }
386 mcasp_start_tx(dev); 389 mcasp_start_tx(dev);
387 } else { 390 } else {
388 if (dev->rxnumevt) /* enable FIFO */ 391 if (dev->rxnumevt) { /* enable FIFO */
392 mcasp_clr_bits(dev->base + DAVINCI_MCASP_RFIFOCTL,
393 FIFO_ENABLE);
389 mcasp_set_bits(dev->base + DAVINCI_MCASP_RFIFOCTL, 394 mcasp_set_bits(dev->base + DAVINCI_MCASP_RFIFOCTL,
390 FIFO_ENABLE); 395 FIFO_ENABLE);
396 }
391 mcasp_start_rx(dev); 397 mcasp_start_rx(dev);
392 } 398 }
393} 399}
diff --git a/sound/soc/fsl/imx-ssi.c b/sound/soc/fsl/imx-ssi.c
index 28dd76c7cb1c..81d7728cf67f 100644
--- a/sound/soc/fsl/imx-ssi.c
+++ b/sound/soc/fsl/imx-ssi.c
@@ -380,13 +380,14 @@ static int imx_ssi_dai_probe(struct snd_soc_dai *dai)
380static struct snd_soc_dai_driver imx_ssi_dai = { 380static struct snd_soc_dai_driver imx_ssi_dai = {
381 .probe = imx_ssi_dai_probe, 381 .probe = imx_ssi_dai_probe,
382 .playback = { 382 .playback = {
383 .channels_min = 1, 383 /* The SSI does not support monaural audio. */
384 .channels_min = 2,
384 .channels_max = 2, 385 .channels_max = 2,
385 .rates = SNDRV_PCM_RATE_8000_96000, 386 .rates = SNDRV_PCM_RATE_8000_96000,
386 .formats = SNDRV_PCM_FMTBIT_S16_LE, 387 .formats = SNDRV_PCM_FMTBIT_S16_LE,
387 }, 388 },
388 .capture = { 389 .capture = {
389 .channels_min = 1, 390 .channels_min = 2,
390 .channels_max = 2, 391 .channels_max = 2,
391 .rates = SNDRV_PCM_RATE_8000_96000, 392 .rates = SNDRV_PCM_RATE_8000_96000,
392 .formats = SNDRV_PCM_FMTBIT_S16_LE, 393 .formats = SNDRV_PCM_FMTBIT_S16_LE,
diff --git a/sound/soc/mxs/Kconfig b/sound/soc/mxs/Kconfig
index 99a997f19bb9..b6fa77678d97 100644
--- a/sound/soc/mxs/Kconfig
+++ b/sound/soc/mxs/Kconfig
@@ -10,7 +10,7 @@ menuconfig SND_MXS_SOC
10if SND_MXS_SOC 10if SND_MXS_SOC
11 11
12config SND_SOC_MXS_SGTL5000 12config SND_SOC_MXS_SGTL5000
13 tristate "SoC Audio support for i.MX boards with sgtl5000" 13 tristate "SoC Audio support for MXS boards with sgtl5000"
14 depends on I2C 14 depends on I2C
15 select SND_SOC_SGTL5000 15 select SND_SOC_SGTL5000
16 help 16 help
diff --git a/sound/soc/omap/mcbsp.c b/sound/soc/omap/mcbsp.c
index 34835e8a9160..d33c48baaf71 100644
--- a/sound/soc/omap/mcbsp.c
+++ b/sound/soc/omap/mcbsp.c
@@ -745,7 +745,7 @@ int omap_mcbsp_6pin_src_mux(struct omap_mcbsp *mcbsp, u8 mux)
745{ 745{
746 const char *signal, *src; 746 const char *signal, *src;
747 747
748 if (mcbsp->pdata->mux_signal) 748 if (!mcbsp->pdata->mux_signal)
749 return -EINVAL; 749 return -EINVAL;
750 750
751 switch (mux) { 751 switch (mux) {
diff --git a/sound/soc/samsung/pcm.c b/sound/soc/samsung/pcm.c
index b7b2a1f91425..89b064650f14 100644
--- a/sound/soc/samsung/pcm.c
+++ b/sound/soc/samsung/pcm.c
@@ -20,7 +20,7 @@
20#include <sound/pcm_params.h> 20#include <sound/pcm_params.h>
21 21
22#include <plat/audio.h> 22#include <plat/audio.h>
23#include <plat/dma.h> 23#include <mach/dma.h>
24 24
25#include "dma.h" 25#include "dma.h"
26#include "pcm.h" 26#include "pcm.h"
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index f81c5976b961..c501af6d8dbe 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -826,7 +826,7 @@ static int soc_bind_dai_link(struct snd_soc_card *card, int num)
826 } 826 }
827 827
828 if (!rtd->cpu_dai) { 828 if (!rtd->cpu_dai) {
829 dev_dbg(card->dev, "CPU DAI %s not registered\n", 829 dev_err(card->dev, "CPU DAI %s not registered\n",
830 dai_link->cpu_dai_name); 830 dai_link->cpu_dai_name);
831 return -EPROBE_DEFER; 831 return -EPROBE_DEFER;
832 } 832 }
@@ -857,14 +857,14 @@ static int soc_bind_dai_link(struct snd_soc_card *card, int num)
857 } 857 }
858 858
859 if (!rtd->codec_dai) { 859 if (!rtd->codec_dai) {
860 dev_dbg(card->dev, "CODEC DAI %s not registered\n", 860 dev_err(card->dev, "CODEC DAI %s not registered\n",
861 dai_link->codec_dai_name); 861 dai_link->codec_dai_name);
862 return -EPROBE_DEFER; 862 return -EPROBE_DEFER;
863 } 863 }
864 } 864 }
865 865
866 if (!rtd->codec) { 866 if (!rtd->codec) {
867 dev_dbg(card->dev, "CODEC %s not registered\n", 867 dev_err(card->dev, "CODEC %s not registered\n",
868 dai_link->codec_name); 868 dai_link->codec_name);
869 return -EPROBE_DEFER; 869 return -EPROBE_DEFER;
870 } 870 }
@@ -888,7 +888,7 @@ static int soc_bind_dai_link(struct snd_soc_card *card, int num)
888 rtd->platform = platform; 888 rtd->platform = platform;
889 } 889 }
890 if (!rtd->platform) { 890 if (!rtd->platform) {
891 dev_dbg(card->dev, "platform %s not registered\n", 891 dev_err(card->dev, "platform %s not registered\n",
892 dai_link->platform_name); 892 dai_link->platform_name);
893 return -EPROBE_DEFER; 893 return -EPROBE_DEFER;
894 } 894 }
@@ -1481,6 +1481,8 @@ static int soc_check_aux_dev(struct snd_soc_card *card, int num)
1481 return 0; 1481 return 0;
1482 } 1482 }
1483 1483
1484 dev_err(card->dev, "%s not registered\n", aux_dev->codec_name);
1485
1484 return -EPROBE_DEFER; 1486 return -EPROBE_DEFER;
1485} 1487}
1486 1488
diff --git a/sound/soc/soc-jack.c b/sound/soc/soc-jack.c
index 7f8b3b7428bb..0c172938b82a 100644
--- a/sound/soc/soc-jack.c
+++ b/sound/soc/soc-jack.c
@@ -103,7 +103,7 @@ void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask)
103 } 103 }
104 104
105 /* Report before the DAPM sync to help users updating micbias status */ 105 /* Report before the DAPM sync to help users updating micbias status */
106 blocking_notifier_call_chain(&jack->notifier, status, jack); 106 blocking_notifier_call_chain(&jack->notifier, jack->status, jack);
107 107
108 snd_soc_dapm_sync(dapm); 108 snd_soc_dapm_sync(dapm);
109 109
diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c
index 0f647d22cb4a..c41181202688 100644
--- a/sound/usb/endpoint.c
+++ b/sound/usb/endpoint.c
@@ -821,10 +821,6 @@ int snd_usb_endpoint_start(struct snd_usb_endpoint *ep)
821 if (++ep->use_count != 1) 821 if (++ep->use_count != 1)
822 return 0; 822 return 0;
823 823
824 /* just to be sure */
825 deactivate_urbs(ep, 0, 1);
826 wait_clear_urbs(ep);
827
828 ep->active_mask = 0; 824 ep->active_mask = 0;
829 ep->unlink_mask = 0; 825 ep->unlink_mask = 0;
830 ep->phase = 0; 826 ep->phase = 0;
diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c
index a1298f379428..62ec808ed792 100644
--- a/sound/usb/pcm.c
+++ b/sound/usb/pcm.c
@@ -544,6 +544,9 @@ static int snd_usb_pcm_prepare(struct snd_pcm_substream *substream)
544 subs->last_frame_number = 0; 544 subs->last_frame_number = 0;
545 runtime->delay = 0; 545 runtime->delay = 0;
546 546
547 /* clear the pending deactivation on the target EPs */
548 deactivate_endpoints(subs);
549
547 /* for playback, submit the URBs now; otherwise, the first hwptr_done 550 /* for playback, submit the URBs now; otherwise, the first hwptr_done
548 * updates for all URBs would happen at the same time when starting */ 551 * updates for all URBs would happen at the same time when starting */
549 if (subs->direction == SNDRV_PCM_STREAM_PLAYBACK) 552 if (subs->direction == SNDRV_PCM_STREAM_PLAYBACK)