aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-08-15 20:06:56 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-15 20:06:56 -0400
commitffb29b42271c665cd652dfcaa590895c8a00ac97 (patch)
tree6d8edbf4447ef25f5b01600df4b7570134ecc588 /sound
parentd22af68bd785fa3cdd1fbf289e0e339f415ab383 (diff)
parent61074c1a2d798be90e149a9ed4ce0e3596c00a38 (diff)
Merge tag 'sound-fix-3.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "Here is the additional fix patches that have been queued up since the previous pull request. A few HD-audio fixes, a USB-audio quirk addition, and a couple of trivial cleanup for the legacy OSS codes" * tag 'sound-fix-3.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda - Set TLV_DB_SCALE_MUTE bit for cx5051 vmaster ALSA: hda/ca0132 - Don't try loading firmware at resume when already failed ALSA: hda - Fix pop noises on reboot for Dell XPS 13 9333 ALSA: hda - Set internal mic as default input source on Dell XPS 13 9333 ALSA: usb-audio: fix BOSS ME-25 MIDI regression ALSA: hda - Fix parsing of CMI8888 codec ALSA: hda - Fix probing and stuttering on CMI8888 HD-audio controller ALSA: hda/realtek - Fixed ALC286/ALC288 recording delay for Headset Mic sound: oss: Remove typedefs wanc_info and wavnc_port_info sound: oss: uart401: Remove typedef uart401_devc
Diffstat (limited to 'sound')
-rw-r--r--sound/oss/uart401.c40
-rw-r--r--sound/oss/waveartist.c157
-rw-r--r--sound/pci/hda/hda_intel.c7
-rw-r--r--sound/pci/hda/patch_ca0132.c7
-rw-r--r--sound/pci/hda/patch_cmedia.c47
-rw-r--r--sound/pci/hda/patch_conexant.c6
-rw-r--r--sound/pci/hda/patch_realtek.c35
-rw-r--r--sound/usb/quirks-table.h29
8 files changed, 239 insertions, 89 deletions
diff --git a/sound/oss/uart401.c b/sound/oss/uart401.c
index 62b8869f5a4c..279bc565ac7e 100644
--- a/sound/oss/uart401.c
+++ b/sound/oss/uart401.c
@@ -30,7 +30,7 @@
30 30
31#include "mpu401.h" 31#include "mpu401.h"
32 32
33typedef struct uart401_devc 33struct uart401_devc
34{ 34{
35 int base; 35 int base;
36 int irq; 36 int irq;
@@ -41,14 +41,13 @@ typedef struct uart401_devc
41 int my_dev; 41 int my_dev;
42 int share_irq; 42 int share_irq;
43 spinlock_t lock; 43 spinlock_t lock;
44} 44};
45uart401_devc;
46 45
47#define DATAPORT (devc->base) 46#define DATAPORT (devc->base)
48#define COMDPORT (devc->base+1) 47#define COMDPORT (devc->base+1)
49#define STATPORT (devc->base+1) 48#define STATPORT (devc->base+1)
50 49
51static int uart401_status(uart401_devc * devc) 50static int uart401_status(struct uart401_devc *devc)
52{ 51{
53 return inb(STATPORT); 52 return inb(STATPORT);
54} 53}
@@ -56,17 +55,17 @@ static int uart401_status(uart401_devc * devc)
56#define input_avail(devc) (!(uart401_status(devc)&INPUT_AVAIL)) 55#define input_avail(devc) (!(uart401_status(devc)&INPUT_AVAIL))
57#define output_ready(devc) (!(uart401_status(devc)&OUTPUT_READY)) 56#define output_ready(devc) (!(uart401_status(devc)&OUTPUT_READY))
58 57
59static void uart401_cmd(uart401_devc * devc, unsigned char cmd) 58static void uart401_cmd(struct uart401_devc *devc, unsigned char cmd)
60{ 59{
61 outb((cmd), COMDPORT); 60 outb((cmd), COMDPORT);
62} 61}
63 62
64static int uart401_read(uart401_devc * devc) 63static int uart401_read(struct uart401_devc *devc)
65{ 64{
66 return inb(DATAPORT); 65 return inb(DATAPORT);
67} 66}
68 67
69static void uart401_write(uart401_devc * devc, unsigned char byte) 68static void uart401_write(struct uart401_devc *devc, unsigned char byte)
70{ 69{
71 outb((byte), DATAPORT); 70 outb((byte), DATAPORT);
72} 71}
@@ -77,10 +76,10 @@ static void uart401_write(uart401_devc * devc, unsigned char byte)
77#define MPU_RESET 0xFF 76#define MPU_RESET 0xFF
78#define UART_MODE_ON 0x3F 77#define UART_MODE_ON 0x3F
79 78
80static int reset_uart401(uart401_devc * devc); 79static int reset_uart401(struct uart401_devc *devc);
81static void enter_uart_mode(uart401_devc * devc); 80static void enter_uart_mode(struct uart401_devc *devc);
82 81
83static void uart401_input_loop(uart401_devc * devc) 82static void uart401_input_loop(struct uart401_devc *devc)
84{ 83{
85 int work_limit=30000; 84 int work_limit=30000;
86 85
@@ -99,7 +98,7 @@ static void uart401_input_loop(uart401_devc * devc)
99 98
100irqreturn_t uart401intr(int irq, void *dev_id) 99irqreturn_t uart401intr(int irq, void *dev_id)
101{ 100{
102 uart401_devc *devc = dev_id; 101 struct uart401_devc *devc = dev_id;
103 102
104 if (devc == NULL) 103 if (devc == NULL)
105 { 104 {
@@ -118,7 +117,8 @@ uart401_open(int dev, int mode,
118 void (*output) (int dev) 117 void (*output) (int dev)
119) 118)
120{ 119{
121 uart401_devc *devc = (uart401_devc *) midi_devs[dev]->devc; 120 struct uart401_devc *devc = (struct uart401_devc *)
121 midi_devs[dev]->devc;
122 122
123 if (devc->opened) 123 if (devc->opened)
124 return -EBUSY; 124 return -EBUSY;
@@ -138,7 +138,8 @@ uart401_open(int dev, int mode,
138 138
139static void uart401_close(int dev) 139static void uart401_close(int dev)
140{ 140{
141 uart401_devc *devc = (uart401_devc *) midi_devs[dev]->devc; 141 struct uart401_devc *devc = (struct uart401_devc *)
142 midi_devs[dev]->devc;
142 143
143 reset_uart401(devc); 144 reset_uart401(devc);
144 devc->opened = 0; 145 devc->opened = 0;
@@ -148,7 +149,8 @@ static int uart401_out(int dev, unsigned char midi_byte)
148{ 149{
149 int timeout; 150 int timeout;
150 unsigned long flags; 151 unsigned long flags;
151 uart401_devc *devc = (uart401_devc *) midi_devs[dev]->devc; 152 struct uart401_devc *devc = (struct uart401_devc *)
153 midi_devs[dev]->devc;
152 154
153 if (devc->disabled) 155 if (devc->disabled)
154 return 1; 156 return 1;
@@ -219,7 +221,7 @@ static const struct midi_operations uart401_operations =
219 .buffer_status = uart401_buffer_status, 221 .buffer_status = uart401_buffer_status,
220}; 222};
221 223
222static void enter_uart_mode(uart401_devc * devc) 224static void enter_uart_mode(struct uart401_devc *devc)
223{ 225{
224 int ok, timeout; 226 int ok, timeout;
225 unsigned long flags; 227 unsigned long flags;
@@ -241,7 +243,7 @@ static void enter_uart_mode(uart401_devc * devc)
241 spin_unlock_irqrestore(&devc->lock,flags); 243 spin_unlock_irqrestore(&devc->lock,flags);
242} 244}
243 245
244static int reset_uart401(uart401_devc * devc) 246static int reset_uart401(struct uart401_devc *devc)
245{ 247{
246 int ok, timeout, n; 248 int ok, timeout, n;
247 249
@@ -285,7 +287,7 @@ static int reset_uart401(uart401_devc * devc)
285 287
286int probe_uart401(struct address_info *hw_config, struct module *owner) 288int probe_uart401(struct address_info *hw_config, struct module *owner)
287{ 289{
288 uart401_devc *devc; 290 struct uart401_devc *devc;
289 char *name = "MPU-401 (UART) MIDI"; 291 char *name = "MPU-401 (UART) MIDI";
290 int ok = 0; 292 int ok = 0;
291 unsigned long flags; 293 unsigned long flags;
@@ -300,7 +302,7 @@ int probe_uart401(struct address_info *hw_config, struct module *owner)
300 return 0; 302 return 0;
301 } 303 }
302 304
303 devc = kmalloc(sizeof(uart401_devc), GFP_KERNEL); 305 devc = kmalloc(sizeof(struct uart401_devc), GFP_KERNEL);
304 if (!devc) { 306 if (!devc) {
305 printk(KERN_WARNING "uart401: Can't allocate memory\n"); 307 printk(KERN_WARNING "uart401: Can't allocate memory\n");
306 goto cleanup_region; 308 goto cleanup_region;
@@ -392,7 +394,7 @@ cleanup_region:
392 394
393void unload_uart401(struct address_info *hw_config) 395void unload_uart401(struct address_info *hw_config)
394{ 396{
395 uart401_devc *devc; 397 struct uart401_devc *devc;
396 int n=hw_config->slots[4]; 398 int n=hw_config->slots[4];
397 399
398 /* Not set up */ 400 /* Not set up */
diff --git a/sound/oss/waveartist.c b/sound/oss/waveartist.c
index 672af8b56542..b36ea47527e8 100644
--- a/sound/oss/waveartist.c
+++ b/sound/oss/waveartist.c
@@ -92,7 +92,7 @@ static unsigned short levels[SOUND_MIXER_NRDEVICES] = {
92 0x0000 /* Monitor */ 92 0x0000 /* Monitor */
93}; 93};
94 94
95typedef struct { 95struct wavnc_info {
96 struct address_info hw; /* hardware */ 96 struct address_info hw; /* hardware */
97 char *chip_name; 97 char *chip_name;
98 98
@@ -119,7 +119,7 @@ typedef struct {
119 unsigned int line_mute_state :1;/* set by ioctl or autoselect */ 119 unsigned int line_mute_state :1;/* set by ioctl or autoselect */
120 unsigned int use_slider :1;/* use slider setting for o/p vol */ 120 unsigned int use_slider :1;/* use slider setting for o/p vol */
121#endif 121#endif
122} wavnc_info; 122};
123 123
124/* 124/*
125 * This is the implementation specific mixer information. 125 * This is the implementation specific mixer information.
@@ -129,29 +129,30 @@ struct waveartist_mixer_info {
129 unsigned int recording_devs; /* Recordable devies */ 129 unsigned int recording_devs; /* Recordable devies */
130 unsigned int stereo_devs; /* Stereo devices */ 130 unsigned int stereo_devs; /* Stereo devices */
131 131
132 unsigned int (*select_input)(wavnc_info *, unsigned int, 132 unsigned int (*select_input)(struct wavnc_info *, unsigned int,
133 unsigned char *, unsigned char *); 133 unsigned char *, unsigned char *);
134 int (*decode_mixer)(wavnc_info *, int, 134 int (*decode_mixer)(struct wavnc_info *, int,
135 unsigned char, unsigned char); 135 unsigned char, unsigned char);
136 int (*get_mixer)(wavnc_info *, int); 136 int (*get_mixer)(struct wavnc_info *, int);
137}; 137};
138 138
139typedef struct wavnc_port_info { 139struct wavnc_port_info {
140 int open_mode; 140 int open_mode;
141 int speed; 141 int speed;
142 int channels; 142 int channels;
143 int audio_format; 143 int audio_format;
144} wavnc_port_info; 144};
145 145
146static int nr_waveartist_devs; 146static int nr_waveartist_devs;
147static wavnc_info adev_info[MAX_AUDIO_DEV]; 147static struct wavnc_info adev_info[MAX_AUDIO_DEV];
148static DEFINE_SPINLOCK(waveartist_lock); 148static DEFINE_SPINLOCK(waveartist_lock);
149 149
150#ifndef CONFIG_ARCH_NETWINDER 150#ifndef CONFIG_ARCH_NETWINDER
151#define machine_is_netwinder() 0 151#define machine_is_netwinder() 0
152#else 152#else
153static struct timer_list vnc_timer; 153static struct timer_list vnc_timer;
154static void vnc_configure_mixer(wavnc_info *devc, unsigned int input_mask); 154static void vnc_configure_mixer(struct wavnc_info *devc,
155 unsigned int input_mask);
155static int vnc_private_ioctl(int dev, unsigned int cmd, int __user *arg); 156static int vnc_private_ioctl(int dev, unsigned int cmd, int __user *arg);
156static void vnc_slider_tick(unsigned long data); 157static void vnc_slider_tick(unsigned long data);
157#endif 158#endif
@@ -169,7 +170,7 @@ waveartist_set_ctlr(struct address_info *hw, unsigned char clear, unsigned char
169/* Toggle IRQ acknowledge line 170/* Toggle IRQ acknowledge line
170 */ 171 */
171static inline void 172static inline void
172waveartist_iack(wavnc_info *devc) 173waveartist_iack(struct wavnc_info *devc)
173{ 174{
174 unsigned int ctlr_port = devc->hw.io_base + CTLR; 175 unsigned int ctlr_port = devc->hw.io_base + CTLR;
175 int old_ctlr; 176 int old_ctlr;
@@ -188,7 +189,7 @@ waveartist_sleep(int timeout_ms)
188} 189}
189 190
190static int 191static int
191waveartist_reset(wavnc_info *devc) 192waveartist_reset(struct wavnc_info *devc)
192{ 193{
193 struct address_info *hw = &devc->hw; 194 struct address_info *hw = &devc->hw;
194 unsigned int timeout, res = -1; 195 unsigned int timeout, res = -1;
@@ -223,7 +224,7 @@ waveartist_reset(wavnc_info *devc)
223 * and can send or receive multiple words. 224 * and can send or receive multiple words.
224 */ 225 */
225static int 226static int
226waveartist_cmd(wavnc_info *devc, 227waveartist_cmd(struct wavnc_info *devc,
227 int nr_cmd, unsigned int *cmd, 228 int nr_cmd, unsigned int *cmd,
228 int nr_resp, unsigned int *resp) 229 int nr_resp, unsigned int *resp)
229{ 230{
@@ -299,7 +300,7 @@ waveartist_cmd(wavnc_info *devc,
299 * Send one command word 300 * Send one command word
300 */ 301 */
301static inline int 302static inline int
302waveartist_cmd1(wavnc_info *devc, unsigned int cmd) 303waveartist_cmd1(struct wavnc_info *devc, unsigned int cmd)
303{ 304{
304 return waveartist_cmd(devc, 1, &cmd, 0, NULL); 305 return waveartist_cmd(devc, 1, &cmd, 0, NULL);
305} 306}
@@ -308,7 +309,7 @@ waveartist_cmd1(wavnc_info *devc, unsigned int cmd)
308 * Send one command, receive one word 309 * Send one command, receive one word
309 */ 310 */
310static inline unsigned int 311static inline unsigned int
311waveartist_cmd1_r(wavnc_info *devc, unsigned int cmd) 312waveartist_cmd1_r(struct wavnc_info *devc, unsigned int cmd)
312{ 313{
313 unsigned int ret; 314 unsigned int ret;
314 315
@@ -322,7 +323,7 @@ waveartist_cmd1_r(wavnc_info *devc, unsigned int cmd)
322 * word (and throw it away) 323 * word (and throw it away)
323 */ 324 */
324static inline int 325static inline int
325waveartist_cmd2(wavnc_info *devc, unsigned int cmd, unsigned int arg) 326waveartist_cmd2(struct wavnc_info *devc, unsigned int cmd, unsigned int arg)
326{ 327{
327 unsigned int vals[2]; 328 unsigned int vals[2];
328 329
@@ -336,7 +337,7 @@ waveartist_cmd2(wavnc_info *devc, unsigned int cmd, unsigned int arg)
336 * Send a triple command 337 * Send a triple command
337 */ 338 */
338static inline int 339static inline int
339waveartist_cmd3(wavnc_info *devc, unsigned int cmd, 340waveartist_cmd3(struct wavnc_info *devc, unsigned int cmd,
340 unsigned int arg1, unsigned int arg2) 341 unsigned int arg1, unsigned int arg2)
341{ 342{
342 unsigned int vals[3]; 343 unsigned int vals[3];
@@ -349,7 +350,7 @@ waveartist_cmd3(wavnc_info *devc, unsigned int cmd,
349} 350}
350 351
351static int 352static int
352waveartist_getrev(wavnc_info *devc, char *rev) 353waveartist_getrev(struct wavnc_info *devc, char *rev)
353{ 354{
354 unsigned int temp[2]; 355 unsigned int temp[2];
355 unsigned int cmd = WACMD_GETREV; 356 unsigned int cmd = WACMD_GETREV;
@@ -371,15 +372,15 @@ static void waveartist_trigger(int dev, int state);
371static int 372static int
372waveartist_open(int dev, int mode) 373waveartist_open(int dev, int mode)
373{ 374{
374 wavnc_info *devc; 375 struct wavnc_info *devc;
375 wavnc_port_info *portc; 376 struct wavnc_port_info *portc;
376 unsigned long flags; 377 unsigned long flags;
377 378
378 if (dev < 0 || dev >= num_audiodevs) 379 if (dev < 0 || dev >= num_audiodevs)
379 return -ENXIO; 380 return -ENXIO;
380 381
381 devc = (wavnc_info *) audio_devs[dev]->devc; 382 devc = (struct wavnc_info *) audio_devs[dev]->devc;
382 portc = (wavnc_port_info *) audio_devs[dev]->portc; 383 portc = (struct wavnc_port_info *) audio_devs[dev]->portc;
383 384
384 spin_lock_irqsave(&waveartist_lock, flags); 385 spin_lock_irqsave(&waveartist_lock, flags);
385 if (portc->open_mode || (devc->open_mode & mode)) { 386 if (portc->open_mode || (devc->open_mode & mode)) {
@@ -404,8 +405,10 @@ waveartist_open(int dev, int mode)
404static void 405static void
405waveartist_close(int dev) 406waveartist_close(int dev)
406{ 407{
407 wavnc_info *devc = (wavnc_info *) audio_devs[dev]->devc; 408 struct wavnc_info *devc = (struct wavnc_info *)
408 wavnc_port_info *portc = (wavnc_port_info *) audio_devs[dev]->portc; 409 audio_devs[dev]->devc;
410 struct wavnc_port_info *portc = (struct wavnc_port_info *)
411 audio_devs[dev]->portc;
409 unsigned long flags; 412 unsigned long flags;
410 413
411 spin_lock_irqsave(&waveartist_lock, flags); 414 spin_lock_irqsave(&waveartist_lock, flags);
@@ -422,8 +425,10 @@ waveartist_close(int dev)
422static void 425static void
423waveartist_output_block(int dev, unsigned long buf, int __count, int intrflag) 426waveartist_output_block(int dev, unsigned long buf, int __count, int intrflag)
424{ 427{
425 wavnc_port_info *portc = (wavnc_port_info *) audio_devs[dev]->portc; 428 struct wavnc_port_info *portc = (struct wavnc_port_info *)
426 wavnc_info *devc = (wavnc_info *) audio_devs[dev]->devc; 429 audio_devs[dev]->portc;
430 struct wavnc_info *devc = (struct wavnc_info *)
431 audio_devs[dev]->devc;
427 unsigned long flags; 432 unsigned long flags;
428 unsigned int count = __count; 433 unsigned int count = __count;
429 434
@@ -467,8 +472,10 @@ waveartist_output_block(int dev, unsigned long buf, int __count, int intrflag)
467static void 472static void
468waveartist_start_input(int dev, unsigned long buf, int __count, int intrflag) 473waveartist_start_input(int dev, unsigned long buf, int __count, int intrflag)
469{ 474{
470 wavnc_port_info *portc = (wavnc_port_info *) audio_devs[dev]->portc; 475 struct wavnc_port_info *portc = (struct wavnc_port_info *)
471 wavnc_info *devc = (wavnc_info *) audio_devs[dev]->devc; 476 audio_devs[dev]->portc;
477 struct wavnc_info *devc = (struct wavnc_info *)
478 audio_devs[dev]->devc;
472 unsigned long flags; 479 unsigned long flags;
473 unsigned int count = __count; 480 unsigned int count = __count;
474 481
@@ -514,7 +521,7 @@ waveartist_ioctl(int dev, unsigned int cmd, void __user * arg)
514} 521}
515 522
516static unsigned int 523static unsigned int
517waveartist_get_speed(wavnc_port_info *portc) 524waveartist_get_speed(struct wavnc_port_info *portc)
518{ 525{
519 unsigned int speed; 526 unsigned int speed;
520 527
@@ -542,7 +549,7 @@ waveartist_get_speed(wavnc_port_info *portc)
542} 549}
543 550
544static unsigned int 551static unsigned int
545waveartist_get_bits(wavnc_port_info *portc) 552waveartist_get_bits(struct wavnc_port_info *portc)
546{ 553{
547 unsigned int bits; 554 unsigned int bits;
548 555
@@ -560,8 +567,10 @@ static int
560waveartist_prepare_for_input(int dev, int bsize, int bcount) 567waveartist_prepare_for_input(int dev, int bsize, int bcount)
561{ 568{
562 unsigned long flags; 569 unsigned long flags;
563 wavnc_info *devc = (wavnc_info *) audio_devs[dev]->devc; 570 struct wavnc_info *devc = (struct wavnc_info *)
564 wavnc_port_info *portc = (wavnc_port_info *) audio_devs[dev]->portc; 571 audio_devs[dev]->devc;
572 struct wavnc_port_info *portc = (struct wavnc_port_info *)
573 audio_devs[dev]->portc;
565 unsigned int speed, bits; 574 unsigned int speed, bits;
566 575
567 if (devc->audio_mode) 576 if (devc->audio_mode)
@@ -615,8 +624,10 @@ static int
615waveartist_prepare_for_output(int dev, int bsize, int bcount) 624waveartist_prepare_for_output(int dev, int bsize, int bcount)
616{ 625{
617 unsigned long flags; 626 unsigned long flags;
618 wavnc_info *devc = (wavnc_info *) audio_devs[dev]->devc; 627 struct wavnc_info *devc = (struct wavnc_info *)
619 wavnc_port_info *portc = (wavnc_port_info *) audio_devs[dev]->portc; 628 audio_devs[dev]->devc;
629 struct wavnc_port_info *portc = (struct wavnc_port_info *)
630 audio_devs[dev]->portc;
620 unsigned int speed, bits; 631 unsigned int speed, bits;
621 632
622 /* 633 /*
@@ -660,8 +671,9 @@ waveartist_prepare_for_output(int dev, int bsize, int bcount)
660static void 671static void
661waveartist_halt(int dev) 672waveartist_halt(int dev)
662{ 673{
663 wavnc_port_info *portc = (wavnc_port_info *) audio_devs[dev]->portc; 674 struct wavnc_port_info *portc = (struct wavnc_port_info *)
664 wavnc_info *devc; 675 audio_devs[dev]->portc;
676 struct wavnc_info *devc;
665 677
666 if (portc->open_mode & OPEN_WRITE) 678 if (portc->open_mode & OPEN_WRITE)
667 waveartist_halt_output(dev); 679 waveartist_halt_output(dev);
@@ -669,14 +681,15 @@ waveartist_halt(int dev)
669 if (portc->open_mode & OPEN_READ) 681 if (portc->open_mode & OPEN_READ)
670 waveartist_halt_input(dev); 682 waveartist_halt_input(dev);
671 683
672 devc = (wavnc_info *) audio_devs[dev]->devc; 684 devc = (struct wavnc_info *) audio_devs[dev]->devc;
673 devc->audio_mode = 0; 685 devc->audio_mode = 0;
674} 686}
675 687
676static void 688static void
677waveartist_halt_input(int dev) 689waveartist_halt_input(int dev)
678{ 690{
679 wavnc_info *devc = (wavnc_info *) audio_devs[dev]->devc; 691 struct wavnc_info *devc = (struct wavnc_info *)
692 audio_devs[dev]->devc;
680 unsigned long flags; 693 unsigned long flags;
681 694
682 spin_lock_irqsave(&waveartist_lock, flags); 695 spin_lock_irqsave(&waveartist_lock, flags);
@@ -703,7 +716,8 @@ waveartist_halt_input(int dev)
703static void 716static void
704waveartist_halt_output(int dev) 717waveartist_halt_output(int dev)
705{ 718{
706 wavnc_info *devc = (wavnc_info *) audio_devs[dev]->devc; 719 struct wavnc_info *devc = (struct wavnc_info *)
720 audio_devs[dev]->devc;
707 unsigned long flags; 721 unsigned long flags;
708 722
709 spin_lock_irqsave(&waveartist_lock, flags); 723 spin_lock_irqsave(&waveartist_lock, flags);
@@ -727,8 +741,10 @@ waveartist_halt_output(int dev)
727static void 741static void
728waveartist_trigger(int dev, int state) 742waveartist_trigger(int dev, int state)
729{ 743{
730 wavnc_info *devc = (wavnc_info *) audio_devs[dev]->devc; 744 struct wavnc_info *devc = (struct wavnc_info *)
731 wavnc_port_info *portc = (wavnc_port_info *) audio_devs[dev]->portc; 745 audio_devs[dev]->devc;
746 struct wavnc_port_info *portc = (struct wavnc_port_info *)
747 audio_devs[dev]->portc;
732 unsigned long flags; 748 unsigned long flags;
733 749
734 if (debug_flg & DEBUG_TRIGGER) { 750 if (debug_flg & DEBUG_TRIGGER) {
@@ -764,7 +780,8 @@ waveartist_trigger(int dev, int state)
764static int 780static int
765waveartist_set_speed(int dev, int arg) 781waveartist_set_speed(int dev, int arg)
766{ 782{
767 wavnc_port_info *portc = (wavnc_port_info *) audio_devs[dev]->portc; 783 struct wavnc_port_info *portc = (struct wavnc_port_info *)
784 audio_devs[dev]->portc;
768 785
769 if (arg <= 0) 786 if (arg <= 0)
770 return portc->speed; 787 return portc->speed;
@@ -782,7 +799,8 @@ waveartist_set_speed(int dev, int arg)
782static short 799static short
783waveartist_set_channels(int dev, short arg) 800waveartist_set_channels(int dev, short arg)
784{ 801{
785 wavnc_port_info *portc = (wavnc_port_info *) audio_devs[dev]->portc; 802 struct wavnc_port_info *portc = (struct wavnc_port_info *)
803 audio_devs[dev]->portc;
786 804
787 if (arg != 1 && arg != 2) 805 if (arg != 1 && arg != 2)
788 return portc->channels; 806 return portc->channels;
@@ -794,7 +812,8 @@ waveartist_set_channels(int dev, short arg)
794static unsigned int 812static unsigned int
795waveartist_set_bits(int dev, unsigned int arg) 813waveartist_set_bits(int dev, unsigned int arg)
796{ 814{
797 wavnc_port_info *portc = (wavnc_port_info *) audio_devs[dev]->portc; 815 struct wavnc_port_info *portc = (struct wavnc_port_info *)
816 audio_devs[dev]->portc;
798 817
799 if (arg == 0) 818 if (arg == 0)
800 return portc->audio_format; 819 return portc->audio_format;
@@ -829,7 +848,7 @@ static struct audio_driver waveartist_audio_driver = {
829static irqreturn_t 848static irqreturn_t
830waveartist_intr(int irq, void *dev_id) 849waveartist_intr(int irq, void *dev_id)
831{ 850{
832 wavnc_info *devc = dev_id; 851 struct wavnc_info *devc = dev_id;
833 int irqstatus, status; 852 int irqstatus, status;
834 853
835 spin_lock(&waveartist_lock); 854 spin_lock(&waveartist_lock);
@@ -912,7 +931,7 @@ static const struct mix_ent mix_devs[SOUND_MIXER_NRDEVICES] = {
912}; 931};
913 932
914static void 933static void
915waveartist_mixer_update(wavnc_info *devc, int whichDev) 934waveartist_mixer_update(struct wavnc_info *devc, int whichDev)
916{ 935{
917 unsigned int lev_left, lev_right; 936 unsigned int lev_left, lev_right;
918 937
@@ -973,7 +992,8 @@ waveartist_mixer_update(wavnc_info *devc, int whichDev)
973 * relevant *_select_input function has done that for us. 992 * relevant *_select_input function has done that for us.
974 */ 993 */
975static void 994static void
976waveartist_set_adc_mux(wavnc_info *devc, char left_dev, char right_dev) 995waveartist_set_adc_mux(struct wavnc_info *devc, char left_dev,
996 char right_dev)
977{ 997{
978 unsigned int reg_08, reg_09; 998 unsigned int reg_08, reg_09;
979 999
@@ -996,7 +1016,7 @@ waveartist_set_adc_mux(wavnc_info *devc, char left_dev, char right_dev)
996 * SOUND_MASK_MIC Mic Microphone 1016 * SOUND_MASK_MIC Mic Microphone
997 */ 1017 */
998static unsigned int 1018static unsigned int
999waveartist_select_input(wavnc_info *devc, unsigned int recmask, 1019waveartist_select_input(struct wavnc_info *devc, unsigned int recmask,
1000 unsigned char *dev_l, unsigned char *dev_r) 1020 unsigned char *dev_l, unsigned char *dev_r)
1001{ 1021{
1002 unsigned int recdev = ADC_MUX_NONE; 1022 unsigned int recdev = ADC_MUX_NONE;
@@ -1024,7 +1044,8 @@ waveartist_select_input(wavnc_info *devc, unsigned int recmask,
1024} 1044}
1025 1045
1026static int 1046static int
1027waveartist_decode_mixer(wavnc_info *devc, int dev, unsigned char lev_l, 1047waveartist_decode_mixer(struct wavnc_info *devc, int dev,
1048 unsigned char lev_l,
1028 unsigned char lev_r) 1049 unsigned char lev_r)
1029{ 1050{
1030 switch (dev) { 1051 switch (dev) {
@@ -1050,7 +1071,7 @@ waveartist_decode_mixer(wavnc_info *devc, int dev, unsigned char lev_l,
1050 return dev; 1071 return dev;
1051} 1072}
1052 1073
1053static int waveartist_get_mixer(wavnc_info *devc, int dev) 1074static int waveartist_get_mixer(struct wavnc_info *devc, int dev)
1054{ 1075{
1055 return devc->levels[dev]; 1076 return devc->levels[dev];
1056} 1077}
@@ -1068,7 +1089,7 @@ static const struct waveartist_mixer_info waveartist_mixer = {
1068}; 1089};
1069 1090
1070static void 1091static void
1071waveartist_set_recmask(wavnc_info *devc, unsigned int recmask) 1092waveartist_set_recmask(struct wavnc_info *devc, unsigned int recmask)
1072{ 1093{
1073 unsigned char dev_l, dev_r; 1094 unsigned char dev_l, dev_r;
1074 1095
@@ -1092,7 +1113,7 @@ waveartist_set_recmask(wavnc_info *devc, unsigned int recmask)
1092} 1113}
1093 1114
1094static int 1115static int
1095waveartist_set_mixer(wavnc_info *devc, int dev, unsigned int level) 1116waveartist_set_mixer(struct wavnc_info *devc, int dev, unsigned int level)
1096{ 1117{
1097 unsigned int lev_left = level & 0x00ff; 1118 unsigned int lev_left = level & 0x00ff;
1098 unsigned int lev_right = (level & 0xff00) >> 8; 1119 unsigned int lev_right = (level & 0xff00) >> 8;
@@ -1120,7 +1141,7 @@ waveartist_set_mixer(wavnc_info *devc, int dev, unsigned int level)
1120static int 1141static int
1121waveartist_mixer_ioctl(int dev, unsigned int cmd, void __user * arg) 1142waveartist_mixer_ioctl(int dev, unsigned int cmd, void __user * arg)
1122{ 1143{
1123 wavnc_info *devc = (wavnc_info *)audio_devs[dev]->devc; 1144 struct wavnc_info *devc = (struct wavnc_info *)audio_devs[dev]->devc;
1124 int ret = 0, val, nr; 1145 int ret = 0, val, nr;
1125 1146
1126 /* 1147 /*
@@ -1204,7 +1225,7 @@ static struct mixer_operations waveartist_mixer_operations =
1204}; 1225};
1205 1226
1206static void 1227static void
1207waveartist_mixer_reset(wavnc_info *devc) 1228waveartist_mixer_reset(struct wavnc_info *devc)
1208{ 1229{
1209 int i; 1230 int i;
1210 1231
@@ -1241,9 +1262,9 @@ waveartist_mixer_reset(wavnc_info *devc)
1241 waveartist_mixer_update(devc, i); 1262 waveartist_mixer_update(devc, i);
1242} 1263}
1243 1264
1244static int __init waveartist_init(wavnc_info *devc) 1265static int __init waveartist_init(struct wavnc_info *devc)
1245{ 1266{
1246 wavnc_port_info *portc; 1267 struct wavnc_port_info *portc;
1247 char rev[3], dev_name[64]; 1268 char rev[3], dev_name[64];
1248 int my_dev; 1269 int my_dev;
1249 1270
@@ -1261,7 +1282,7 @@ static int __init waveartist_init(wavnc_info *devc)
1261 conf_printf2(dev_name, devc->hw.io_base, devc->hw.irq, 1282 conf_printf2(dev_name, devc->hw.io_base, devc->hw.irq,
1262 devc->hw.dma, devc->hw.dma2); 1283 devc->hw.dma, devc->hw.dma2);
1263 1284
1264 portc = kzalloc(sizeof(wavnc_port_info), GFP_KERNEL); 1285 portc = kzalloc(sizeof(struct wavnc_port_info), GFP_KERNEL);
1265 if (portc == NULL) 1286 if (portc == NULL)
1266 goto nomem; 1287 goto nomem;
1267 1288
@@ -1330,7 +1351,7 @@ nomem:
1330 1351
1331static int __init probe_waveartist(struct address_info *hw_config) 1352static int __init probe_waveartist(struct address_info *hw_config)
1332{ 1353{
1333 wavnc_info *devc = &adev_info[nr_waveartist_devs]; 1354 struct wavnc_info *devc = &adev_info[nr_waveartist_devs];
1334 1355
1335 if (nr_waveartist_devs >= MAX_AUDIO_DEV) { 1356 if (nr_waveartist_devs >= MAX_AUDIO_DEV) {
1336 printk(KERN_WARNING "waveartist: too many audio devices\n"); 1357 printk(KERN_WARNING "waveartist: too many audio devices\n");
@@ -1367,7 +1388,7 @@ static int __init probe_waveartist(struct address_info *hw_config)
1367static void __init 1388static void __init
1368attach_waveartist(struct address_info *hw, const struct waveartist_mixer_info *mix) 1389attach_waveartist(struct address_info *hw, const struct waveartist_mixer_info *mix)
1369{ 1390{
1370 wavnc_info *devc = &adev_info[nr_waveartist_devs]; 1391 struct wavnc_info *devc = &adev_info[nr_waveartist_devs];
1371 1392
1372 /* 1393 /*
1373 * NOTE! If irq < 0, there is another driver which has allocated the 1394 * NOTE! If irq < 0, there is another driver which has allocated the
@@ -1410,7 +1431,7 @@ attach_waveartist(struct address_info *hw, const struct waveartist_mixer_info *m
1410 1431
1411static void __exit unload_waveartist(struct address_info *hw) 1432static void __exit unload_waveartist(struct address_info *hw)
1412{ 1433{
1413 wavnc_info *devc = NULL; 1434 struct wavnc_info *devc = NULL;
1414 int i; 1435 int i;
1415 1436
1416 for (i = 0; i < nr_waveartist_devs; i++) 1437 for (i = 0; i < nr_waveartist_devs; i++)
@@ -1478,7 +1499,7 @@ static void __exit unload_waveartist(struct address_info *hw)
1478#define VNC_DISABLE_AUTOSWITCH 0x80 1499#define VNC_DISABLE_AUTOSWITCH 0x80
1479 1500
1480static inline void 1501static inline void
1481vnc_mute_spkr(wavnc_info *devc) 1502vnc_mute_spkr(struct wavnc_info *devc)
1482{ 1503{
1483 unsigned long flags; 1504 unsigned long flags;
1484 1505
@@ -1488,7 +1509,7 @@ vnc_mute_spkr(wavnc_info *devc)
1488} 1509}
1489 1510
1490static void 1511static void
1491vnc_mute_lout(wavnc_info *devc) 1512vnc_mute_lout(struct wavnc_info *devc)
1492{ 1513{
1493 unsigned int left, right; 1514 unsigned int left, right;
1494 1515
@@ -1507,7 +1528,7 @@ vnc_mute_lout(wavnc_info *devc)
1507} 1528}
1508 1529
1509static int 1530static int
1510vnc_volume_slider(wavnc_info *devc) 1531vnc_volume_slider(struct wavnc_info *devc)
1511{ 1532{
1512 static signed int old_slider_volume; 1533 static signed int old_slider_volume;
1513 unsigned long flags; 1534 unsigned long flags;
@@ -1567,7 +1588,7 @@ vnc_volume_slider(wavnc_info *devc)
1567 * SOUND_MASK_MIC Right Mic Builtin microphone 1588 * SOUND_MASK_MIC Right Mic Builtin microphone
1568 */ 1589 */
1569static unsigned int 1590static unsigned int
1570netwinder_select_input(wavnc_info *devc, unsigned int recmask, 1591netwinder_select_input(struct wavnc_info *devc, unsigned int recmask,
1571 unsigned char *dev_l, unsigned char *dev_r) 1592 unsigned char *dev_l, unsigned char *dev_r)
1572{ 1593{
1573 unsigned int recdev_l = ADC_MUX_NONE, recdev_r = ADC_MUX_NONE; 1594 unsigned int recdev_l = ADC_MUX_NONE, recdev_r = ADC_MUX_NONE;
@@ -1604,7 +1625,7 @@ netwinder_select_input(wavnc_info *devc, unsigned int recmask,
1604} 1625}
1605 1626
1606static int 1627static int
1607netwinder_decode_mixer(wavnc_info *devc, int dev, unsigned char lev_l, 1628netwinder_decode_mixer(struct wavnc_info *devc, int dev, unsigned char lev_l,
1608 unsigned char lev_r) 1629 unsigned char lev_r)
1609{ 1630{
1610 switch (dev) { 1631 switch (dev) {
@@ -1643,7 +1664,7 @@ netwinder_decode_mixer(wavnc_info *devc, int dev, unsigned char lev_l,
1643 return dev; 1664 return dev;
1644} 1665}
1645 1666
1646static int netwinder_get_mixer(wavnc_info *devc, int dev) 1667static int netwinder_get_mixer(struct wavnc_info *devc, int dev)
1647{ 1668{
1648 int levels; 1669 int levels;
1649 1670
@@ -1703,7 +1724,7 @@ static const struct waveartist_mixer_info netwinder_mixer = {
1703}; 1724};
1704 1725
1705static void 1726static void
1706vnc_configure_mixer(wavnc_info *devc, unsigned int recmask) 1727vnc_configure_mixer(struct wavnc_info *devc, unsigned int recmask)
1707{ 1728{
1708 if (!devc->no_autoselect) { 1729 if (!devc->no_autoselect) {
1709 if (devc->handset_detect) { 1730 if (devc->handset_detect) {
@@ -1729,7 +1750,7 @@ vnc_configure_mixer(wavnc_info *devc, unsigned int recmask)
1729} 1750}
1730 1751
1731static int 1752static int
1732vnc_slider(wavnc_info *devc) 1753vnc_slider(struct wavnc_info *devc)
1733{ 1754{
1734 signed int slider_volume; 1755 signed int slider_volume;
1735 unsigned int temp, old_hs, old_td; 1756 unsigned int temp, old_hs, old_td;
@@ -1795,7 +1816,7 @@ vnc_slider_tick(unsigned long data)
1795static int 1816static int
1796vnc_private_ioctl(int dev, unsigned int cmd, int __user * arg) 1817vnc_private_ioctl(int dev, unsigned int cmd, int __user * arg)
1797{ 1818{
1798 wavnc_info *devc = (wavnc_info *)audio_devs[dev]->devc; 1819 struct wavnc_info *devc = (struct wavnc_info *)audio_devs[dev]->devc;
1799 int val; 1820 int val;
1800 1821
1801 switch (cmd) { 1822 switch (cmd) {
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 5db1948699d8..aa302fb03fc5 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -265,6 +265,7 @@ enum {
265 AZX_DRIVER_TERA, 265 AZX_DRIVER_TERA,
266 AZX_DRIVER_CTX, 266 AZX_DRIVER_CTX,
267 AZX_DRIVER_CTHDA, 267 AZX_DRIVER_CTHDA,
268 AZX_DRIVER_CMEDIA,
268 AZX_DRIVER_GENERIC, 269 AZX_DRIVER_GENERIC,
269 AZX_NUM_DRIVERS, /* keep this as last entry */ 270 AZX_NUM_DRIVERS, /* keep this as last entry */
270}; 271};
@@ -330,6 +331,7 @@ static char *driver_short_names[] = {
330 [AZX_DRIVER_TERA] = "HDA Teradici", 331 [AZX_DRIVER_TERA] = "HDA Teradici",
331 [AZX_DRIVER_CTX] = "HDA Creative", 332 [AZX_DRIVER_CTX] = "HDA Creative",
332 [AZX_DRIVER_CTHDA] = "HDA Creative", 333 [AZX_DRIVER_CTHDA] = "HDA Creative",
334 [AZX_DRIVER_CMEDIA] = "HDA C-Media",
333 [AZX_DRIVER_GENERIC] = "HD-Audio Generic", 335 [AZX_DRIVER_GENERIC] = "HD-Audio Generic",
334}; 336};
335 337
@@ -1373,6 +1375,7 @@ static void azx_check_snoop_available(struct azx *chip)
1373 snoop = false; 1375 snoop = false;
1374 break; 1376 break;
1375 case AZX_DRIVER_CTHDA: 1377 case AZX_DRIVER_CTHDA:
1378 case AZX_DRIVER_CMEDIA:
1376 snoop = false; 1379 snoop = false;
1377 break; 1380 break;
1378 } 1381 }
@@ -2154,6 +2157,10 @@ static const struct pci_device_id azx_ids[] = {
2154 .driver_data = AZX_DRIVER_CTX | AZX_DCAPS_CTX_WORKAROUND | 2157 .driver_data = AZX_DRIVER_CTX | AZX_DCAPS_CTX_WORKAROUND |
2155 AZX_DCAPS_RIRB_PRE_DELAY | AZX_DCAPS_POSFIX_LPIB }, 2158 AZX_DCAPS_RIRB_PRE_DELAY | AZX_DCAPS_POSFIX_LPIB },
2156#endif 2159#endif
2160 /* CM8888 */
2161 { PCI_DEVICE(0x13f6, 0x5011),
2162 .driver_data = AZX_DRIVER_CMEDIA |
2163 AZX_DCAPS_NO_MSI | AZX_DCAPS_POSFIX_LPIB },
2157 /* Vortex86MX */ 2164 /* Vortex86MX */
2158 { PCI_DEVICE(0x17f3, 0x3010), .driver_data = AZX_DRIVER_GENERIC }, 2165 { PCI_DEVICE(0x17f3, 0x3010), .driver_data = AZX_DRIVER_GENERIC },
2159 /* VMware HDAudio */ 2166 /* VMware HDAudio */
diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c
index 4f3aba78f720..5d8455e2dacd 100644
--- a/sound/pci/hda/patch_ca0132.c
+++ b/sound/pci/hda/patch_ca0132.c
@@ -4376,6 +4376,9 @@ static void ca0132_download_dsp(struct hda_codec *codec)
4376 return; /* NOP */ 4376 return; /* NOP */
4377#endif 4377#endif
4378 4378
4379 if (spec->dsp_state == DSP_DOWNLOAD_FAILED)
4380 return; /* don't retry failures */
4381
4379 chipio_enable_clocks(codec); 4382 chipio_enable_clocks(codec);
4380 spec->dsp_state = DSP_DOWNLOADING; 4383 spec->dsp_state = DSP_DOWNLOADING;
4381 if (!ca0132_download_dsp_images(codec)) 4384 if (!ca0132_download_dsp_images(codec))
@@ -4552,7 +4555,8 @@ static int ca0132_init(struct hda_codec *codec)
4552 struct auto_pin_cfg *cfg = &spec->autocfg; 4555 struct auto_pin_cfg *cfg = &spec->autocfg;
4553 int i; 4556 int i;
4554 4557
4555 spec->dsp_state = DSP_DOWNLOAD_INIT; 4558 if (spec->dsp_state != DSP_DOWNLOAD_FAILED)
4559 spec->dsp_state = DSP_DOWNLOAD_INIT;
4556 spec->curr_chip_addx = INVALID_CHIP_ADDRESS; 4560 spec->curr_chip_addx = INVALID_CHIP_ADDRESS;
4557 4561
4558 snd_hda_power_up(codec); 4562 snd_hda_power_up(codec);
@@ -4663,6 +4667,7 @@ static int patch_ca0132(struct hda_codec *codec)
4663 codec->spec = spec; 4667 codec->spec = spec;
4664 spec->codec = codec; 4668 spec->codec = codec;
4665 4669
4670 spec->dsp_state = DSP_DOWNLOAD_INIT;
4666 spec->num_mixers = 1; 4671 spec->num_mixers = 1;
4667 spec->mixers[0] = ca0132_mixer; 4672 spec->mixers[0] = ca0132_mixer;
4668 4673
diff --git a/sound/pci/hda/patch_cmedia.c b/sound/pci/hda/patch_cmedia.c
index ed3d133ffbb6..c895a8f21192 100644
--- a/sound/pci/hda/patch_cmedia.c
+++ b/sound/pci/hda/patch_cmedia.c
@@ -75,15 +75,62 @@ static int patch_cmi9880(struct hda_codec *codec)
75 return err; 75 return err;
76} 76}
77 77
78static int patch_cmi8888(struct hda_codec *codec)
79{
80 struct cmi_spec *spec;
81 struct auto_pin_cfg *cfg;
82 int err;
83
84 spec = kzalloc(sizeof(*spec), GFP_KERNEL);
85 if (!spec)
86 return -ENOMEM;
87
88 codec->spec = spec;
89 cfg = &spec->gen.autocfg;
90 snd_hda_gen_spec_init(&spec->gen);
91
92 /* mask NID 0x10 from the playback volume selection;
93 * it's a headphone boost volume handled manually below
94 */
95 spec->gen.out_vol_mask = (1ULL << 0x10);
96
97 err = snd_hda_parse_pin_defcfg(codec, cfg, NULL, 0);
98 if (err < 0)
99 goto error;
100 err = snd_hda_gen_parse_auto_config(codec, cfg);
101 if (err < 0)
102 goto error;
103
104 if (get_defcfg_device(snd_hda_codec_get_pincfg(codec, 0x10)) ==
105 AC_JACK_HP_OUT) {
106 static const struct snd_kcontrol_new amp_kctl =
107 HDA_CODEC_VOLUME("Headphone Amp Playback Volume",
108 0x10, 0, HDA_OUTPUT);
109 if (!snd_hda_gen_add_kctl(&spec->gen, NULL, &amp_kctl)) {
110 err = -ENOMEM;
111 goto error;
112 }
113 }
114
115 codec->patch_ops = cmi_auto_patch_ops;
116 return 0;
117
118 error:
119 snd_hda_gen_free(codec);
120 return err;
121}
122
78/* 123/*
79 * patch entries 124 * patch entries
80 */ 125 */
81static const struct hda_codec_preset snd_hda_preset_cmedia[] = { 126static const struct hda_codec_preset snd_hda_preset_cmedia[] = {
127 { .id = 0x13f68888, .name = "CMI8888", .patch = patch_cmi8888 },
82 { .id = 0x13f69880, .name = "CMI9880", .patch = patch_cmi9880 }, 128 { .id = 0x13f69880, .name = "CMI9880", .patch = patch_cmi9880 },
83 { .id = 0x434d4980, .name = "CMI9880", .patch = patch_cmi9880 }, 129 { .id = 0x434d4980, .name = "CMI9880", .patch = patch_cmi9880 },
84 {} /* terminator */ 130 {} /* terminator */
85}; 131};
86 132
133MODULE_ALIAS("snd-hda-codec-id:13f68888");
87MODULE_ALIAS("snd-hda-codec-id:13f69880"); 134MODULE_ALIAS("snd-hda-codec-id:13f69880");
88MODULE_ALIAS("snd-hda-codec-id:434d4980"); 135MODULE_ALIAS("snd-hda-codec-id:434d4980");
89 136
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index 7627a69ca6d7..6f2fa838b635 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -26,6 +26,7 @@
26#include <linux/module.h> 26#include <linux/module.h>
27#include <sound/core.h> 27#include <sound/core.h>
28#include <sound/jack.h> 28#include <sound/jack.h>
29#include <sound/tlv.h>
29 30
30#include "hda_codec.h" 31#include "hda_codec.h"
31#include "hda_local.h" 32#include "hda_local.h"
@@ -859,6 +860,11 @@ static int patch_conexant_auto(struct hda_codec *codec)
859 if (err < 0) 860 if (err < 0)
860 goto error; 861 goto error;
861 862
863 if (codec->vendor_id == 0x14f15051) {
864 /* minimum value is actually mute */
865 spec->gen.vmaster_tlv[3] |= TLV_DB_SCALE_MUTE;
866 }
867
862 codec->patch_ops = cx_auto_patch_ops; 868 codec->patch_ops = cx_auto_patch_ops;
863 869
864 /* Some laptops with Conexant chips show stalls in S3 resume, 870 /* Some laptops with Conexant chips show stalls in S3 resume,
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 654c8f16d150..6b38ec3c6e57 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -2782,6 +2782,27 @@ static int alc269_parse_auto_config(struct hda_codec *codec)
2782 return alc_parse_auto_config(codec, alc269_ignore, ssids); 2782 return alc_parse_auto_config(codec, alc269_ignore, ssids);
2783} 2783}
2784 2784
2785static int find_ext_mic_pin(struct hda_codec *codec);
2786
2787static void alc286_shutup(struct hda_codec *codec)
2788{
2789 int i;
2790 int mic_pin = find_ext_mic_pin(codec);
2791 /* don't shut up pins when unloading the driver; otherwise it breaks
2792 * the default pin setup at the next load of the driver
2793 */
2794 if (codec->bus->shutdown)
2795 return;
2796 for (i = 0; i < codec->init_pins.used; i++) {
2797 struct hda_pincfg *pin = snd_array_elem(&codec->init_pins, i);
2798 /* use read here for syncing after issuing each verb */
2799 if (pin->nid != mic_pin)
2800 snd_hda_codec_read(codec, pin->nid, 0,
2801 AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
2802 }
2803 codec->pins_shutup = 1;
2804}
2805
2785static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up) 2806static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up)
2786{ 2807{
2787 int val = alc_read_coef_idx(codec, 0x04); 2808 int val = alc_read_coef_idx(codec, 0x04);
@@ -4072,7 +4093,7 @@ static unsigned int alc_power_filter_xps13(struct hda_codec *codec,
4072 4093
4073 /* Avoid pop noises when headphones are plugged in */ 4094 /* Avoid pop noises when headphones are plugged in */
4074 if (spec->gen.hp_jack_present) 4095 if (spec->gen.hp_jack_present)
4075 if (nid == codec->afg || nid == 0x02) 4096 if (nid == codec->afg || nid == 0x02 || nid == 0x15)
4076 return AC_PWRST_D0; 4097 return AC_PWRST_D0;
4077 return power_state; 4098 return power_state;
4078} 4099}
@@ -4082,8 +4103,19 @@ static void alc_fixup_dell_xps13(struct hda_codec *codec,
4082{ 4103{
4083 if (action == HDA_FIXUP_ACT_PROBE) { 4104 if (action == HDA_FIXUP_ACT_PROBE) {
4084 struct alc_spec *spec = codec->spec; 4105 struct alc_spec *spec = codec->spec;
4106 struct hda_input_mux *imux = &spec->gen.input_mux;
4107 int i;
4108
4085 spec->shutup = alc_no_shutup; 4109 spec->shutup = alc_no_shutup;
4086 codec->power_filter = alc_power_filter_xps13; 4110 codec->power_filter = alc_power_filter_xps13;
4111
4112 /* Make the internal mic the default input source. */
4113 for (i = 0; i < imux->num_items; i++) {
4114 if (spec->gen.imux_pins[i] == 0x12) {
4115 spec->gen.cur_mux[0] = i;
4116 break;
4117 }
4118 }
4087 } 4119 }
4088} 4120}
4089 4121
@@ -5384,6 +5416,7 @@ static int patch_alc269(struct hda_codec *codec)
5384 case 0x10ec0286: 5416 case 0x10ec0286:
5385 case 0x10ec0288: 5417 case 0x10ec0288:
5386 spec->codec_variant = ALC269_TYPE_ALC286; 5418 spec->codec_variant = ALC269_TYPE_ALC286;
5419 spec->shutup = alc286_shutup;
5387 break; 5420 break;
5388 case 0x10ec0255: 5421 case 0x10ec0255:
5389 spec->codec_variant = ALC269_TYPE_ALC255; 5422 spec->codec_variant = ALC269_TYPE_ALC255;
diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
index f652b10ce905..223c47b33ba3 100644
--- a/sound/usb/quirks-table.h
+++ b/sound/usb/quirks-table.h
@@ -1581,6 +1581,35 @@ YAMAHA_DEVICE(0x7010, "UB99"),
1581 } 1581 }
1582}, 1582},
1583{ 1583{
1584 /* BOSS ME-25 */
1585 USB_DEVICE(0x0582, 0x0113),
1586 .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
1587 .ifnum = QUIRK_ANY_INTERFACE,
1588 .type = QUIRK_COMPOSITE,
1589 .data = (const struct snd_usb_audio_quirk[]) {
1590 {
1591 .ifnum = 0,
1592 .type = QUIRK_AUDIO_STANDARD_INTERFACE
1593 },
1594 {
1595 .ifnum = 1,
1596 .type = QUIRK_AUDIO_STANDARD_INTERFACE
1597 },
1598 {
1599 .ifnum = 2,
1600 .type = QUIRK_MIDI_FIXED_ENDPOINT,
1601 .data = & (const struct snd_usb_midi_endpoint_info) {
1602 .out_cables = 0x0001,
1603 .in_cables = 0x0001
1604 }
1605 },
1606 {
1607 .ifnum = -1
1608 }
1609 }
1610 }
1611},
1612{
1584 /* only 44.1 kHz works at the moment */ 1613 /* only 44.1 kHz works at the moment */
1585 USB_DEVICE(0x0582, 0x0120), 1614 USB_DEVICE(0x0582, 0x0120),
1586 .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { 1615 .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {