aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2010-04-22 20:08:44 -0400
committerJiri Kosina <jkosina@suse.cz>2010-04-22 20:08:44 -0400
commit6c9468e9eb1252eaefd94ce7f06e1be9b0b641b1 (patch)
tree797676a336b050bfa1ef879377c07e541b9075d6 /sound/pci
parent4cb3ca7cd7e2cae8d1daf5345ec99a1e8502cf3f (diff)
parentc81eddb0e3728661d1585fbc564449c94165cc36 (diff)
Merge branch 'master' into for-next
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/ac97/ac97_patch.c2
-rw-r--r--sound/pci/ac97/ac97_proc.c1
-rw-r--r--sound/pci/als4000.c1
-rw-r--r--sound/pci/aw2/aw2-saa7146.c1
-rw-r--r--sound/pci/ca0106/ca0106_mixer.c1
-rw-r--r--sound/pci/ca0106/ca0106_proc.c1
-rw-r--r--sound/pci/cmipci.c14
-rw-r--r--sound/pci/cs5530.c1
-rw-r--r--sound/pci/cs5535audio/cs5535audio_pcm.c1
-rw-r--r--sound/pci/cs5535audio/cs5535audio_pm.c1
-rw-r--r--sound/pci/ctxfi/ctatc.c1
-rw-r--r--sound/pci/ctxfi/ctpcm.c1
-rw-r--r--sound/pci/echoaudio/darla20.c2
-rw-r--r--sound/pci/echoaudio/darla24.c2
-rw-r--r--sound/pci/echoaudio/echo3g.c2
-rw-r--r--sound/pci/echoaudio/echoaudio.c5
-rw-r--r--sound/pci/echoaudio/gina20.c2
-rw-r--r--sound/pci/echoaudio/gina24.c2
-rw-r--r--sound/pci/echoaudio/indigo.c2
-rw-r--r--sound/pci/echoaudio/indigodj.c2
-rw-r--r--sound/pci/echoaudio/indigodjx.c2
-rw-r--r--sound/pci/echoaudio/indigoio.c2
-rw-r--r--sound/pci/echoaudio/indigoiox.c2
-rw-r--r--sound/pci/echoaudio/layla20.c2
-rw-r--r--sound/pci/echoaudio/layla24.c2
-rw-r--r--sound/pci/echoaudio/mia.c2
-rw-r--r--sound/pci/echoaudio/mona.c2
-rw-r--r--sound/pci/emu10k1/memory.c1
-rw-r--r--sound/pci/hda/hda_beep.c1
-rw-r--r--sound/pci/hda/hda_codec.c4
-rw-r--r--sound/pci/hda/hda_eld.c1
-rw-r--r--sound/pci/hda/hda_intel.c13
-rw-r--r--sound/pci/hda/patch_analog.c8
-rw-r--r--sound/pci/hda/patch_conexant.c15
-rw-r--r--sound/pci/hda/patch_nvhdmi.c15
-rw-r--r--sound/pci/hda/patch_realtek.c348
-rw-r--r--sound/pci/hda/patch_sigmatel.c2
-rw-r--r--sound/pci/hda/patch_via.c41
-rw-r--r--sound/pci/ice1712/ak4xxx.c1
-rw-r--r--sound/pci/ice1712/amp.c1
-rw-r--r--sound/pci/ice1712/vt1720_mobo.c1
-rw-r--r--sound/pci/ice1712/wtm.c1
-rw-r--r--sound/pci/lx6464es/lx6464es.c1
-rw-r--r--sound/pci/mixart/mixart.c25
-rw-r--r--sound/pci/mixart/mixart_hwdep.c1
-rw-r--r--sound/pci/oxygen/oxygen_lib.c1
-rw-r--r--sound/pci/rme32.c2
-rw-r--r--sound/pci/rme96.c1
-rw-r--r--sound/pci/rme9652/hdsp.c1
-rw-r--r--sound/pci/rme9652/rme9652.c1
-rw-r--r--sound/pci/sis7019.c1
51 files changed, 414 insertions, 132 deletions
diff --git a/sound/pci/ac97/ac97_patch.c b/sound/pci/ac97/ac97_patch.c
index 1caf5e3c1f6..e68c98ef404 100644
--- a/sound/pci/ac97/ac97_patch.c
+++ b/sound/pci/ac97/ac97_patch.c
@@ -1852,12 +1852,14 @@ static unsigned int ad1981_jacks_blacklist[] = {
1852 0x10140523, /* Thinkpad R40 */ 1852 0x10140523, /* Thinkpad R40 */
1853 0x10140534, /* Thinkpad X31 */ 1853 0x10140534, /* Thinkpad X31 */
1854 0x10140537, /* Thinkpad T41p */ 1854 0x10140537, /* Thinkpad T41p */
1855 0x1014053e, /* Thinkpad R40e */
1855 0x10140554, /* Thinkpad T42p/R50p */ 1856 0x10140554, /* Thinkpad T42p/R50p */
1856 0x10140567, /* Thinkpad T43p 2668-G7U */ 1857 0x10140567, /* Thinkpad T43p 2668-G7U */
1857 0x10140581, /* Thinkpad X41-2527 */ 1858 0x10140581, /* Thinkpad X41-2527 */
1858 0x10280160, /* Dell Dimension 2400 */ 1859 0x10280160, /* Dell Dimension 2400 */
1859 0x104380b0, /* Asus A7V8X-MX */ 1860 0x104380b0, /* Asus A7V8X-MX */
1860 0x11790241, /* Toshiba Satellite A-15 S127 */ 1861 0x11790241, /* Toshiba Satellite A-15 S127 */
1862 0x1179ff10, /* Toshiba P500 */
1861 0x144dc01a, /* Samsung NP-X20C004/SEG */ 1863 0x144dc01a, /* Samsung NP-X20C004/SEG */
1862 0 /* end */ 1864 0 /* end */
1863}; 1865};
diff --git a/sound/pci/ac97/ac97_proc.c b/sound/pci/ac97/ac97_proc.c
index 73b17d526c8..6320bf084e4 100644
--- a/sound/pci/ac97/ac97_proc.c
+++ b/sound/pci/ac97/ac97_proc.c
@@ -22,7 +22,6 @@
22 * 22 *
23 */ 23 */
24 24
25#include <linux/slab.h>
26#include <linux/mutex.h> 25#include <linux/mutex.h>
27 26
28#include <sound/core.h> 27#include <sound/core.h>
diff --git a/sound/pci/als4000.c b/sound/pci/als4000.c
index d75cf7b0642..6cf1de8042e 100644
--- a/sound/pci/als4000.c
+++ b/sound/pci/als4000.c
@@ -68,7 +68,6 @@
68#include <asm/io.h> 68#include <asm/io.h>
69#include <linux/init.h> 69#include <linux/init.h>
70#include <linux/pci.h> 70#include <linux/pci.h>
71#include <linux/slab.h>
72#include <linux/gameport.h> 71#include <linux/gameport.h>
73#include <linux/moduleparam.h> 72#include <linux/moduleparam.h>
74#include <linux/dma-mapping.h> 73#include <linux/dma-mapping.h>
diff --git a/sound/pci/aw2/aw2-saa7146.c b/sound/pci/aw2/aw2-saa7146.c
index 296123ab74f..8afd8b5d1ac 100644
--- a/sound/pci/aw2/aw2-saa7146.c
+++ b/sound/pci/aw2/aw2-saa7146.c
@@ -25,7 +25,6 @@
25 25
26#include <linux/init.h> 26#include <linux/init.h>
27#include <linux/pci.h> 27#include <linux/pci.h>
28#include <linux/slab.h>
29#include <linux/interrupt.h> 28#include <linux/interrupt.h>
30#include <linux/delay.h> 29#include <linux/delay.h>
31#include <asm/system.h> 30#include <asm/system.h>
diff --git a/sound/pci/ca0106/ca0106_mixer.c b/sound/pci/ca0106/ca0106_mixer.c
index 8f443a9d61e..85fd315d999 100644
--- a/sound/pci/ca0106/ca0106_mixer.c
+++ b/sound/pci/ca0106/ca0106_mixer.c
@@ -63,7 +63,6 @@
63#include <linux/delay.h> 63#include <linux/delay.h>
64#include <linux/init.h> 64#include <linux/init.h>
65#include <linux/interrupt.h> 65#include <linux/interrupt.h>
66#include <linux/slab.h>
67#include <linux/moduleparam.h> 66#include <linux/moduleparam.h>
68#include <sound/core.h> 67#include <sound/core.h>
69#include <sound/initval.h> 68#include <sound/initval.h>
diff --git a/sound/pci/ca0106/ca0106_proc.c b/sound/pci/ca0106/ca0106_proc.c
index 0470461cc03..ba96428c9f4 100644
--- a/sound/pci/ca0106/ca0106_proc.c
+++ b/sound/pci/ca0106/ca0106_proc.c
@@ -63,7 +63,6 @@
63#include <linux/delay.h> 63#include <linux/delay.h>
64#include <linux/init.h> 64#include <linux/init.h>
65#include <linux/interrupt.h> 65#include <linux/interrupt.h>
66#include <linux/slab.h>
67#include <linux/moduleparam.h> 66#include <linux/moduleparam.h>
68#include <sound/core.h> 67#include <sound/core.h>
69#include <sound/initval.h> 68#include <sound/initval.h>
diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c
index 1ded64e0564..329968edca9 100644
--- a/sound/pci/cmipci.c
+++ b/sound/pci/cmipci.c
@@ -941,13 +941,21 @@ static snd_pcm_uframes_t snd_cmipci_pcm_pointer(struct cmipci *cm, struct cmipci
941 struct snd_pcm_substream *substream) 941 struct snd_pcm_substream *substream)
942{ 942{
943 size_t ptr; 943 size_t ptr;
944 unsigned int reg; 944 unsigned int reg, rem, tries;
945
945 if (!rec->running) 946 if (!rec->running)
946 return 0; 947 return 0;
947#if 1 // this seems better.. 948#if 1 // this seems better..
948 reg = rec->ch ? CM_REG_CH1_FRAME2 : CM_REG_CH0_FRAME2; 949 reg = rec->ch ? CM_REG_CH1_FRAME2 : CM_REG_CH0_FRAME2;
949 ptr = rec->dma_size - (snd_cmipci_read_w(cm, reg) + 1); 950 for (tries = 0; tries < 3; tries++) {
950 ptr >>= rec->shift; 951 rem = snd_cmipci_read_w(cm, reg);
952 if (rem < rec->dma_size)
953 goto ok;
954 }
955 printk(KERN_ERR "cmipci: invalid PCM pointer: %#x\n", rem);
956 return SNDRV_PCM_POS_XRUN;
957ok:
958 ptr = (rec->dma_size - (rem + 1)) >> rec->shift;
951#else 959#else
952 reg = rec->ch ? CM_REG_CH1_FRAME1 : CM_REG_CH0_FRAME1; 960 reg = rec->ch ? CM_REG_CH1_FRAME1 : CM_REG_CH0_FRAME1;
953 ptr = snd_cmipci_read(cm, reg) - rec->offset; 961 ptr = snd_cmipci_read(cm, reg) - rec->offset;
diff --git a/sound/pci/cs5530.c b/sound/pci/cs5530.c
index 207479a641c..bc07e275d4d 100644
--- a/sound/pci/cs5530.c
+++ b/sound/pci/cs5530.c
@@ -39,6 +39,7 @@
39#include <linux/delay.h> 39#include <linux/delay.h>
40#include <linux/moduleparam.h> 40#include <linux/moduleparam.h>
41#include <linux/pci.h> 41#include <linux/pci.h>
42#include <linux/slab.h>
42#include <sound/core.h> 43#include <sound/core.h>
43#include <sound/sb.h> 44#include <sound/sb.h>
44#include <sound/initval.h> 45#include <sound/initval.h>
diff --git a/sound/pci/cs5535audio/cs5535audio_pcm.c b/sound/pci/cs5535audio/cs5535audio_pcm.c
index 0f48a871f17..f16bc8aad6e 100644
--- a/sound/pci/cs5535audio/cs5535audio_pcm.c
+++ b/sound/pci/cs5535audio/cs5535audio_pcm.c
@@ -23,7 +23,6 @@
23 */ 23 */
24 24
25#include <linux/init.h> 25#include <linux/init.h>
26#include <linux/slab.h>
27#include <linux/pci.h> 26#include <linux/pci.h>
28#include <sound/core.h> 27#include <sound/core.h>
29#include <sound/control.h> 28#include <sound/control.h>
diff --git a/sound/pci/cs5535audio/cs5535audio_pm.c b/sound/pci/cs5535audio/cs5535audio_pm.c
index 564c33b6095..a3301cc4ab8 100644
--- a/sound/pci/cs5535audio/cs5535audio_pm.c
+++ b/sound/pci/cs5535audio/cs5535audio_pm.c
@@ -19,7 +19,6 @@
19 */ 19 */
20 20
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/slab.h>
23#include <linux/pci.h> 22#include <linux/pci.h>
24#include <linux/delay.h> 23#include <linux/delay.h>
25#include <sound/core.h> 24#include <sound/core.h>
diff --git a/sound/pci/ctxfi/ctatc.c b/sound/pci/ctxfi/ctatc.c
index 480cb1e905b..1bff80cde0a 100644
--- a/sound/pci/ctxfi/ctatc.c
+++ b/sound/pci/ctxfi/ctatc.c
@@ -24,6 +24,7 @@
24#include "ctdaio.h" 24#include "ctdaio.h"
25#include "cttimer.h" 25#include "cttimer.h"
26#include <linux/delay.h> 26#include <linux/delay.h>
27#include <linux/slab.h>
27#include <sound/pcm.h> 28#include <sound/pcm.h>
28#include <sound/control.h> 29#include <sound/control.h>
29#include <sound/asoundef.h> 30#include <sound/asoundef.h>
diff --git a/sound/pci/ctxfi/ctpcm.c b/sound/pci/ctxfi/ctpcm.c
index d0dc227fbdd..85ab43e8921 100644
--- a/sound/pci/ctxfi/ctpcm.c
+++ b/sound/pci/ctxfi/ctpcm.c
@@ -17,6 +17,7 @@
17 17
18#include "ctpcm.h" 18#include "ctpcm.h"
19#include "cttimer.h" 19#include "cttimer.h"
20#include <linux/slab.h>
20#include <sound/pcm.h> 21#include <sound/pcm.h>
21 22
22/* Hardware descriptions for playback */ 23/* Hardware descriptions for playback */
diff --git a/sound/pci/echoaudio/darla20.c b/sound/pci/echoaudio/darla20.c
index a65bafe0800..fe7ad64dccd 100644
--- a/sound/pci/echoaudio/darla20.c
+++ b/sound/pci/echoaudio/darla20.c
@@ -40,9 +40,9 @@
40#include <linux/init.h> 40#include <linux/init.h>
41#include <linux/interrupt.h> 41#include <linux/interrupt.h>
42#include <linux/pci.h> 42#include <linux/pci.h>
43#include <linux/slab.h>
44#include <linux/moduleparam.h> 43#include <linux/moduleparam.h>
45#include <linux/firmware.h> 44#include <linux/firmware.h>
45#include <linux/slab.h>
46#include <sound/core.h> 46#include <sound/core.h>
47#include <sound/info.h> 47#include <sound/info.h>
48#include <sound/control.h> 48#include <sound/control.h>
diff --git a/sound/pci/echoaudio/darla24.c b/sound/pci/echoaudio/darla24.c
index 0a6c50bcd75..d1fd34b1a8e 100644
--- a/sound/pci/echoaudio/darla24.c
+++ b/sound/pci/echoaudio/darla24.c
@@ -44,9 +44,9 @@
44#include <linux/init.h> 44#include <linux/init.h>
45#include <linux/interrupt.h> 45#include <linux/interrupt.h>
46#include <linux/pci.h> 46#include <linux/pci.h>
47#include <linux/slab.h>
48#include <linux/moduleparam.h> 47#include <linux/moduleparam.h>
49#include <linux/firmware.h> 48#include <linux/firmware.h>
49#include <linux/slab.h>
50#include <sound/core.h> 50#include <sound/core.h>
51#include <sound/info.h> 51#include <sound/info.h>
52#include <sound/control.h> 52#include <sound/control.h>
diff --git a/sound/pci/echoaudio/echo3g.c b/sound/pci/echoaudio/echo3g.c
index f5142796989..1dffdc54416 100644
--- a/sound/pci/echoaudio/echo3g.c
+++ b/sound/pci/echoaudio/echo3g.c
@@ -51,9 +51,9 @@
51#include <linux/init.h> 51#include <linux/init.h>
52#include <linux/interrupt.h> 52#include <linux/interrupt.h>
53#include <linux/pci.h> 53#include <linux/pci.h>
54#include <linux/slab.h>
55#include <linux/moduleparam.h> 54#include <linux/moduleparam.h>
56#include <linux/firmware.h> 55#include <linux/firmware.h>
56#include <linux/slab.h>
57#include <sound/core.h> 57#include <sound/core.h>
58#include <sound/info.h> 58#include <sound/info.h>
59#include <sound/control.h> 59#include <sound/control.h>
diff --git a/sound/pci/echoaudio/echoaudio.c b/sound/pci/echoaudio/echoaudio.c
index 8dab82d7d19..668a5ec0449 100644
--- a/sound/pci/echoaudio/echoaudio.c
+++ b/sound/pci/echoaudio/echoaudio.c
@@ -2184,10 +2184,9 @@ static int __devinit snd_echo_probe(struct pci_dev *pci,
2184 goto ctl_error; 2184 goto ctl_error;
2185#endif 2185#endif
2186 2186
2187 if ((err = snd_card_register(card)) < 0) { 2187 err = snd_card_register(card);
2188 snd_card_free(card); 2188 if (err < 0)
2189 goto ctl_error; 2189 goto ctl_error;
2190 }
2191 snd_printk(KERN_INFO "Card registered: %s\n", card->longname); 2190 snd_printk(KERN_INFO "Card registered: %s\n", card->longname);
2192 2191
2193 pci_set_drvdata(pci, chip); 2192 pci_set_drvdata(pci, chip);
diff --git a/sound/pci/echoaudio/gina20.c b/sound/pci/echoaudio/gina20.c
index 2364f8a1bc2..050e54aa693 100644
--- a/sound/pci/echoaudio/gina20.c
+++ b/sound/pci/echoaudio/gina20.c
@@ -44,9 +44,9 @@
44#include <linux/init.h> 44#include <linux/init.h>
45#include <linux/interrupt.h> 45#include <linux/interrupt.h>
46#include <linux/pci.h> 46#include <linux/pci.h>
47#include <linux/slab.h>
48#include <linux/moduleparam.h> 47#include <linux/moduleparam.h>
49#include <linux/firmware.h> 48#include <linux/firmware.h>
49#include <linux/slab.h>
50#include <sound/core.h> 50#include <sound/core.h>
51#include <sound/info.h> 51#include <sound/info.h>
52#include <sound/control.h> 52#include <sound/control.h>
diff --git a/sound/pci/echoaudio/gina24.c b/sound/pci/echoaudio/gina24.c
index 616b55825a1..5748fc6d29d 100644
--- a/sound/pci/echoaudio/gina24.c
+++ b/sound/pci/echoaudio/gina24.c
@@ -50,9 +50,9 @@
50#include <linux/init.h> 50#include <linux/init.h>
51#include <linux/interrupt.h> 51#include <linux/interrupt.h>
52#include <linux/pci.h> 52#include <linux/pci.h>
53#include <linux/slab.h>
54#include <linux/moduleparam.h> 53#include <linux/moduleparam.h>
55#include <linux/firmware.h> 54#include <linux/firmware.h>
55#include <linux/slab.h>
56#include <sound/core.h> 56#include <sound/core.h>
57#include <sound/info.h> 57#include <sound/info.h>
58#include <sound/control.h> 58#include <sound/control.h>
diff --git a/sound/pci/echoaudio/indigo.c b/sound/pci/echoaudio/indigo.c
index 776175c0bda..4ae5e35cb5f 100644
--- a/sound/pci/echoaudio/indigo.c
+++ b/sound/pci/echoaudio/indigo.c
@@ -42,9 +42,9 @@
42#include <linux/init.h> 42#include <linux/init.h>
43#include <linux/interrupt.h> 43#include <linux/interrupt.h>
44#include <linux/pci.h> 44#include <linux/pci.h>
45#include <linux/slab.h>
46#include <linux/moduleparam.h> 45#include <linux/moduleparam.h>
47#include <linux/firmware.h> 46#include <linux/firmware.h>
47#include <linux/slab.h>
48#include <sound/core.h> 48#include <sound/core.h>
49#include <sound/info.h> 49#include <sound/info.h>
50#include <sound/control.h> 50#include <sound/control.h>
diff --git a/sound/pci/echoaudio/indigodj.c b/sound/pci/echoaudio/indigodj.c
index 8816b0bd2ba..3550715bab1 100644
--- a/sound/pci/echoaudio/indigodj.c
+++ b/sound/pci/echoaudio/indigodj.c
@@ -42,9 +42,9 @@
42#include <linux/init.h> 42#include <linux/init.h>
43#include <linux/interrupt.h> 43#include <linux/interrupt.h>
44#include <linux/pci.h> 44#include <linux/pci.h>
45#include <linux/slab.h>
46#include <linux/moduleparam.h> 45#include <linux/moduleparam.h>
47#include <linux/firmware.h> 46#include <linux/firmware.h>
47#include <linux/slab.h>
48#include <sound/core.h> 48#include <sound/core.h>
49#include <sound/info.h> 49#include <sound/info.h>
50#include <sound/control.h> 50#include <sound/control.h>
diff --git a/sound/pci/echoaudio/indigodjx.c b/sound/pci/echoaudio/indigodjx.c
index b1e3652f2f4..19b191fd012 100644
--- a/sound/pci/echoaudio/indigodjx.c
+++ b/sound/pci/echoaudio/indigodjx.c
@@ -42,10 +42,10 @@
42#include <linux/init.h> 42#include <linux/init.h>
43#include <linux/interrupt.h> 43#include <linux/interrupt.h>
44#include <linux/pci.h> 44#include <linux/pci.h>
45#include <linux/slab.h>
46#include <linux/moduleparam.h> 45#include <linux/moduleparam.h>
47#include <linux/firmware.h> 46#include <linux/firmware.h>
48#include <linux/io.h> 47#include <linux/io.h>
48#include <linux/slab.h>
49#include <sound/core.h> 49#include <sound/core.h>
50#include <sound/info.h> 50#include <sound/info.h>
51#include <sound/control.h> 51#include <sound/control.h>
diff --git a/sound/pci/echoaudio/indigoio.c b/sound/pci/echoaudio/indigoio.c
index 1035125336d..a9fcedf317a 100644
--- a/sound/pci/echoaudio/indigoio.c
+++ b/sound/pci/echoaudio/indigoio.c
@@ -43,9 +43,9 @@
43#include <linux/init.h> 43#include <linux/init.h>
44#include <linux/interrupt.h> 44#include <linux/interrupt.h>
45#include <linux/pci.h> 45#include <linux/pci.h>
46#include <linux/slab.h>
47#include <linux/moduleparam.h> 46#include <linux/moduleparam.h>
48#include <linux/firmware.h> 47#include <linux/firmware.h>
48#include <linux/slab.h>
49#include <sound/core.h> 49#include <sound/core.h>
50#include <sound/info.h> 50#include <sound/info.h>
51#include <sound/control.h> 51#include <sound/control.h>
diff --git a/sound/pci/echoaudio/indigoiox.c b/sound/pci/echoaudio/indigoiox.c
index 60b7cb2753c..bcdfac63212 100644
--- a/sound/pci/echoaudio/indigoiox.c
+++ b/sound/pci/echoaudio/indigoiox.c
@@ -43,10 +43,10 @@
43#include <linux/init.h> 43#include <linux/init.h>
44#include <linux/interrupt.h> 44#include <linux/interrupt.h>
45#include <linux/pci.h> 45#include <linux/pci.h>
46#include <linux/slab.h>
47#include <linux/moduleparam.h> 46#include <linux/moduleparam.h>
48#include <linux/firmware.h> 47#include <linux/firmware.h>
49#include <linux/io.h> 48#include <linux/io.h>
49#include <linux/slab.h>
50#include <sound/core.h> 50#include <sound/core.h>
51#include <sound/info.h> 51#include <sound/info.h>
52#include <sound/control.h> 52#include <sound/control.h>
diff --git a/sound/pci/echoaudio/layla20.c b/sound/pci/echoaudio/layla20.c
index 8c3f5c5b530..d3a98c5dac8 100644
--- a/sound/pci/echoaudio/layla20.c
+++ b/sound/pci/echoaudio/layla20.c
@@ -49,9 +49,9 @@
49#include <linux/init.h> 49#include <linux/init.h>
50#include <linux/interrupt.h> 50#include <linux/interrupt.h>
51#include <linux/pci.h> 51#include <linux/pci.h>
52#include <linux/slab.h>
53#include <linux/moduleparam.h> 52#include <linux/moduleparam.h>
54#include <linux/firmware.h> 53#include <linux/firmware.h>
54#include <linux/slab.h>
55#include <sound/core.h> 55#include <sound/core.h>
56#include <sound/info.h> 56#include <sound/info.h>
57#include <sound/control.h> 57#include <sound/control.h>
diff --git a/sound/pci/echoaudio/layla24.c b/sound/pci/echoaudio/layla24.c
index ed1cc0abc2b..2a1dca6dce1 100644
--- a/sound/pci/echoaudio/layla24.c
+++ b/sound/pci/echoaudio/layla24.c
@@ -51,9 +51,9 @@
51#include <linux/init.h> 51#include <linux/init.h>
52#include <linux/interrupt.h> 52#include <linux/interrupt.h>
53#include <linux/pci.h> 53#include <linux/pci.h>
54#include <linux/slab.h>
55#include <linux/moduleparam.h> 54#include <linux/moduleparam.h>
56#include <linux/firmware.h> 55#include <linux/firmware.h>
56#include <linux/slab.h>
57#include <sound/core.h> 57#include <sound/core.h>
58#include <sound/info.h> 58#include <sound/info.h>
59#include <sound/control.h> 59#include <sound/control.h>
diff --git a/sound/pci/echoaudio/mia.c b/sound/pci/echoaudio/mia.c
index cc2bbfc6532..9cdf14cfdd7 100644
--- a/sound/pci/echoaudio/mia.c
+++ b/sound/pci/echoaudio/mia.c
@@ -50,9 +50,9 @@
50#include <linux/init.h> 50#include <linux/init.h>
51#include <linux/interrupt.h> 51#include <linux/interrupt.h>
52#include <linux/pci.h> 52#include <linux/pci.h>
53#include <linux/slab.h>
54#include <linux/moduleparam.h> 53#include <linux/moduleparam.h>
55#include <linux/firmware.h> 54#include <linux/firmware.h>
55#include <linux/slab.h>
56#include <sound/core.h> 56#include <sound/core.h>
57#include <sound/info.h> 57#include <sound/info.h>
58#include <sound/control.h> 58#include <sound/control.h>
diff --git a/sound/pci/echoaudio/mona.c b/sound/pci/echoaudio/mona.c
index 3e7e01824b4..1047be405eb 100644
--- a/sound/pci/echoaudio/mona.c
+++ b/sound/pci/echoaudio/mona.c
@@ -48,9 +48,9 @@
48#include <linux/init.h> 48#include <linux/init.h>
49#include <linux/interrupt.h> 49#include <linux/interrupt.h>
50#include <linux/pci.h> 50#include <linux/pci.h>
51#include <linux/slab.h>
52#include <linux/moduleparam.h> 51#include <linux/moduleparam.h>
53#include <linux/firmware.h> 52#include <linux/firmware.h>
53#include <linux/slab.h>
54#include <sound/core.h> 54#include <sound/core.h>
55#include <sound/info.h> 55#include <sound/info.h>
56#include <sound/control.h> 56#include <sound/control.h>
diff --git a/sound/pci/emu10k1/memory.c b/sound/pci/emu10k1/memory.c
index 6a47672f930..ffb1ddb8dc2 100644
--- a/sound/pci/emu10k1/memory.c
+++ b/sound/pci/emu10k1/memory.c
@@ -22,6 +22,7 @@
22 */ 22 */
23 23
24#include <linux/pci.h> 24#include <linux/pci.h>
25#include <linux/gfp.h>
25#include <linux/time.h> 26#include <linux/time.h>
26#include <linux/mutex.h> 27#include <linux/mutex.h>
27 28
diff --git a/sound/pci/hda/hda_beep.c b/sound/pci/hda/hda_beep.c
index e4581a42ace..29714c818b5 100644
--- a/sound/pci/hda/hda_beep.c
+++ b/sound/pci/hda/hda_beep.c
@@ -21,6 +21,7 @@
21 21
22#include <linux/input.h> 22#include <linux/input.h>
23#include <linux/pci.h> 23#include <linux/pci.h>
24#include <linux/slab.h>
24#include <linux/workqueue.h> 25#include <linux/workqueue.h>
25#include <sound/core.h> 26#include <sound/core.h>
26#include "hda_beep.h" 27#include "hda_beep.h"
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 5bd7cf45f3a..0e76ac2b2ac 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -1806,6 +1806,8 @@ int snd_hda_add_nid(struct hda_codec *codec, struct snd_kcontrol *kctl,
1806 item->nid = nid; 1806 item->nid = nid;
1807 return 0; 1807 return 0;
1808 } 1808 }
1809 printk(KERN_ERR "hda-codec: no NID for mapping control %s:%d:%d\n",
1810 kctl->id.name, kctl->id.index, index);
1809 return -EINVAL; 1811 return -EINVAL;
1810} 1812}
1811EXPORT_SYMBOL_HDA(snd_hda_add_nid); 1813EXPORT_SYMBOL_HDA(snd_hda_add_nid);
@@ -2884,7 +2886,7 @@ int /*__devinit*/ snd_hda_build_controls(struct hda_bus *bus)
2884 list_for_each_entry(codec, &bus->codec_list, list) { 2886 list_for_each_entry(codec, &bus->codec_list, list) {
2885 int err = snd_hda_codec_build_controls(codec); 2887 int err = snd_hda_codec_build_controls(codec);
2886 if (err < 0) { 2888 if (err < 0) {
2887 printk(KERN_ERR "hda_codec: cannot build controls" 2889 printk(KERN_ERR "hda_codec: cannot build controls "
2888 "for #%d (error %d)\n", codec->addr, err); 2890 "for #%d (error %d)\n", codec->addr, err);
2889 err = snd_hda_codec_reset(codec); 2891 err = snd_hda_codec_reset(codec);
2890 if (err < 0) { 2892 if (err < 0) {
diff --git a/sound/pci/hda/hda_eld.c b/sound/pci/hda/hda_eld.c
index dcd22446cfc..d8da18a9e98 100644
--- a/sound/pci/hda/hda_eld.c
+++ b/sound/pci/hda/hda_eld.c
@@ -22,6 +22,7 @@
22 */ 22 */
23 23
24#include <linux/init.h> 24#include <linux/init.h>
25#include <linux/slab.h>
25#include <sound/core.h> 26#include <sound/core.h>
26#include <asm/unaligned.h> 27#include <asm/unaligned.h>
27#include "hda_codec.h" 28#include "hda_codec.h"
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 43b7cfb7cff..f669442b7c8 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -2269,8 +2269,11 @@ static struct snd_pci_quirk position_fix_list[] __devinitdata = {
2269 SND_PCI_QUIRK(0x103c, 0x306d, "HP dv3", POS_FIX_LPIB), 2269 SND_PCI_QUIRK(0x103c, 0x306d, "HP dv3", POS_FIX_LPIB),
2270 SND_PCI_QUIRK(0x1106, 0x3288, "ASUS M2V-MX SE", POS_FIX_LPIB), 2270 SND_PCI_QUIRK(0x1106, 0x3288, "ASUS M2V-MX SE", POS_FIX_LPIB),
2271 SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", POS_FIX_LPIB), 2271 SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", POS_FIX_LPIB),
2272 SND_PCI_QUIRK(0x1458, 0xa022, "ga-ma770-ud3", POS_FIX_LPIB),
2272 SND_PCI_QUIRK(0x1462, 0x1002, "MSI Wind U115", POS_FIX_LPIB), 2273 SND_PCI_QUIRK(0x1462, 0x1002, "MSI Wind U115", POS_FIX_LPIB),
2273 SND_PCI_QUIRK(0x1565, 0x820f, "Biostar Microtech", POS_FIX_LPIB), 2274 SND_PCI_QUIRK(0x1565, 0x820f, "Biostar Microtech", POS_FIX_LPIB),
2275 SND_PCI_QUIRK(0x1565, 0x8218, "Biostar Microtech", POS_FIX_LPIB),
2276 SND_PCI_QUIRK(0x8086, 0xd601, "eMachines T5212", POS_FIX_LPIB),
2274 {} 2277 {}
2275}; 2278};
2276 2279
@@ -2358,7 +2361,9 @@ static void __devinit check_probe_mask(struct azx *chip, int dev)
2358static struct snd_pci_quirk msi_black_list[] __devinitdata = { 2361static struct snd_pci_quirk msi_black_list[] __devinitdata = {
2359 SND_PCI_QUIRK(0x1043, 0x81f2, "ASUS", 0), /* Athlon64 X2 + nvidia */ 2362 SND_PCI_QUIRK(0x1043, 0x81f2, "ASUS", 0), /* Athlon64 X2 + nvidia */
2360 SND_PCI_QUIRK(0x1043, 0x81f6, "ASUS", 0), /* nvidia */ 2363 SND_PCI_QUIRK(0x1043, 0x81f6, "ASUS", 0), /* nvidia */
2364 SND_PCI_QUIRK(0x1043, 0x822d, "ASUS", 0), /* Athlon64 X2 + nvidia MCP55 */
2361 SND_PCI_QUIRK(0x1849, 0x0888, "ASRock", 0), /* Athlon64 X2 + nvidia */ 2365 SND_PCI_QUIRK(0x1849, 0x0888, "ASRock", 0), /* Athlon64 X2 + nvidia */
2366 SND_PCI_QUIRK(0xa0a0, 0x0575, "Aopen MZ915-M", 0), /* ICH6 */
2362 {} 2367 {}
2363}; 2368};
2364 2369
@@ -2377,6 +2382,13 @@ static void __devinit check_msi(struct azx *chip)
2377 "hda_intel: msi for device %04x:%04x set to %d\n", 2382 "hda_intel: msi for device %04x:%04x set to %d\n",
2378 q->subvendor, q->subdevice, q->value); 2383 q->subvendor, q->subdevice, q->value);
2379 chip->msi = q->value; 2384 chip->msi = q->value;
2385 return;
2386 }
2387
2388 /* NVidia chipsets seem to cause troubles with MSI */
2389 if (chip->driver_type == AZX_DRIVER_NVIDIA) {
2390 printk(KERN_INFO "hda_intel: Disable MSI for Nvidia chipset\n");
2391 chip->msi = 0;
2380 } 2392 }
2381} 2393}
2382 2394
@@ -2705,6 +2717,7 @@ static DEFINE_PCI_DEVICE_TABLE(azx_ids) = {
2705 { PCI_DEVICE(0x8086, 0x3a6e), .driver_data = AZX_DRIVER_ICH }, 2717 { PCI_DEVICE(0x8086, 0x3a6e), .driver_data = AZX_DRIVER_ICH },
2706 /* PCH */ 2718 /* PCH */
2707 { PCI_DEVICE(0x8086, 0x3b56), .driver_data = AZX_DRIVER_ICH }, 2719 { PCI_DEVICE(0x8086, 0x3b56), .driver_data = AZX_DRIVER_ICH },
2720 { PCI_DEVICE(0x8086, 0x3b57), .driver_data = AZX_DRIVER_ICH },
2708 /* CPT */ 2721 /* CPT */
2709 { PCI_DEVICE(0x8086, 0x1c20), .driver_data = AZX_DRIVER_PCH }, 2722 { PCI_DEVICE(0x8086, 0x1c20), .driver_data = AZX_DRIVER_PCH },
2710 /* SCH */ 2723 /* SCH */
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index e6d1bdff1b6..af34606c30c 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -1896,6 +1896,14 @@ static int patch_ad1981(struct hda_codec *codec)
1896 case AD1981_THINKPAD: 1896 case AD1981_THINKPAD:
1897 spec->mixers[0] = ad1981_thinkpad_mixers; 1897 spec->mixers[0] = ad1981_thinkpad_mixers;
1898 spec->input_mux = &ad1981_thinkpad_capture_source; 1898 spec->input_mux = &ad1981_thinkpad_capture_source;
1899 /* set the upper-limit for mixer amp to 0dB for avoiding the
1900 * possible damage by overloading
1901 */
1902 snd_hda_override_amp_caps(codec, 0x11, HDA_INPUT,
1903 (0x17 << AC_AMPCAP_OFFSET_SHIFT) |
1904 (0x17 << AC_AMPCAP_NUM_STEPS_SHIFT) |
1905 (0x05 << AC_AMPCAP_STEP_SIZE_SHIFT) |
1906 (1 << AC_AMPCAP_MUTE_SHIFT));
1899 break; 1907 break;
1900 case AD1981_TOSHIBA: 1908 case AD1981_TOSHIBA:
1901 spec->mixers[0] = ad1981_hp_mixers; 1909 spec->mixers[0] = ad1981_hp_mixers;
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index 194a28c5499..61682e1d09d 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -1591,6 +1591,21 @@ static int patch_cxt5047(struct hda_codec *codec)
1591#endif 1591#endif
1592 } 1592 }
1593 spec->vmaster_nid = 0x13; 1593 spec->vmaster_nid = 0x13;
1594
1595 switch (codec->subsystem_id >> 16) {
1596 case 0x103c:
1597 /* HP laptops have really bad sound over 0 dB on NID 0x10.
1598 * Fix max PCM level to 0 dB (originally it has 0x1e steps
1599 * with 0 dB offset 0x17)
1600 */
1601 snd_hda_override_amp_caps(codec, 0x10, HDA_INPUT,
1602 (0x17 << AC_AMPCAP_OFFSET_SHIFT) |
1603 (0x17 << AC_AMPCAP_NUM_STEPS_SHIFT) |
1604 (0x05 << AC_AMPCAP_STEP_SIZE_SHIFT) |
1605 (1 << AC_AMPCAP_MUTE_SHIFT));
1606 break;
1607 }
1608
1594 return 0; 1609 return 0;
1595} 1610}
1596 1611
diff --git a/sound/pci/hda/patch_nvhdmi.c b/sound/pci/hda/patch_nvhdmi.c
index 70669a24690..3c10c0b149f 100644
--- a/sound/pci/hda/patch_nvhdmi.c
+++ b/sound/pci/hda/patch_nvhdmi.c
@@ -538,8 +538,6 @@ static int patch_nvhdmi_2ch(struct hda_codec *codec)
538 * patch entries 538 * patch entries
539 */ 539 */
540static struct hda_codec_preset snd_hda_preset_nvhdmi[] = { 540static struct hda_codec_preset snd_hda_preset_nvhdmi[] = {
541 { .id = 0x10de0067, .name = "MCP67 HDMI", .patch = patch_nvhdmi_2ch },
542 { .id = 0x10de8001, .name = "MCP73 HDMI", .patch = patch_nvhdmi_2ch },
543 { .id = 0x10de0002, .name = "MCP77/78 HDMI", 541 { .id = 0x10de0002, .name = "MCP77/78 HDMI",
544 .patch = patch_nvhdmi_8ch_7x }, 542 .patch = patch_nvhdmi_8ch_7x },
545 { .id = 0x10de0003, .name = "MCP77/78 HDMI", 543 { .id = 0x10de0003, .name = "MCP77/78 HDMI",
@@ -550,12 +548,16 @@ static struct hda_codec_preset snd_hda_preset_nvhdmi[] = {
550 .patch = patch_nvhdmi_8ch_7x }, 548 .patch = patch_nvhdmi_8ch_7x },
551 { .id = 0x10de0007, .name = "MCP79/7A HDMI", 549 { .id = 0x10de0007, .name = "MCP79/7A HDMI",
552 .patch = patch_nvhdmi_8ch_7x }, 550 .patch = patch_nvhdmi_8ch_7x },
553 { .id = 0x10de000c, .name = "MCP89 HDMI", 551 { .id = 0x10de000a, .name = "GT220 HDMI",
554 .patch = patch_nvhdmi_8ch_89 }, 552 .patch = patch_nvhdmi_8ch_89 },
555 { .id = 0x10de000b, .name = "GT21x HDMI", 553 { .id = 0x10de000b, .name = "GT21x HDMI",
556 .patch = patch_nvhdmi_8ch_89 }, 554 .patch = patch_nvhdmi_8ch_89 },
555 { .id = 0x10de000c, .name = "MCP89 HDMI",
556 .patch = patch_nvhdmi_8ch_89 },
557 { .id = 0x10de000d, .name = "GT240 HDMI", 557 { .id = 0x10de000d, .name = "GT240 HDMI",
558 .patch = patch_nvhdmi_8ch_89 }, 558 .patch = patch_nvhdmi_8ch_89 },
559 { .id = 0x10de0067, .name = "MCP67 HDMI", .patch = patch_nvhdmi_2ch },
560 { .id = 0x10de8001, .name = "MCP73 HDMI", .patch = patch_nvhdmi_2ch },
559 {} /* terminator */ 561 {} /* terminator */
560}; 562};
561 563
@@ -564,11 +566,12 @@ MODULE_ALIAS("snd-hda-codec-id:10de0003");
564MODULE_ALIAS("snd-hda-codec-id:10de0005"); 566MODULE_ALIAS("snd-hda-codec-id:10de0005");
565MODULE_ALIAS("snd-hda-codec-id:10de0006"); 567MODULE_ALIAS("snd-hda-codec-id:10de0006");
566MODULE_ALIAS("snd-hda-codec-id:10de0007"); 568MODULE_ALIAS("snd-hda-codec-id:10de0007");
567MODULE_ALIAS("snd-hda-codec-id:10de0067"); 569MODULE_ALIAS("snd-hda-codec-id:10de000a");
568MODULE_ALIAS("snd-hda-codec-id:10de8001");
569MODULE_ALIAS("snd-hda-codec-id:10de000c");
570MODULE_ALIAS("snd-hda-codec-id:10de000b"); 570MODULE_ALIAS("snd-hda-codec-id:10de000b");
571MODULE_ALIAS("snd-hda-codec-id:10de000c");
571MODULE_ALIAS("snd-hda-codec-id:10de000d"); 572MODULE_ALIAS("snd-hda-codec-id:10de000d");
573MODULE_ALIAS("snd-hda-codec-id:10de0067");
574MODULE_ALIAS("snd-hda-codec-id:10de8001");
572 575
573MODULE_LICENSE("GPL"); 576MODULE_LICENSE("GPL");
574MODULE_DESCRIPTION("NVIDIA HDMI HD-audio codec"); 577MODULE_DESCRIPTION("NVIDIA HDMI HD-audio codec");
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 5d2fbb87b87..aad1627f56f 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -230,6 +230,7 @@ enum {
230 ALC888_ACER_ASPIRE_7730G, 230 ALC888_ACER_ASPIRE_7730G,
231 ALC883_MEDION, 231 ALC883_MEDION,
232 ALC883_MEDION_MD2, 232 ALC883_MEDION_MD2,
233 ALC883_MEDION_WIM2160,
233 ALC883_LAPTOP_EAPD, 234 ALC883_LAPTOP_EAPD,
234 ALC883_LENOVO_101E_2ch, 235 ALC883_LENOVO_101E_2ch,
235 ALC883_LENOVO_NB0763, 236 ALC883_LENOVO_NB0763,
@@ -411,6 +412,8 @@ static int alc_mux_enum_info(struct snd_kcontrol *kcontrol,
411 unsigned int mux_idx = snd_ctl_get_ioffidx(kcontrol, &uinfo->id); 412 unsigned int mux_idx = snd_ctl_get_ioffidx(kcontrol, &uinfo->id);
412 if (mux_idx >= spec->num_mux_defs) 413 if (mux_idx >= spec->num_mux_defs)
413 mux_idx = 0; 414 mux_idx = 0;
415 if (!spec->input_mux[mux_idx].num_items && mux_idx > 0)
416 mux_idx = 0;
414 return snd_hda_input_mux_info(&spec->input_mux[mux_idx], uinfo); 417 return snd_hda_input_mux_info(&spec->input_mux[mux_idx], uinfo);
415} 418}
416 419
@@ -439,6 +442,8 @@ static int alc_mux_enum_put(struct snd_kcontrol *kcontrol,
439 442
440 mux_idx = adc_idx >= spec->num_mux_defs ? 0 : adc_idx; 443 mux_idx = adc_idx >= spec->num_mux_defs ? 0 : adc_idx;
441 imux = &spec->input_mux[mux_idx]; 444 imux = &spec->input_mux[mux_idx];
445 if (!imux->num_items && mux_idx > 0)
446 imux = &spec->input_mux[0];
442 447
443 type = get_wcaps_type(get_wcaps(codec, nid)); 448 type = get_wcaps_type(get_wcaps(codec, nid));
444 if (type == AC_WID_AUD_MIX) { 449 if (type == AC_WID_AUD_MIX) {
@@ -1385,22 +1390,31 @@ struct alc_fixup {
1385 1390
1386static void alc_pick_fixup(struct hda_codec *codec, 1391static void alc_pick_fixup(struct hda_codec *codec,
1387 const struct snd_pci_quirk *quirk, 1392 const struct snd_pci_quirk *quirk,
1388 const struct alc_fixup *fix) 1393 const struct alc_fixup *fix,
1394 int pre_init)
1389{ 1395{
1390 const struct alc_pincfg *cfg; 1396 const struct alc_pincfg *cfg;
1391 1397
1392 quirk = snd_pci_quirk_lookup(codec->bus->pci, quirk); 1398 quirk = snd_pci_quirk_lookup(codec->bus->pci, quirk);
1393 if (!quirk) 1399 if (!quirk)
1394 return; 1400 return;
1395
1396 fix += quirk->value; 1401 fix += quirk->value;
1397 cfg = fix->pins; 1402 cfg = fix->pins;
1398 if (cfg) { 1403 if (pre_init && cfg) {
1404#ifdef CONFIG_SND_DEBUG_VERBOSE
1405 snd_printdd(KERN_INFO "hda_codec: %s: Apply pincfg for %s\n",
1406 codec->chip_name, quirk->name);
1407#endif
1399 for (; cfg->nid; cfg++) 1408 for (; cfg->nid; cfg++)
1400 snd_hda_codec_set_pincfg(codec, cfg->nid, cfg->val); 1409 snd_hda_codec_set_pincfg(codec, cfg->nid, cfg->val);
1401 } 1410 }
1402 if (fix->verbs) 1411 if (!pre_init && fix->verbs) {
1412#ifdef CONFIG_SND_DEBUG_VERBOSE
1413 snd_printdd(KERN_INFO "hda_codec: %s: Apply fix-verbs for %s\n",
1414 codec->chip_name, quirk->name);
1415#endif
1403 add_verb(codec->spec, fix->verbs); 1416 add_verb(codec->spec, fix->verbs);
1417 }
1404} 1418}
1405 1419
1406static int alc_read_coef_idx(struct hda_codec *codec, 1420static int alc_read_coef_idx(struct hda_codec *codec,
@@ -1617,6 +1631,11 @@ static struct hda_verb alc888_acer_aspire_4930g_verbs[] = {
1617 */ 1631 */
1618 1632
1619static struct hda_verb alc888_acer_aspire_6530g_verbs[] = { 1633static struct hda_verb alc888_acer_aspire_6530g_verbs[] = {
1634/* Route to built-in subwoofer as well as speakers */
1635 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1636 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
1637 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
1638 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
1620/* Bias voltage on for external mic port */ 1639/* Bias voltage on for external mic port */
1621 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN | PIN_VREF80}, 1640 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN | PIN_VREF80},
1622/* Front Mic: set to PIN_IN (empty by default) */ 1641/* Front Mic: set to PIN_IN (empty by default) */
@@ -1628,10 +1647,12 @@ static struct hda_verb alc888_acer_aspire_6530g_verbs[] = {
1628/* Enable speaker output */ 1647/* Enable speaker output */
1629 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, 1648 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1630 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 1649 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1650 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 2},
1631/* Enable headphone output */ 1651/* Enable headphone output */
1632 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | PIN_HP}, 1652 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | PIN_HP},
1633 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, 1653 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1634 {0x15, AC_VERB_SET_CONNECT_SEL, 0x00}, 1654 {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
1655 {0x15, AC_VERB_SET_EAPD_BTLENABLE, 2},
1635 { } 1656 { }
1636}; 1657};
1637 1658
@@ -2528,8 +2549,6 @@ static int alc_build_controls(struct hda_codec *codec)
2528 return err; 2549 return err;
2529 } 2550 }
2530 2551
2531 alc_free_kctls(codec); /* no longer needed */
2532
2533 /* assign Capture Source enums to NID */ 2552 /* assign Capture Source enums to NID */
2534 kctl = snd_hda_find_mixer_ctl(codec, "Capture Source"); 2553 kctl = snd_hda_find_mixer_ctl(codec, "Capture Source");
2535 if (!kctl) 2554 if (!kctl)
@@ -2598,6 +2617,9 @@ static int alc_build_controls(struct hda_codec *codec)
2598 } 2617 }
2599 } 2618 }
2600 } 2619 }
2620
2621 alc_free_kctls(codec); /* no longer needed */
2622
2601 return 0; 2623 return 0;
2602} 2624}
2603 2625
@@ -4796,6 +4818,25 @@ static void alc880_auto_init_analog_input(struct hda_codec *codec)
4796 } 4818 }
4797} 4819}
4798 4820
4821static void alc880_auto_init_input_src(struct hda_codec *codec)
4822{
4823 struct alc_spec *spec = codec->spec;
4824 int c;
4825
4826 for (c = 0; c < spec->num_adc_nids; c++) {
4827 unsigned int mux_idx;
4828 const struct hda_input_mux *imux;
4829 mux_idx = c >= spec->num_mux_defs ? 0 : c;
4830 imux = &spec->input_mux[mux_idx];
4831 if (!imux->num_items && mux_idx > 0)
4832 imux = &spec->input_mux[0];
4833 if (imux)
4834 snd_hda_codec_write(codec, spec->adc_nids[c], 0,
4835 AC_VERB_SET_CONNECT_SEL,
4836 imux->items[0].index);
4837 }
4838}
4839
4799/* parse the BIOS configuration and set up the alc_spec */ 4840/* parse the BIOS configuration and set up the alc_spec */
4800/* return 1 if successful, 0 if the proper config is not found, 4841/* return 1 if successful, 0 if the proper config is not found,
4801 * or a negative error code 4842 * or a negative error code
@@ -4874,6 +4915,7 @@ static void alc880_auto_init(struct hda_codec *codec)
4874 alc880_auto_init_multi_out(codec); 4915 alc880_auto_init_multi_out(codec);
4875 alc880_auto_init_extra_out(codec); 4916 alc880_auto_init_extra_out(codec);
4876 alc880_auto_init_analog_input(codec); 4917 alc880_auto_init_analog_input(codec);
4918 alc880_auto_init_input_src(codec);
4877 if (spec->unsol_event) 4919 if (spec->unsol_event)
4878 alc_inithook(codec); 4920 alc_inithook(codec);
4879} 4921}
@@ -4979,6 +5021,70 @@ static void set_capture_mixer(struct hda_codec *codec)
4979 } 5021 }
4980} 5022}
4981 5023
5024/* fill adc_nids (and capsrc_nids) containing all active input pins */
5025static void fillup_priv_adc_nids(struct hda_codec *codec, hda_nid_t *nids,
5026 int num_nids)
5027{
5028 struct alc_spec *spec = codec->spec;
5029 int n;
5030 hda_nid_t fallback_adc = 0, fallback_cap = 0;
5031
5032 for (n = 0; n < num_nids; n++) {
5033 hda_nid_t adc, cap;
5034 hda_nid_t conn[HDA_MAX_NUM_INPUTS];
5035 int nconns, i, j;
5036
5037 adc = nids[n];
5038 if (get_wcaps_type(get_wcaps(codec, adc)) != AC_WID_AUD_IN)
5039 continue;
5040 cap = adc;
5041 nconns = snd_hda_get_connections(codec, cap, conn,
5042 ARRAY_SIZE(conn));
5043 if (nconns == 1) {
5044 cap = conn[0];
5045 nconns = snd_hda_get_connections(codec, cap, conn,
5046 ARRAY_SIZE(conn));
5047 }
5048 if (nconns <= 0)
5049 continue;
5050 if (!fallback_adc) {
5051 fallback_adc = adc;
5052 fallback_cap = cap;
5053 }
5054 for (i = 0; i < AUTO_PIN_LAST; i++) {
5055 hda_nid_t nid = spec->autocfg.input_pins[i];
5056 if (!nid)
5057 continue;
5058 for (j = 0; j < nconns; j++) {
5059 if (conn[j] == nid)
5060 break;
5061 }
5062 if (j >= nconns)
5063 break;
5064 }
5065 if (i >= AUTO_PIN_LAST) {
5066 int num_adcs = spec->num_adc_nids;
5067 spec->private_adc_nids[num_adcs] = adc;
5068 spec->private_capsrc_nids[num_adcs] = cap;
5069 spec->num_adc_nids++;
5070 spec->adc_nids = spec->private_adc_nids;
5071 if (adc != cap)
5072 spec->capsrc_nids = spec->private_capsrc_nids;
5073 }
5074 }
5075 if (!spec->num_adc_nids) {
5076 printk(KERN_WARNING "hda_codec: %s: no valid ADC found;"
5077 " using fallback 0x%x\n",
5078 codec->chip_name, fallback_adc);
5079 spec->private_adc_nids[0] = fallback_adc;
5080 spec->adc_nids = spec->private_adc_nids;
5081 if (fallback_adc != fallback_cap) {
5082 spec->private_capsrc_nids[0] = fallback_cap;
5083 spec->capsrc_nids = spec->private_adc_nids;
5084 }
5085 }
5086}
5087
4982#ifdef CONFIG_SND_HDA_INPUT_BEEP 5088#ifdef CONFIG_SND_HDA_INPUT_BEEP
4983#define set_beep_amp(spec, nid, idx, dir) \ 5089#define set_beep_amp(spec, nid, idx, dir) \
4984 ((spec)->beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir)) 5090 ((spec)->beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir))
@@ -6321,6 +6427,8 @@ static void alc260_auto_init_analog_input(struct hda_codec *codec)
6321 } 6427 }
6322} 6428}
6323 6429
6430#define alc260_auto_init_input_src alc880_auto_init_input_src
6431
6324/* 6432/*
6325 * generic initialization of ADC, input mixers and output mixers 6433 * generic initialization of ADC, input mixers and output mixers
6326 */ 6434 */
@@ -6407,6 +6515,7 @@ static void alc260_auto_init(struct hda_codec *codec)
6407 struct alc_spec *spec = codec->spec; 6515 struct alc_spec *spec = codec->spec;
6408 alc260_auto_init_multi_out(codec); 6516 alc260_auto_init_multi_out(codec);
6409 alc260_auto_init_analog_input(codec); 6517 alc260_auto_init_analog_input(codec);
6518 alc260_auto_init_input_src(codec);
6410 if (spec->unsol_event) 6519 if (spec->unsol_event)
6411 alc_inithook(codec); 6520 alc_inithook(codec);
6412} 6521}
@@ -6473,7 +6582,7 @@ static struct alc_config_preset alc260_presets[] = {
6473 .num_dacs = ARRAY_SIZE(alc260_dac_nids), 6582 .num_dacs = ARRAY_SIZE(alc260_dac_nids),
6474 .dac_nids = alc260_dac_nids, 6583 .dac_nids = alc260_dac_nids,
6475 .num_adc_nids = ARRAY_SIZE(alc260_dual_adc_nids), 6584 .num_adc_nids = ARRAY_SIZE(alc260_dual_adc_nids),
6476 .adc_nids = alc260_adc_nids, 6585 .adc_nids = alc260_dual_adc_nids,
6477 .num_channel_mode = ARRAY_SIZE(alc260_modes), 6586 .num_channel_mode = ARRAY_SIZE(alc260_modes),
6478 .channel_mode = alc260_modes, 6587 .channel_mode = alc260_modes,
6479 .input_mux = &alc260_capture_source, 6588 .input_mux = &alc260_capture_source,
@@ -8379,6 +8488,42 @@ static struct snd_kcontrol_new alc883_medion_md2_mixer[] = {
8379 { } /* end */ 8488 { } /* end */
8380}; 8489};
8381 8490
8491static struct snd_kcontrol_new alc883_medion_wim2160_mixer[] = {
8492 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
8493 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
8494 HDA_CODEC_MUTE("Speaker Playback Switch", 0x15, 0x0, HDA_OUTPUT),
8495 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1a, 0x0, HDA_OUTPUT),
8496 HDA_CODEC_VOLUME("Line Playback Volume", 0x08, 0x0, HDA_INPUT),
8497 HDA_CODEC_MUTE("Line Playback Switch", 0x08, 0x0, HDA_INPUT),
8498 { } /* end */
8499};
8500
8501static struct hda_verb alc883_medion_wim2160_verbs[] = {
8502 /* Unmute front mixer */
8503 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
8504 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
8505
8506 /* Set speaker pin to front mixer */
8507 {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
8508
8509 /* Init headphone pin */
8510 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
8511 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
8512 {0x1a, AC_VERB_SET_CONNECT_SEL, 0x00},
8513 {0x1a, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
8514
8515 { } /* end */
8516};
8517
8518/* toggle speaker-output according to the hp-jack state */
8519static void alc883_medion_wim2160_setup(struct hda_codec *codec)
8520{
8521 struct alc_spec *spec = codec->spec;
8522
8523 spec->autocfg.hp_pins[0] = 0x1a;
8524 spec->autocfg.speaker_pins[0] = 0x15;
8525}
8526
8382static struct snd_kcontrol_new alc883_acer_aspire_mixer[] = { 8527static struct snd_kcontrol_new alc883_acer_aspire_mixer[] = {
8383 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), 8528 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
8384 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT), 8529 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
@@ -8393,9 +8538,7 @@ static struct snd_kcontrol_new alc883_acer_aspire_mixer[] = {
8393 8538
8394static struct snd_kcontrol_new alc888_acer_aspire_6530_mixer[] = { 8539static struct snd_kcontrol_new alc888_acer_aspire_6530_mixer[] = {
8395 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), 8540 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
8396 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
8397 HDA_CODEC_VOLUME("LFE Playback Volume", 0x0f, 0x0, HDA_OUTPUT), 8541 HDA_CODEC_VOLUME("LFE Playback Volume", 0x0f, 0x0, HDA_OUTPUT),
8398 HDA_BIND_MUTE("LFE Playback Switch", 0x0f, 2, HDA_INPUT),
8399 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT), 8542 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
8400 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT), 8543 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
8401 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT), 8544 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
@@ -9090,6 +9233,7 @@ static const char *alc882_models[ALC882_MODEL_LAST] = {
9090 [ALC888_ACER_ASPIRE_7730G] = "acer-aspire-7730g", 9233 [ALC888_ACER_ASPIRE_7730G] = "acer-aspire-7730g",
9091 [ALC883_MEDION] = "medion", 9234 [ALC883_MEDION] = "medion",
9092 [ALC883_MEDION_MD2] = "medion-md2", 9235 [ALC883_MEDION_MD2] = "medion-md2",
9236 [ALC883_MEDION_WIM2160] = "medion-wim2160",
9093 [ALC883_LAPTOP_EAPD] = "laptop-eapd", 9237 [ALC883_LAPTOP_EAPD] = "laptop-eapd",
9094 [ALC883_LENOVO_101E_2ch] = "lenovo-101e", 9238 [ALC883_LENOVO_101E_2ch] = "lenovo-101e",
9095 [ALC883_LENOVO_NB0763] = "lenovo-nb0763", 9239 [ALC883_LENOVO_NB0763] = "lenovo-nb0763",
@@ -9191,6 +9335,7 @@ static struct snd_pci_quirk alc882_cfg_tbl[] = {
9191 SND_PCI_QUIRK(0x1462, 0x4314, "MSI", ALC883_TARGA_DIG), 9335 SND_PCI_QUIRK(0x1462, 0x4314, "MSI", ALC883_TARGA_DIG),
9192 SND_PCI_QUIRK(0x1462, 0x4319, "MSI", ALC883_TARGA_DIG), 9336 SND_PCI_QUIRK(0x1462, 0x4319, "MSI", ALC883_TARGA_DIG),
9193 SND_PCI_QUIRK(0x1462, 0x4324, "MSI", ALC883_TARGA_DIG), 9337 SND_PCI_QUIRK(0x1462, 0x4324, "MSI", ALC883_TARGA_DIG),
9338 SND_PCI_QUIRK(0x1462, 0x4570, "MSI Wind Top AE2220", ALC883_TARGA_DIG),
9194 SND_PCI_QUIRK(0x1462, 0x6510, "MSI GX620", ALC883_TARGA_8ch_DIG), 9339 SND_PCI_QUIRK(0x1462, 0x6510, "MSI GX620", ALC883_TARGA_8ch_DIG),
9195 SND_PCI_QUIRK(0x1462, 0x6668, "MSI", ALC883_6ST_DIG), 9340 SND_PCI_QUIRK(0x1462, 0x6668, "MSI", ALC883_6ST_DIG),
9196 SND_PCI_QUIRK(0x1462, 0x7187, "MSI", ALC883_6ST_DIG), 9341 SND_PCI_QUIRK(0x1462, 0x7187, "MSI", ALC883_6ST_DIG),
@@ -9200,10 +9345,12 @@ static struct snd_pci_quirk alc882_cfg_tbl[] = {
9200 SND_PCI_QUIRK(0x1462, 0x7280, "MSI", ALC883_6ST_DIG), 9345 SND_PCI_QUIRK(0x1462, 0x7280, "MSI", ALC883_6ST_DIG),
9201 SND_PCI_QUIRK(0x1462, 0x7327, "MSI", ALC883_6ST_DIG), 9346 SND_PCI_QUIRK(0x1462, 0x7327, "MSI", ALC883_6ST_DIG),
9202 SND_PCI_QUIRK(0x1462, 0x7350, "MSI", ALC883_6ST_DIG), 9347 SND_PCI_QUIRK(0x1462, 0x7350, "MSI", ALC883_6ST_DIG),
9348 SND_PCI_QUIRK(0x1462, 0x7437, "MSI NetOn AP1900", ALC883_TARGA_DIG),
9203 SND_PCI_QUIRK(0x1462, 0xa422, "MSI", ALC883_TARGA_2ch_DIG), 9349 SND_PCI_QUIRK(0x1462, 0xa422, "MSI", ALC883_TARGA_2ch_DIG),
9204 SND_PCI_QUIRK(0x1462, 0xaa08, "MSI", ALC883_TARGA_2ch_DIG), 9350 SND_PCI_QUIRK(0x1462, 0xaa08, "MSI", ALC883_TARGA_2ch_DIG),
9205 9351
9206 SND_PCI_QUIRK(0x147b, 0x1083, "Abit IP35-PRO", ALC883_6ST_DIG), 9352 SND_PCI_QUIRK(0x147b, 0x1083, "Abit IP35-PRO", ALC883_6ST_DIG),
9353 SND_PCI_QUIRK(0x1558, 0x0571, "Clevo laptop M570U", ALC883_3ST_6ch_DIG),
9207 SND_PCI_QUIRK(0x1558, 0x0721, "Clevo laptop M720R", ALC883_CLEVO_M720), 9354 SND_PCI_QUIRK(0x1558, 0x0721, "Clevo laptop M720R", ALC883_CLEVO_M720),
9208 SND_PCI_QUIRK(0x1558, 0x0722, "Clevo laptop M720SR", ALC883_CLEVO_M720), 9355 SND_PCI_QUIRK(0x1558, 0x0722, "Clevo laptop M720SR", ALC883_CLEVO_M720),
9209 SND_PCI_QUIRK(0x1558, 0x5409, "Clevo laptop M540R", ALC883_CLEVO_M540R), 9356 SND_PCI_QUIRK(0x1558, 0x5409, "Clevo laptop M540R", ALC883_CLEVO_M540R),
@@ -9231,7 +9378,7 @@ static struct snd_pci_quirk alc882_cfg_tbl[] = {
9231 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_INTEL), 9378 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_INTEL),
9232 SND_PCI_QUIRK(0x8086, 0x0021, "Intel IbexPeak", ALC889A_INTEL), 9379 SND_PCI_QUIRK(0x8086, 0x0021, "Intel IbexPeak", ALC889A_INTEL),
9233 SND_PCI_QUIRK(0x8086, 0x3b56, "Intel IbexPeak", ALC889A_INTEL), 9380 SND_PCI_QUIRK(0x8086, 0x3b56, "Intel IbexPeak", ALC889A_INTEL),
9234 SND_PCI_QUIRK(0x8086, 0xd601, "D102GGC", ALC883_3ST_6ch), 9381 SND_PCI_QUIRK(0x8086, 0xd601, "D102GGC", ALC882_6ST_DIG),
9235 9382
9236 {} 9383 {}
9237}; 9384};
@@ -9742,6 +9889,21 @@ static struct alc_config_preset alc882_presets[] = {
9742 .setup = alc883_medion_md2_setup, 9889 .setup = alc883_medion_md2_setup,
9743 .init_hook = alc_automute_amp, 9890 .init_hook = alc_automute_amp,
9744 }, 9891 },
9892 [ALC883_MEDION_WIM2160] = {
9893 .mixers = { alc883_medion_wim2160_mixer },
9894 .init_verbs = { alc883_init_verbs, alc883_medion_wim2160_verbs },
9895 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
9896 .dac_nids = alc883_dac_nids,
9897 .dig_out_nid = ALC883_DIGOUT_NID,
9898 .num_adc_nids = ARRAY_SIZE(alc883_adc_nids),
9899 .adc_nids = alc883_adc_nids,
9900 .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
9901 .channel_mode = alc883_3ST_2ch_modes,
9902 .input_mux = &alc883_capture_source,
9903 .unsol_event = alc_automute_amp_unsol_event,
9904 .setup = alc883_medion_wim2160_setup,
9905 .init_hook = alc_automute_amp,
9906 },
9745 [ALC883_LAPTOP_EAPD] = { 9907 [ALC883_LAPTOP_EAPD] = {
9746 .mixers = { alc883_base_mixer }, 9908 .mixers = { alc883_base_mixer },
9747 .init_verbs = { alc883_init_verbs, alc882_eapd_verbs }, 9909 .init_verbs = { alc883_init_verbs, alc882_eapd_verbs },
@@ -10034,6 +10196,8 @@ static void alc882_auto_set_output_and_unmute(struct hda_codec *codec,
10034 int idx; 10196 int idx;
10035 10197
10036 alc_set_pin_output(codec, nid, pin_type); 10198 alc_set_pin_output(codec, nid, pin_type);
10199 if (dac_idx >= spec->multiout.num_dacs)
10200 return;
10037 if (spec->multiout.dac_nids[dac_idx] == 0x25) 10201 if (spec->multiout.dac_nids[dac_idx] == 0x25)
10038 idx = 4; 10202 idx = 4;
10039 else 10203 else
@@ -10105,6 +10269,8 @@ static void alc882_auto_init_input_src(struct hda_codec *codec)
10105 continue; 10269 continue;
10106 mux_idx = c >= spec->num_mux_defs ? 0 : c; 10270 mux_idx = c >= spec->num_mux_defs ? 0 : c;
10107 imux = &spec->input_mux[mux_idx]; 10271 imux = &spec->input_mux[mux_idx];
10272 if (!imux->num_items && mux_idx > 0)
10273 imux = &spec->input_mux[0];
10108 for (idx = 0; idx < conns; idx++) { 10274 for (idx = 0; idx < conns; idx++) {
10109 /* if the current connection is the selected one, 10275 /* if the current connection is the selected one,
10110 * unmute it as default - otherwise mute it 10276 * unmute it as default - otherwise mute it
@@ -10283,7 +10449,8 @@ static int patch_alc882(struct hda_codec *codec)
10283 board_config = ALC882_AUTO; 10449 board_config = ALC882_AUTO;
10284 } 10450 }
10285 10451
10286 alc_pick_fixup(codec, alc882_fixup_tbl, alc882_fixups); 10452 if (board_config == ALC882_AUTO)
10453 alc_pick_fixup(codec, alc882_fixup_tbl, alc882_fixups, 1);
10287 10454
10288 if (board_config == ALC882_AUTO) { 10455 if (board_config == ALC882_AUTO) {
10289 /* automatic parse from the BIOS config */ 10456 /* automatic parse from the BIOS config */
@@ -10356,6 +10523,9 @@ static int patch_alc882(struct hda_codec *codec)
10356 set_capture_mixer(codec); 10523 set_capture_mixer(codec);
10357 set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); 10524 set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
10358 10525
10526 if (board_config == ALC882_AUTO)
10527 alc_pick_fixup(codec, alc882_fixup_tbl, alc882_fixups, 0);
10528
10359 spec->vmaster_nid = 0x0c; 10529 spec->vmaster_nid = 0x0c;
10360 10530
10361 codec->patch_ops = alc_patch_ops; 10531 codec->patch_ops = alc_patch_ops;
@@ -12447,11 +12617,11 @@ static void alc268_aspire_one_speaker_automute(struct hda_codec *codec)
12447 unsigned char bits; 12617 unsigned char bits;
12448 12618
12449 present = snd_hda_jack_detect(codec, 0x15); 12619 present = snd_hda_jack_detect(codec, 0x15);
12450 bits = present ? AMP_IN_MUTE(0) : 0; 12620 bits = present ? HDA_AMP_MUTE : 0;
12451 snd_hda_codec_amp_stereo(codec, 0x0f, HDA_INPUT, 0, 12621 snd_hda_codec_amp_stereo(codec, 0x0f, HDA_INPUT, 0,
12452 AMP_IN_MUTE(0), bits); 12622 HDA_AMP_MUTE, bits);
12453 snd_hda_codec_amp_stereo(codec, 0x0f, HDA_INPUT, 1, 12623 snd_hda_codec_amp_stereo(codec, 0x0f, HDA_INPUT, 1,
12454 AMP_IN_MUTE(0), bits); 12624 HDA_AMP_MUTE, bits);
12455} 12625}
12456 12626
12457static void alc268_acer_lc_unsol_event(struct hda_codec *codec, 12627static void alc268_acer_lc_unsol_event(struct hda_codec *codec,
@@ -12736,6 +12906,7 @@ static int alc268_new_analog_output(struct alc_spec *spec, hda_nid_t nid,
12736 dac = 0x02; 12906 dac = 0x02;
12737 break; 12907 break;
12738 case 0x15: 12908 case 0x15:
12909 case 0x21: /* ALC269vb has this pin, too */
12739 dac = 0x03; 12910 dac = 0x03;
12740 break; 12911 break;
12741 default: 12912 default:
@@ -13201,7 +13372,7 @@ static int patch_alc268(struct hda_codec *codec)
13201 13372
13202 if (board_config < 0 || board_config >= ALC268_MODEL_LAST) 13373 if (board_config < 0 || board_config >= ALC268_MODEL_LAST)
13203 board_config = snd_hda_check_board_codec_sid_config(codec, 13374 board_config = snd_hda_check_board_codec_sid_config(codec,
13204 ALC882_MODEL_LAST, alc268_models, alc268_ssid_cfg_tbl); 13375 ALC268_MODEL_LAST, alc268_models, alc268_ssid_cfg_tbl);
13205 13376
13206 if (board_config < 0 || board_config >= ALC268_MODEL_LAST) { 13377 if (board_config < 0 || board_config >= ALC268_MODEL_LAST) {
13207 printk(KERN_INFO "hda_codec: %s: BIOS auto-probing.\n", 13378 printk(KERN_INFO "hda_codec: %s: BIOS auto-probing.\n",
@@ -13321,9 +13492,9 @@ static hda_nid_t alc269vb_capsrc_nids[1] = {
13321 0x22, 13492 0x22,
13322}; 13493};
13323 13494
13324/* NOTE: ADC2 (0x07) is connected from a recording *MIXER* (0x24), 13495static hda_nid_t alc269_adc_candidates[] = {
13325 * not a mux! 13496 0x08, 0x09, 0x07,
13326 */ 13497};
13327 13498
13328#define alc269_modes alc260_modes 13499#define alc269_modes alc260_modes
13329#define alc269_capture_source alc880_lg_lw_capture_source 13500#define alc269_capture_source alc880_lg_lw_capture_source
@@ -13470,11 +13641,11 @@ static void alc269_quanta_fl1_speaker_automute(struct hda_codec *codec)
13470 unsigned char bits; 13641 unsigned char bits;
13471 13642
13472 present = snd_hda_jack_detect(codec, 0x15); 13643 present = snd_hda_jack_detect(codec, 0x15);
13473 bits = present ? AMP_IN_MUTE(0) : 0; 13644 bits = present ? HDA_AMP_MUTE : 0;
13474 snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 0, 13645 snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 0,
13475 AMP_IN_MUTE(0), bits); 13646 HDA_AMP_MUTE, bits);
13476 snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 1, 13647 snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 1,
13477 AMP_IN_MUTE(0), bits); 13648 HDA_AMP_MUTE, bits);
13478 13649
13479 snd_hda_codec_write(codec, 0x20, 0, 13650 snd_hda_codec_write(codec, 0x20, 0,
13480 AC_VERB_SET_COEF_INDEX, 0x0c); 13651 AC_VERB_SET_COEF_INDEX, 0x0c);
@@ -13499,11 +13670,11 @@ static void alc269_lifebook_speaker_automute(struct hda_codec *codec)
13499 /* Check port replicator headphone socket */ 13670 /* Check port replicator headphone socket */
13500 present |= snd_hda_jack_detect(codec, 0x1a); 13671 present |= snd_hda_jack_detect(codec, 0x1a);
13501 13672
13502 bits = present ? AMP_IN_MUTE(0) : 0; 13673 bits = present ? HDA_AMP_MUTE : 0;
13503 snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 0, 13674 snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 0,
13504 AMP_IN_MUTE(0), bits); 13675 HDA_AMP_MUTE, bits);
13505 snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 1, 13676 snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 1,
13506 AMP_IN_MUTE(0), bits); 13677 HDA_AMP_MUTE, bits);
13507 13678
13508 snd_hda_codec_write(codec, 0x20, 0, 13679 snd_hda_codec_write(codec, 0x20, 0,
13509 AC_VERB_SET_COEF_INDEX, 0x0c); 13680 AC_VERB_SET_COEF_INDEX, 0x0c);
@@ -13634,11 +13805,11 @@ static void alc269_speaker_automute(struct hda_codec *codec)
13634 unsigned char bits; 13805 unsigned char bits;
13635 13806
13636 present = snd_hda_jack_detect(codec, nid); 13807 present = snd_hda_jack_detect(codec, nid);
13637 bits = present ? AMP_IN_MUTE(0) : 0; 13808 bits = present ? HDA_AMP_MUTE : 0;
13638 snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 0, 13809 snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 0,
13639 AMP_IN_MUTE(0), bits); 13810 HDA_AMP_MUTE, bits);
13640 snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 1, 13811 snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 1,
13641 AMP_IN_MUTE(0), bits); 13812 HDA_AMP_MUTE, bits);
13642} 13813}
13643 13814
13644/* unsolicited event for HP jack sensing */ 13815/* unsolicited event for HP jack sensing */
@@ -13655,19 +13826,19 @@ static void alc269_laptop_unsol_event(struct hda_codec *codec,
13655 } 13826 }
13656} 13827}
13657 13828
13658static void alc269_laptop_dmic_setup(struct hda_codec *codec) 13829static void alc269_laptop_amic_setup(struct hda_codec *codec)
13659{ 13830{
13660 struct alc_spec *spec = codec->spec; 13831 struct alc_spec *spec = codec->spec;
13661 spec->autocfg.hp_pins[0] = 0x15; 13832 spec->autocfg.hp_pins[0] = 0x15;
13662 spec->autocfg.speaker_pins[0] = 0x14; 13833 spec->autocfg.speaker_pins[0] = 0x14;
13663 spec->ext_mic.pin = 0x18; 13834 spec->ext_mic.pin = 0x18;
13664 spec->ext_mic.mux_idx = 0; 13835 spec->ext_mic.mux_idx = 0;
13665 spec->int_mic.pin = 0x12; 13836 spec->int_mic.pin = 0x19;
13666 spec->int_mic.mux_idx = 5; 13837 spec->int_mic.mux_idx = 1;
13667 spec->auto_mic = 1; 13838 spec->auto_mic = 1;
13668} 13839}
13669 13840
13670static void alc269vb_laptop_dmic_setup(struct hda_codec *codec) 13841static void alc269_laptop_dmic_setup(struct hda_codec *codec)
13671{ 13842{
13672 struct alc_spec *spec = codec->spec; 13843 struct alc_spec *spec = codec->spec;
13673 spec->autocfg.hp_pins[0] = 0x15; 13844 spec->autocfg.hp_pins[0] = 0x15;
@@ -13675,14 +13846,14 @@ static void alc269vb_laptop_dmic_setup(struct hda_codec *codec)
13675 spec->ext_mic.pin = 0x18; 13846 spec->ext_mic.pin = 0x18;
13676 spec->ext_mic.mux_idx = 0; 13847 spec->ext_mic.mux_idx = 0;
13677 spec->int_mic.pin = 0x12; 13848 spec->int_mic.pin = 0x12;
13678 spec->int_mic.mux_idx = 6; 13849 spec->int_mic.mux_idx = 5;
13679 spec->auto_mic = 1; 13850 spec->auto_mic = 1;
13680} 13851}
13681 13852
13682static void alc269_laptop_amic_setup(struct hda_codec *codec) 13853static void alc269vb_laptop_amic_setup(struct hda_codec *codec)
13683{ 13854{
13684 struct alc_spec *spec = codec->spec; 13855 struct alc_spec *spec = codec->spec;
13685 spec->autocfg.hp_pins[0] = 0x15; 13856 spec->autocfg.hp_pins[0] = 0x21;
13686 spec->autocfg.speaker_pins[0] = 0x14; 13857 spec->autocfg.speaker_pins[0] = 0x14;
13687 spec->ext_mic.pin = 0x18; 13858 spec->ext_mic.pin = 0x18;
13688 spec->ext_mic.mux_idx = 0; 13859 spec->ext_mic.mux_idx = 0;
@@ -13691,6 +13862,18 @@ static void alc269_laptop_amic_setup(struct hda_codec *codec)
13691 spec->auto_mic = 1; 13862 spec->auto_mic = 1;
13692} 13863}
13693 13864
13865static void alc269vb_laptop_dmic_setup(struct hda_codec *codec)
13866{
13867 struct alc_spec *spec = codec->spec;
13868 spec->autocfg.hp_pins[0] = 0x21;
13869 spec->autocfg.speaker_pins[0] = 0x14;
13870 spec->ext_mic.pin = 0x18;
13871 spec->ext_mic.mux_idx = 0;
13872 spec->int_mic.pin = 0x12;
13873 spec->int_mic.mux_idx = 6;
13874 spec->auto_mic = 1;
13875}
13876
13694static void alc269_laptop_inithook(struct hda_codec *codec) 13877static void alc269_laptop_inithook(struct hda_codec *codec)
13695{ 13878{
13696 alc269_speaker_automute(codec); 13879 alc269_speaker_automute(codec);
@@ -13830,7 +14013,6 @@ static int alc269_parse_auto_config(struct hda_codec *codec)
13830 struct alc_spec *spec = codec->spec; 14013 struct alc_spec *spec = codec->spec;
13831 int err; 14014 int err;
13832 static hda_nid_t alc269_ignore[] = { 0x1d, 0 }; 14015 static hda_nid_t alc269_ignore[] = { 0x1d, 0 };
13833 hda_nid_t real_capsrc_nids;
13834 14016
13835 err = snd_hda_parse_pin_def_config(codec, &spec->autocfg, 14017 err = snd_hda_parse_pin_def_config(codec, &spec->autocfg,
13836 alc269_ignore); 14018 alc269_ignore);
@@ -13854,18 +14036,19 @@ static int alc269_parse_auto_config(struct hda_codec *codec)
13854 14036
13855 if ((alc_read_coef_idx(codec, 0) & 0x00f0) == 0x0010) { 14037 if ((alc_read_coef_idx(codec, 0) & 0x00f0) == 0x0010) {
13856 add_verb(spec, alc269vb_init_verbs); 14038 add_verb(spec, alc269vb_init_verbs);
13857 real_capsrc_nids = alc269vb_capsrc_nids[0];
13858 alc_ssid_check(codec, 0, 0x1b, 0x14, 0x21); 14039 alc_ssid_check(codec, 0, 0x1b, 0x14, 0x21);
13859 } else { 14040 } else {
13860 add_verb(spec, alc269_init_verbs); 14041 add_verb(spec, alc269_init_verbs);
13861 real_capsrc_nids = alc269_capsrc_nids[0];
13862 alc_ssid_check(codec, 0x15, 0x1b, 0x14, 0); 14042 alc_ssid_check(codec, 0x15, 0x1b, 0x14, 0);
13863 } 14043 }
13864 14044
13865 spec->num_mux_defs = 1; 14045 spec->num_mux_defs = 1;
13866 spec->input_mux = &spec->private_imux[0]; 14046 spec->input_mux = &spec->private_imux[0];
14047 fillup_priv_adc_nids(codec, alc269_adc_candidates,
14048 sizeof(alc269_adc_candidates));
14049
13867 /* set default input source */ 14050 /* set default input source */
13868 snd_hda_codec_write_cache(codec, real_capsrc_nids, 14051 snd_hda_codec_write_cache(codec, spec->capsrc_nids[0],
13869 0, AC_VERB_SET_CONNECT_SEL, 14052 0, AC_VERB_SET_CONNECT_SEL,
13870 spec->input_mux->items[0].index); 14053 spec->input_mux->items[0].index);
13871 14054
@@ -13895,6 +14078,27 @@ static void alc269_auto_init(struct hda_codec *codec)
13895 alc_inithook(codec); 14078 alc_inithook(codec);
13896} 14079}
13897 14080
14081enum {
14082 ALC269_FIXUP_SONY_VAIO,
14083};
14084
14085const static struct hda_verb alc269_sony_vaio_fixup_verbs[] = {
14086 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREFGRD},
14087 {}
14088};
14089
14090static const struct alc_fixup alc269_fixups[] = {
14091 [ALC269_FIXUP_SONY_VAIO] = {
14092 .verbs = alc269_sony_vaio_fixup_verbs
14093 },
14094};
14095
14096static struct snd_pci_quirk alc269_fixup_tbl[] = {
14097 SND_PCI_QUIRK(0x104d, 0x9071, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
14098 {}
14099};
14100
14101
13898/* 14102/*
13899 * configuration and preset 14103 * configuration and preset
13900 */ 14104 */
@@ -13954,7 +14158,7 @@ static struct snd_pci_quirk alc269_cfg_tbl[] = {
13954 ALC269_DMIC), 14158 ALC269_DMIC),
13955 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005HA", ALC269_DMIC), 14159 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005HA", ALC269_DMIC),
13956 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005HA", ALC269_DMIC), 14160 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005HA", ALC269_DMIC),
13957 SND_PCI_QUIRK(0x104d, 0x9071, "SONY XTB", ALC269_DMIC), 14161 SND_PCI_QUIRK(0x104d, 0x9071, "Sony VAIO", ALC269_AUTO),
13958 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook ICH9M-based", ALC269_LIFEBOOK), 14162 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook ICH9M-based", ALC269_LIFEBOOK),
13959 SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_DMIC), 14163 SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_DMIC),
13960 SND_PCI_QUIRK(0x1734, 0x115d, "FSC Amilo", ALC269_FUJITSU), 14164 SND_PCI_QUIRK(0x1734, 0x115d, "FSC Amilo", ALC269_FUJITSU),
@@ -14028,7 +14232,7 @@ static struct alc_config_preset alc269_presets[] = {
14028 .num_channel_mode = ARRAY_SIZE(alc269_modes), 14232 .num_channel_mode = ARRAY_SIZE(alc269_modes),
14029 .channel_mode = alc269_modes, 14233 .channel_mode = alc269_modes,
14030 .unsol_event = alc269_laptop_unsol_event, 14234 .unsol_event = alc269_laptop_unsol_event,
14031 .setup = alc269_laptop_amic_setup, 14235 .setup = alc269vb_laptop_amic_setup,
14032 .init_hook = alc269_laptop_inithook, 14236 .init_hook = alc269_laptop_inithook,
14033 }, 14237 },
14034 [ALC269VB_DMIC] = { 14238 [ALC269VB_DMIC] = {
@@ -14108,6 +14312,9 @@ static int patch_alc269(struct hda_codec *codec)
14108 board_config = ALC269_AUTO; 14312 board_config = ALC269_AUTO;
14109 } 14313 }
14110 14314
14315 if (board_config == ALC269_AUTO)
14316 alc_pick_fixup(codec, alc269_fixup_tbl, alc269_fixups, 1);
14317
14111 if (board_config == ALC269_AUTO) { 14318 if (board_config == ALC269_AUTO) {
14112 /* automatic parse from the BIOS config */ 14319 /* automatic parse from the BIOS config */
14113 err = alc269_parse_auto_config(codec); 14320 err = alc269_parse_auto_config(codec);
@@ -14144,20 +14351,25 @@ static int patch_alc269(struct hda_codec *codec)
14144 spec->stream_digital_playback = &alc269_pcm_digital_playback; 14351 spec->stream_digital_playback = &alc269_pcm_digital_playback;
14145 spec->stream_digital_capture = &alc269_pcm_digital_capture; 14352 spec->stream_digital_capture = &alc269_pcm_digital_capture;
14146 14353
14147 if (!is_alc269vb) { 14354 if (!spec->adc_nids) { /* wasn't filled automatically? use default */
14148 spec->adc_nids = alc269_adc_nids; 14355 if (!is_alc269vb) {
14149 spec->num_adc_nids = ARRAY_SIZE(alc269_adc_nids); 14356 spec->adc_nids = alc269_adc_nids;
14150 spec->capsrc_nids = alc269_capsrc_nids; 14357 spec->num_adc_nids = ARRAY_SIZE(alc269_adc_nids);
14151 } else { 14358 spec->capsrc_nids = alc269_capsrc_nids;
14152 spec->adc_nids = alc269vb_adc_nids; 14359 } else {
14153 spec->num_adc_nids = ARRAY_SIZE(alc269vb_adc_nids); 14360 spec->adc_nids = alc269vb_adc_nids;
14154 spec->capsrc_nids = alc269vb_capsrc_nids; 14361 spec->num_adc_nids = ARRAY_SIZE(alc269vb_adc_nids);
14362 spec->capsrc_nids = alc269vb_capsrc_nids;
14363 }
14155 } 14364 }
14156 14365
14157 if (!spec->cap_mixer) 14366 if (!spec->cap_mixer)
14158 set_capture_mixer(codec); 14367 set_capture_mixer(codec);
14159 set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); 14368 set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
14160 14369
14370 if (board_config == ALC269_AUTO)
14371 alc_pick_fixup(codec, alc269_fixup_tbl, alc269_fixups, 0);
14372
14161 spec->vmaster_nid = 0x02; 14373 spec->vmaster_nid = 0x02;
14162 14374
14163 codec->patch_ops = alc_patch_ops; 14375 codec->patch_ops = alc_patch_ops;
@@ -15246,7 +15458,8 @@ static int patch_alc861(struct hda_codec *codec)
15246 board_config = ALC861_AUTO; 15458 board_config = ALC861_AUTO;
15247 } 15459 }
15248 15460
15249 alc_pick_fixup(codec, alc861_fixup_tbl, alc861_fixups); 15461 if (board_config == ALC861_AUTO)
15462 alc_pick_fixup(codec, alc861_fixup_tbl, alc861_fixups, 1);
15250 15463
15251 if (board_config == ALC861_AUTO) { 15464 if (board_config == ALC861_AUTO) {
15252 /* automatic parse from the BIOS config */ 15465 /* automatic parse from the BIOS config */
@@ -15283,6 +15496,9 @@ static int patch_alc861(struct hda_codec *codec)
15283 15496
15284 spec->vmaster_nid = 0x03; 15497 spec->vmaster_nid = 0x03;
15285 15498
15499 if (board_config == ALC861_AUTO)
15500 alc_pick_fixup(codec, alc861_fixup_tbl, alc861_fixups, 0);
15501
15286 codec->patch_ops = alc_patch_ops; 15502 codec->patch_ops = alc_patch_ops;
15287 if (board_config == ALC861_AUTO) { 15503 if (board_config == ALC861_AUTO) {
15288 spec->init_hook = alc861_auto_init; 15504 spec->init_hook = alc861_auto_init;
@@ -16217,7 +16433,8 @@ static int patch_alc861vd(struct hda_codec *codec)
16217 board_config = ALC861VD_AUTO; 16433 board_config = ALC861VD_AUTO;
16218 } 16434 }
16219 16435
16220 alc_pick_fixup(codec, alc861vd_fixup_tbl, alc861vd_fixups); 16436 if (board_config == ALC861VD_AUTO)
16437 alc_pick_fixup(codec, alc861vd_fixup_tbl, alc861vd_fixups, 1);
16221 16438
16222 if (board_config == ALC861VD_AUTO) { 16439 if (board_config == ALC861VD_AUTO) {
16223 /* automatic parse from the BIOS config */ 16440 /* automatic parse from the BIOS config */
@@ -16265,6 +16482,9 @@ static int patch_alc861vd(struct hda_codec *codec)
16265 16482
16266 spec->vmaster_nid = 0x02; 16483 spec->vmaster_nid = 0x02;
16267 16484
16485 if (board_config == ALC861VD_AUTO)
16486 alc_pick_fixup(codec, alc861vd_fixup_tbl, alc861vd_fixups, 0);
16487
16268 codec->patch_ops = alc_patch_ops; 16488 codec->patch_ops = alc_patch_ops;
16269 16489
16270 if (board_config == ALC861VD_AUTO) 16490 if (board_config == ALC861VD_AUTO)
@@ -17103,9 +17323,9 @@ static void alc663_m51va_speaker_automute(struct hda_codec *codec)
17103 present = snd_hda_jack_detect(codec, 0x21); 17323 present = snd_hda_jack_detect(codec, 0x21);
17104 bits = present ? HDA_AMP_MUTE : 0; 17324 bits = present ? HDA_AMP_MUTE : 0;
17105 snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 0, 17325 snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 0,
17106 AMP_IN_MUTE(0), bits); 17326 HDA_AMP_MUTE, bits);
17107 snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 1, 17327 snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 1,
17108 AMP_IN_MUTE(0), bits); 17328 HDA_AMP_MUTE, bits);
17109} 17329}
17110 17330
17111static void alc663_21jd_two_speaker_automute(struct hda_codec *codec) 17331static void alc663_21jd_two_speaker_automute(struct hda_codec *codec)
@@ -17116,13 +17336,13 @@ static void alc663_21jd_two_speaker_automute(struct hda_codec *codec)
17116 present = snd_hda_jack_detect(codec, 0x21); 17336 present = snd_hda_jack_detect(codec, 0x21);
17117 bits = present ? HDA_AMP_MUTE : 0; 17337 bits = present ? HDA_AMP_MUTE : 0;
17118 snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 0, 17338 snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 0,
17119 AMP_IN_MUTE(0), bits); 17339 HDA_AMP_MUTE, bits);
17120 snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 1, 17340 snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 1,
17121 AMP_IN_MUTE(0), bits); 17341 HDA_AMP_MUTE, bits);
17122 snd_hda_codec_amp_stereo(codec, 0x0e, HDA_INPUT, 0, 17342 snd_hda_codec_amp_stereo(codec, 0x0e, HDA_INPUT, 0,
17123 AMP_IN_MUTE(0), bits); 17343 HDA_AMP_MUTE, bits);
17124 snd_hda_codec_amp_stereo(codec, 0x0e, HDA_INPUT, 1, 17344 snd_hda_codec_amp_stereo(codec, 0x0e, HDA_INPUT, 1,
17125 AMP_IN_MUTE(0), bits); 17345 HDA_AMP_MUTE, bits);
17126} 17346}
17127 17347
17128static void alc663_15jd_two_speaker_automute(struct hda_codec *codec) 17348static void alc663_15jd_two_speaker_automute(struct hda_codec *codec)
@@ -17133,13 +17353,13 @@ static void alc663_15jd_two_speaker_automute(struct hda_codec *codec)
17133 present = snd_hda_jack_detect(codec, 0x15); 17353 present = snd_hda_jack_detect(codec, 0x15);
17134 bits = present ? HDA_AMP_MUTE : 0; 17354 bits = present ? HDA_AMP_MUTE : 0;
17135 snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 0, 17355 snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 0,
17136 AMP_IN_MUTE(0), bits); 17356 HDA_AMP_MUTE, bits);
17137 snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 1, 17357 snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 1,
17138 AMP_IN_MUTE(0), bits); 17358 HDA_AMP_MUTE, bits);
17139 snd_hda_codec_amp_stereo(codec, 0x0e, HDA_INPUT, 0, 17359 snd_hda_codec_amp_stereo(codec, 0x0e, HDA_INPUT, 0,
17140 AMP_IN_MUTE(0), bits); 17360 HDA_AMP_MUTE, bits);
17141 snd_hda_codec_amp_stereo(codec, 0x0e, HDA_INPUT, 1, 17361 snd_hda_codec_amp_stereo(codec, 0x0e, HDA_INPUT, 1,
17142 AMP_IN_MUTE(0), bits); 17362 HDA_AMP_MUTE, bits);
17143} 17363}
17144 17364
17145static void alc662_f5z_speaker_automute(struct hda_codec *codec) 17365static void alc662_f5z_speaker_automute(struct hda_codec *codec)
@@ -17178,14 +17398,14 @@ static void alc663_two_hp_m2_speaker_automute(struct hda_codec *codec)
17178 17398
17179 if (present1 || present2) { 17399 if (present1 || present2) {
17180 snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 0, 17400 snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 0,
17181 AMP_IN_MUTE(0), AMP_IN_MUTE(0)); 17401 HDA_AMP_MUTE, HDA_AMP_MUTE);
17182 snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 1, 17402 snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 1,
17183 AMP_IN_MUTE(0), AMP_IN_MUTE(0)); 17403 HDA_AMP_MUTE, HDA_AMP_MUTE);
17184 } else { 17404 } else {
17185 snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 0, 17405 snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 0,
17186 AMP_IN_MUTE(0), 0); 17406 HDA_AMP_MUTE, 0);
17187 snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 1, 17407 snd_hda_codec_amp_stereo(codec, 0x0c, HDA_INPUT, 1,
17188 AMP_IN_MUTE(0), 0); 17408 HDA_AMP_MUTE, 0);
17189 } 17409 }
17190} 17410}
17191 17411
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 8c416bb18a5..c4be3fab94e 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -1730,6 +1730,8 @@ static struct snd_pci_quirk stac92hd71bxx_cfg_tbl[] = {
1730 "HP HDX", STAC_HP_HDX), /* HDX16 */ 1730 "HP HDX", STAC_HP_HDX), /* HDX16 */
1731 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x3620, 1731 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x3620,
1732 "HP dv6", STAC_HP_DV5), 1732 "HP dv6", STAC_HP_DV5),
1733 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3061,
1734 "HP dv6", STAC_HP_DV5), /* HP dv6-1110ax */
1733 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x7010, 1735 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x7010,
1734 "HP", STAC_HP_DV5), 1736 "HP", STAC_HP_DV5),
1735 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0233, 1737 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0233,
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c
index 9ddc37300f6..73453814e09 100644
--- a/sound/pci/hda/patch_via.c
+++ b/sound/pci/hda/patch_via.c
@@ -476,7 +476,7 @@ static struct snd_kcontrol_new *via_clone_control(struct via_spec *spec,
476 knew->name = kstrdup(tmpl->name, GFP_KERNEL); 476 knew->name = kstrdup(tmpl->name, GFP_KERNEL);
477 if (!knew->name) 477 if (!knew->name)
478 return NULL; 478 return NULL;
479 return 0; 479 return knew;
480} 480}
481 481
482static void via_free_kctls(struct hda_codec *codec) 482static void via_free_kctls(struct hda_codec *codec)
@@ -1215,14 +1215,13 @@ static struct snd_kcontrol_new via_hp_mixer[2] = {
1215 }, 1215 },
1216}; 1216};
1217 1217
1218static int via_hp_build(struct via_spec *spec) 1218static int via_hp_build(struct hda_codec *codec)
1219{ 1219{
1220 struct via_spec *spec = codec->spec;
1220 struct snd_kcontrol_new *knew; 1221 struct snd_kcontrol_new *knew;
1221 hda_nid_t nid; 1222 hda_nid_t nid;
1222 1223 int nums;
1223 knew = via_clone_control(spec, &via_hp_mixer[0]); 1224 hda_nid_t conn[HDA_MAX_CONNECTIONS];
1224 if (knew == NULL)
1225 return -ENOMEM;
1226 1225
1227 switch (spec->codec_type) { 1226 switch (spec->codec_type) {
1228 case VT1718S: 1227 case VT1718S:
@@ -1239,6 +1238,14 @@ static int via_hp_build(struct via_spec *spec)
1239 break; 1238 break;
1240 } 1239 }
1241 1240
1241 nums = snd_hda_get_connections(codec, nid, conn, HDA_MAX_CONNECTIONS);
1242 if (nums <= 1)
1243 return 0;
1244
1245 knew = via_clone_control(spec, &via_hp_mixer[0]);
1246 if (knew == NULL)
1247 return -ENOMEM;
1248
1242 knew->subdevice = HDA_SUBDEV_NID_FLAG | nid; 1249 knew->subdevice = HDA_SUBDEV_NID_FLAG | nid;
1243 knew->private_value = nid; 1250 knew->private_value = nid;
1244 1251
@@ -2561,7 +2568,7 @@ static int vt1708_parse_auto_config(struct hda_codec *codec)
2561 spec->input_mux = &spec->private_imux[0]; 2568 spec->input_mux = &spec->private_imux[0];
2562 2569
2563 if (spec->hp_mux) 2570 if (spec->hp_mux)
2564 via_hp_build(spec); 2571 via_hp_build(codec);
2565 2572
2566 via_smart51_build(spec); 2573 via_smart51_build(spec);
2567 return 1; 2574 return 1;
@@ -3087,7 +3094,7 @@ static int vt1709_parse_auto_config(struct hda_codec *codec)
3087 spec->input_mux = &spec->private_imux[0]; 3094 spec->input_mux = &spec->private_imux[0];
3088 3095
3089 if (spec->hp_mux) 3096 if (spec->hp_mux)
3090 via_hp_build(spec); 3097 via_hp_build(codec);
3091 3098
3092 via_smart51_build(spec); 3099 via_smart51_build(spec);
3093 return 1; 3100 return 1;
@@ -3654,7 +3661,7 @@ static int vt1708B_parse_auto_config(struct hda_codec *codec)
3654 spec->input_mux = &spec->private_imux[0]; 3661 spec->input_mux = &spec->private_imux[0];
3655 3662
3656 if (spec->hp_mux) 3663 if (spec->hp_mux)
3657 via_hp_build(spec); 3664 via_hp_build(codec);
3658 3665
3659 via_smart51_build(spec); 3666 via_smart51_build(spec);
3660 return 1; 3667 return 1;
@@ -4140,7 +4147,7 @@ static int vt1708S_parse_auto_config(struct hda_codec *codec)
4140 spec->input_mux = &spec->private_imux[0]; 4147 spec->input_mux = &spec->private_imux[0];
4141 4148
4142 if (spec->hp_mux) 4149 if (spec->hp_mux)
4143 via_hp_build(spec); 4150 via_hp_build(codec);
4144 4151
4145 via_smart51_build(spec); 4152 via_smart51_build(spec);
4146 return 1; 4153 return 1;
@@ -4510,7 +4517,7 @@ static int vt1702_parse_auto_config(struct hda_codec *codec)
4510 spec->input_mux = &spec->private_imux[0]; 4517 spec->input_mux = &spec->private_imux[0];
4511 4518
4512 if (spec->hp_mux) 4519 if (spec->hp_mux)
4513 via_hp_build(spec); 4520 via_hp_build(codec);
4514 4521
4515 return 1; 4522 return 1;
4516} 4523}
@@ -4930,7 +4937,7 @@ static int vt1718S_parse_auto_config(struct hda_codec *codec)
4930 spec->input_mux = &spec->private_imux[0]; 4937 spec->input_mux = &spec->private_imux[0];
4931 4938
4932 if (spec->hp_mux) 4939 if (spec->hp_mux)
4933 via_hp_build(spec); 4940 via_hp_build(codec);
4934 4941
4935 via_smart51_build(spec); 4942 via_smart51_build(spec);
4936 4943
@@ -5425,7 +5432,7 @@ static int vt1716S_parse_auto_config(struct hda_codec *codec)
5425 spec->input_mux = &spec->private_imux[0]; 5432 spec->input_mux = &spec->private_imux[0];
5426 5433
5427 if (spec->hp_mux) 5434 if (spec->hp_mux)
5428 via_hp_build(spec); 5435 via_hp_build(codec);
5429 5436
5430 via_smart51_build(spec); 5437 via_smart51_build(spec);
5431 5438
@@ -5781,7 +5788,7 @@ static int vt2002P_parse_auto_config(struct hda_codec *codec)
5781 spec->input_mux = &spec->private_imux[0]; 5788 spec->input_mux = &spec->private_imux[0];
5782 5789
5783 if (spec->hp_mux) 5790 if (spec->hp_mux)
5784 via_hp_build(spec); 5791 via_hp_build(codec);
5785 5792
5786 return 1; 5793 return 1;
5787} 5794}
@@ -6000,12 +6007,12 @@ static int vt1812_auto_create_multi_out_ctls(struct via_spec *spec,
6000 6007
6001 /* Line-Out: PortE */ 6008 /* Line-Out: PortE */
6002 err = via_add_control(spec, VIA_CTL_WIDGET_VOL, 6009 err = via_add_control(spec, VIA_CTL_WIDGET_VOL,
6003 "Master Front Playback Volume", 6010 "Front Playback Volume",
6004 HDA_COMPOSE_AMP_VAL(0x8, 3, 0, HDA_OUTPUT)); 6011 HDA_COMPOSE_AMP_VAL(0x8, 3, 0, HDA_OUTPUT));
6005 if (err < 0) 6012 if (err < 0)
6006 return err; 6013 return err;
6007 err = via_add_control(spec, VIA_CTL_WIDGET_BIND_PIN_MUTE, 6014 err = via_add_control(spec, VIA_CTL_WIDGET_BIND_PIN_MUTE,
6008 "Master Front Playback Switch", 6015 "Front Playback Switch",
6009 HDA_COMPOSE_AMP_VAL(0x28, 3, 0, HDA_OUTPUT)); 6016 HDA_COMPOSE_AMP_VAL(0x28, 3, 0, HDA_OUTPUT));
6010 if (err < 0) 6017 if (err < 0)
6011 return err; 6018 return err;
@@ -6130,7 +6137,7 @@ static int vt1812_parse_auto_config(struct hda_codec *codec)
6130 spec->input_mux = &spec->private_imux[0]; 6137 spec->input_mux = &spec->private_imux[0];
6131 6138
6132 if (spec->hp_mux) 6139 if (spec->hp_mux)
6133 via_hp_build(spec); 6140 via_hp_build(codec);
6134 6141
6135 return 1; 6142 return 1;
6136} 6143}
diff --git a/sound/pci/ice1712/ak4xxx.c b/sound/pci/ice1712/ak4xxx.c
index 03391da8c8c..90d560c3df1 100644
--- a/sound/pci/ice1712/ak4xxx.c
+++ b/sound/pci/ice1712/ak4xxx.c
@@ -24,6 +24,7 @@
24#include <asm/io.h> 24#include <asm/io.h>
25#include <linux/delay.h> 25#include <linux/delay.h>
26#include <linux/interrupt.h> 26#include <linux/interrupt.h>
27#include <linux/slab.h>
27#include <linux/init.h> 28#include <linux/init.h>
28#include <sound/core.h> 29#include <sound/core.h>
29#include <sound/initval.h> 30#include <sound/initval.h>
diff --git a/sound/pci/ice1712/amp.c b/sound/pci/ice1712/amp.c
index 6da21a2bcad..e328cfb7620 100644
--- a/sound/pci/ice1712/amp.c
+++ b/sound/pci/ice1712/amp.c
@@ -25,7 +25,6 @@
25#include <linux/delay.h> 25#include <linux/delay.h>
26#include <linux/interrupt.h> 26#include <linux/interrupt.h>
27#include <linux/init.h> 27#include <linux/init.h>
28#include <linux/slab.h>
29#include <sound/core.h> 28#include <sound/core.h>
30 29
31#include "ice1712.h" 30#include "ice1712.h"
diff --git a/sound/pci/ice1712/vt1720_mobo.c b/sound/pci/ice1712/vt1720_mobo.c
index 7f9674b641c..4c551e147c0 100644
--- a/sound/pci/ice1712/vt1720_mobo.c
+++ b/sound/pci/ice1712/vt1720_mobo.c
@@ -25,7 +25,6 @@
25#include <linux/delay.h> 25#include <linux/delay.h>
26#include <linux/interrupt.h> 26#include <linux/interrupt.h>
27#include <linux/init.h> 27#include <linux/init.h>
28#include <linux/slab.h>
29#include <sound/core.h> 28#include <sound/core.h>
30 29
31#include "ice1712.h" 30#include "ice1712.h"
diff --git a/sound/pci/ice1712/wtm.c b/sound/pci/ice1712/wtm.c
index 5af9e84456d..e618f789026 100644
--- a/sound/pci/ice1712/wtm.c
+++ b/sound/pci/ice1712/wtm.c
@@ -29,7 +29,6 @@
29#include <linux/delay.h> 29#include <linux/delay.h>
30#include <linux/interrupt.h> 30#include <linux/interrupt.h>
31#include <linux/init.h> 31#include <linux/init.h>
32#include <linux/slab.h>
33#include <sound/core.h> 32#include <sound/core.h>
34 33
35#include "ice1712.h" 34#include "ice1712.h"
diff --git a/sound/pci/lx6464es/lx6464es.c b/sound/pci/lx6464es/lx6464es.c
index 0cca56038cd..ef9af3f4ace 100644
--- a/sound/pci/lx6464es/lx6464es.c
+++ b/sound/pci/lx6464es/lx6464es.c
@@ -26,6 +26,7 @@
26#include <linux/init.h> 26#include <linux/init.h>
27#include <linux/pci.h> 27#include <linux/pci.h>
28#include <linux/delay.h> 28#include <linux/delay.h>
29#include <linux/slab.h>
29 30
30#include <sound/initval.h> 31#include <sound/initval.h>
31#include <sound/control.h> 32#include <sound/control.h>
diff --git a/sound/pci/mixart/mixart.c b/sound/pci/mixart/mixart.c
index 7e8e7da592a..3be8f97c8bc 100644
--- a/sound/pci/mixart/mixart.c
+++ b/sound/pci/mixart/mixart.c
@@ -27,6 +27,7 @@
27#include <linux/dma-mapping.h> 27#include <linux/dma-mapping.h>
28#include <linux/moduleparam.h> 28#include <linux/moduleparam.h>
29#include <linux/mutex.h> 29#include <linux/mutex.h>
30#include <linux/slab.h>
30 31
31#include <sound/core.h> 32#include <sound/core.h>
32#include <sound/initval.h> 33#include <sound/initval.h>
@@ -1161,13 +1162,15 @@ static long snd_mixart_BA0_read(struct snd_info_entry *entry, void *file_private
1161 unsigned long count, unsigned long pos) 1162 unsigned long count, unsigned long pos)
1162{ 1163{
1163 struct mixart_mgr *mgr = entry->private_data; 1164 struct mixart_mgr *mgr = entry->private_data;
1165 unsigned long maxsize;
1164 1166
1165 count = count & ~3; /* make sure the read size is a multiple of 4 bytes */ 1167 if (pos >= MIXART_BA0_SIZE)
1166 if(count <= 0)
1167 return 0; 1168 return 0;
1168 if(pos + count > MIXART_BA0_SIZE) 1169 maxsize = MIXART_BA0_SIZE - pos;
1169 count = (long)(MIXART_BA0_SIZE - pos); 1170 if (count > maxsize)
1170 if(copy_to_user_fromio(buf, MIXART_MEM( mgr, pos ), count)) 1171 count = maxsize;
1172 count = count & ~3; /* make sure the read size is a multiple of 4 bytes */
1173 if (copy_to_user_fromio(buf, MIXART_MEM(mgr, pos), count))
1171 return -EFAULT; 1174 return -EFAULT;
1172 return count; 1175 return count;
1173} 1176}
@@ -1180,13 +1183,15 @@ static long snd_mixart_BA1_read(struct snd_info_entry *entry, void *file_private
1180 unsigned long count, unsigned long pos) 1183 unsigned long count, unsigned long pos)
1181{ 1184{
1182 struct mixart_mgr *mgr = entry->private_data; 1185 struct mixart_mgr *mgr = entry->private_data;
1186 unsigned long maxsize;
1183 1187
1184 count = count & ~3; /* make sure the read size is a multiple of 4 bytes */ 1188 if (pos > MIXART_BA1_SIZE)
1185 if(count <= 0)
1186 return 0; 1189 return 0;
1187 if(pos + count > MIXART_BA1_SIZE) 1190 maxsize = MIXART_BA1_SIZE - pos;
1188 count = (long)(MIXART_BA1_SIZE - pos); 1191 if (count > maxsize)
1189 if(copy_to_user_fromio(buf, MIXART_REG( mgr, pos ), count)) 1192 count = maxsize;
1193 count = count & ~3; /* make sure the read size is a multiple of 4 bytes */
1194 if (copy_to_user_fromio(buf, MIXART_REG(mgr, pos), count))
1190 return -EFAULT; 1195 return -EFAULT;
1191 return count; 1196 return count;
1192} 1197}
diff --git a/sound/pci/mixart/mixart_hwdep.c b/sound/pci/mixart/mixart_hwdep.c
index 4cf4cd8c939..bf2696aa5d4 100644
--- a/sound/pci/mixart/mixart_hwdep.c
+++ b/sound/pci/mixart/mixart_hwdep.c
@@ -24,6 +24,7 @@
24#include <linux/pci.h> 24#include <linux/pci.h>
25#include <linux/firmware.h> 25#include <linux/firmware.h>
26#include <linux/vmalloc.h> 26#include <linux/vmalloc.h>
27#include <linux/slab.h>
27#include <asm/io.h> 28#include <asm/io.h>
28#include <sound/core.h> 29#include <sound/core.h>
29#include "mixart.h" 30#include "mixart.h"
diff --git a/sound/pci/oxygen/oxygen_lib.c b/sound/pci/oxygen/oxygen_lib.c
index 9c5e6450eeb..fad03d64e3a 100644
--- a/sound/pci/oxygen/oxygen_lib.c
+++ b/sound/pci/oxygen/oxygen_lib.c
@@ -21,6 +21,7 @@
21#include <linux/interrupt.h> 21#include <linux/interrupt.h>
22#include <linux/mutex.h> 22#include <linux/mutex.h>
23#include <linux/pci.h> 23#include <linux/pci.h>
24#include <linux/slab.h>
24#include <sound/ac97_codec.h> 25#include <sound/ac97_codec.h>
25#include <sound/asoundef.h> 26#include <sound/asoundef.h>
26#include <sound/core.h> 27#include <sound/core.h>
diff --git a/sound/pci/rme32.c b/sound/pci/rme32.c
index d5e1c6eb7b7..3c04524de37 100644
--- a/sound/pci/rme32.c
+++ b/sound/pci/rme32.c
@@ -70,10 +70,10 @@
70 70
71 71
72#include <linux/delay.h> 72#include <linux/delay.h>
73#include <linux/gfp.h>
73#include <linux/init.h> 74#include <linux/init.h>
74#include <linux/interrupt.h> 75#include <linux/interrupt.h>
75#include <linux/pci.h> 76#include <linux/pci.h>
76#include <linux/slab.h>
77#include <linux/moduleparam.h> 77#include <linux/moduleparam.h>
78 78
79#include <sound/core.h> 79#include <sound/core.h>
diff --git a/sound/pci/rme96.c b/sound/pci/rme96.c
index 9d5252bc870..d19dc052c39 100644
--- a/sound/pci/rme96.c
+++ b/sound/pci/rme96.c
@@ -27,7 +27,6 @@
27#include <linux/init.h> 27#include <linux/init.h>
28#include <linux/interrupt.h> 28#include <linux/interrupt.h>
29#include <linux/pci.h> 29#include <linux/pci.h>
30#include <linux/slab.h>
31#include <linux/moduleparam.h> 30#include <linux/moduleparam.h>
32 31
33#include <sound/core.h> 32#include <sound/core.h>
diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c
index 52c6eb57cc3..b92adef8e81 100644
--- a/sound/pci/rme9652/hdsp.c
+++ b/sound/pci/rme9652/hdsp.c
@@ -24,7 +24,6 @@
24#include <linux/init.h> 24#include <linux/init.h>
25#include <linux/delay.h> 25#include <linux/delay.h>
26#include <linux/interrupt.h> 26#include <linux/interrupt.h>
27#include <linux/slab.h>
28#include <linux/pci.h> 27#include <linux/pci.h>
29#include <linux/firmware.h> 28#include <linux/firmware.h>
30#include <linux/moduleparam.h> 29#include <linux/moduleparam.h>
diff --git a/sound/pci/rme9652/rme9652.c b/sound/pci/rme9652/rme9652.c
index 44a3e2d8c55..c492af5b25f 100644
--- a/sound/pci/rme9652/rme9652.c
+++ b/sound/pci/rme9652/rme9652.c
@@ -24,7 +24,6 @@
24#include <linux/init.h> 24#include <linux/init.h>
25#include <linux/interrupt.h> 25#include <linux/interrupt.h>
26#include <linux/pci.h> 26#include <linux/pci.h>
27#include <linux/slab.h>
28#include <linux/moduleparam.h> 27#include <linux/moduleparam.h>
29 28
30#include <sound/core.h> 29#include <sound/core.h>
diff --git a/sound/pci/sis7019.c b/sound/pci/sis7019.c
index 7e3e8fbc90f..9cc1b5aa014 100644
--- a/sound/pci/sis7019.c
+++ b/sound/pci/sis7019.c
@@ -24,6 +24,7 @@
24#include <linux/init.h> 24#include <linux/init.h>
25#include <linux/pci.h> 25#include <linux/pci.h>
26#include <linux/time.h> 26#include <linux/time.h>
27#include <linux/slab.h>
27#include <linux/moduleparam.h> 28#include <linux/moduleparam.h>
28#include <linux/interrupt.h> 29#include <linux/interrupt.h>
29#include <linux/delay.h> 30#include <linux/delay.h>