Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+239 -89
+21 -19
sound/oss/uart401.c
··· 30 30 31 31 #include "mpu401.h" 32 32 33 - typedef struct uart401_devc 33 + struct uart401_devc 34 34 { 35 35 int base; 36 36 int irq; ··· 41 41 int my_dev; 42 42 int share_irq; 43 43 spinlock_t lock; 44 - } 45 - uart401_devc; 44 + }; 46 45 47 46 #define DATAPORT (devc->base) 48 47 #define COMDPORT (devc->base+1) 49 48 #define STATPORT (devc->base+1) 50 49 51 - static int uart401_status(uart401_devc * devc) 50 + static int uart401_status(struct uart401_devc *devc) 52 51 { 53 52 return inb(STATPORT); 54 53 } ··· 55 56 #define input_avail(devc) (!(uart401_status(devc)&INPUT_AVAIL)) 56 57 #define output_ready(devc) (!(uart401_status(devc)&OUTPUT_READY)) 57 58 58 - static void uart401_cmd(uart401_devc * devc, unsigned char cmd) 59 + static void uart401_cmd(struct uart401_devc *devc, unsigned char cmd) 59 60 { 60 61 outb((cmd), COMDPORT); 61 62 } 62 63 63 - static int uart401_read(uart401_devc * devc) 64 + static int uart401_read(struct uart401_devc *devc) 64 65 { 65 66 return inb(DATAPORT); 66 67 } 67 68 68 - static void uart401_write(uart401_devc * devc, unsigned char byte) 69 + static void uart401_write(struct uart401_devc *devc, unsigned char byte) 69 70 { 70 71 outb((byte), DATAPORT); 71 72 } ··· 76 77 #define MPU_RESET 0xFF 77 78 #define UART_MODE_ON 0x3F 78 79 79 - static int reset_uart401(uart401_devc * devc); 80 - static void enter_uart_mode(uart401_devc * devc); 80 + static int reset_uart401(struct uart401_devc *devc); 81 + static void enter_uart_mode(struct uart401_devc *devc); 81 82 82 - static void uart401_input_loop(uart401_devc * devc) 83 + static void uart401_input_loop(struct uart401_devc *devc) 83 84 { 84 85 int work_limit=30000; 85 86 ··· 98 99 99 100 irqreturn_t uart401intr(int irq, void *dev_id) 100 101 { 101 - uart401_devc *devc = dev_id; 102 + struct uart401_devc *devc = dev_id; 102 103 103 104 if (devc == NULL) 104 105 { ··· 117 118 void (*output) (int dev) 118 119 ) 119 120 { 120 - uart401_devc *devc = (uart401_devc *) midi_devs[dev]->devc; 121 + struct uart401_devc *devc = (struct uart401_devc *) 122 + midi_devs[dev]->devc; 121 123 122 124 if (devc->opened) 123 125 return -EBUSY; ··· 138 138 139 139 static 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 144 reset_uart401(devc); 144 145 devc->opened = 0; ··· 149 148 { 150 149 int timeout; 151 150 unsigned long flags; 152 - uart401_devc *devc = (uart401_devc *) midi_devs[dev]->devc; 151 + struct uart401_devc *devc = (struct uart401_devc *) 152 + midi_devs[dev]->devc; 153 153 154 154 if (devc->disabled) 155 155 return 1; ··· 221 219 .buffer_status = uart401_buffer_status, 222 220 }; 223 221 224 - static void enter_uart_mode(uart401_devc * devc) 222 + static void enter_uart_mode(struct uart401_devc *devc) 225 223 { 226 224 int ok, timeout; 227 225 unsigned long flags; ··· 243 241 spin_unlock_irqrestore(&devc->lock,flags); 244 242 } 245 243 246 - static int reset_uart401(uart401_devc * devc) 244 + static int reset_uart401(struct uart401_devc *devc) 247 245 { 248 246 int ok, timeout, n; 249 247 ··· 287 285 288 286 int probe_uart401(struct address_info *hw_config, struct module *owner) 289 287 { 290 - uart401_devc *devc; 288 + struct uart401_devc *devc; 291 289 char *name = "MPU-401 (UART) MIDI"; 292 290 int ok = 0; 293 291 unsigned long flags; ··· 302 300 return 0; 303 301 } 304 302 305 - devc = kmalloc(sizeof(uart401_devc), GFP_KERNEL); 303 + devc = kmalloc(sizeof(struct uart401_devc), GFP_KERNEL); 306 304 if (!devc) { 307 305 printk(KERN_WARNING "uart401: Can't allocate memory\n"); 308 306 goto cleanup_region; ··· 394 392 395 393 void unload_uart401(struct address_info *hw_config) 396 394 { 397 - uart401_devc *devc; 395 + struct uart401_devc *devc; 398 396 int n=hw_config->slots[4]; 399 397 400 398 /* Not set up */
+89 -68
sound/oss/waveartist.c
··· 92 92 0x0000 /* Monitor */ 93 93 }; 94 94 95 - typedef struct { 95 + struct wavnc_info { 96 96 struct address_info hw; /* hardware */ 97 97 char *chip_name; 98 98 ··· 119 119 unsigned int line_mute_state :1;/* set by ioctl or autoselect */ 120 120 unsigned int use_slider :1;/* use slider setting for o/p vol */ 121 121 #endif 122 - } wavnc_info; 122 + }; 123 123 124 124 /* 125 125 * This is the implementation specific mixer information. ··· 129 129 unsigned int recording_devs; /* Recordable devies */ 130 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 133 unsigned char *, unsigned char *); 134 - int (*decode_mixer)(wavnc_info *, int, 134 + int (*decode_mixer)(struct wavnc_info *, int, 135 135 unsigned char, unsigned char); 136 - int (*get_mixer)(wavnc_info *, int); 136 + int (*get_mixer)(struct wavnc_info *, int); 137 137 }; 138 138 139 - typedef struct wavnc_port_info { 139 + struct wavnc_port_info { 140 140 int open_mode; 141 141 int speed; 142 142 int channels; 143 143 int audio_format; 144 - } wavnc_port_info; 144 + }; 145 145 146 146 static int nr_waveartist_devs; 147 - static wavnc_info adev_info[MAX_AUDIO_DEV]; 147 + static struct wavnc_info adev_info[MAX_AUDIO_DEV]; 148 148 static DEFINE_SPINLOCK(waveartist_lock); 149 149 150 150 #ifndef CONFIG_ARCH_NETWINDER 151 151 #define machine_is_netwinder() 0 152 152 #else 153 153 static struct timer_list vnc_timer; 154 - static void vnc_configure_mixer(wavnc_info *devc, unsigned int input_mask); 154 + static void vnc_configure_mixer(struct wavnc_info *devc, 155 + unsigned int input_mask); 155 156 static int vnc_private_ioctl(int dev, unsigned int cmd, int __user *arg); 156 157 static void vnc_slider_tick(unsigned long data); 157 158 #endif ··· 170 169 /* Toggle IRQ acknowledge line 171 170 */ 172 171 static inline void 173 - waveartist_iack(wavnc_info *devc) 172 + waveartist_iack(struct wavnc_info *devc) 174 173 { 175 174 unsigned int ctlr_port = devc->hw.io_base + CTLR; 176 175 int old_ctlr; ··· 189 188 } 190 189 191 190 static int 192 - waveartist_reset(wavnc_info *devc) 191 + waveartist_reset(struct wavnc_info *devc) 193 192 { 194 193 struct address_info *hw = &devc->hw; 195 194 unsigned int timeout, res = -1; ··· 224 223 * and can send or receive multiple words. 225 224 */ 226 225 static int 227 - waveartist_cmd(wavnc_info *devc, 226 + waveartist_cmd(struct wavnc_info *devc, 228 227 int nr_cmd, unsigned int *cmd, 229 228 int nr_resp, unsigned int *resp) 230 229 { ··· 300 299 * Send one command word 301 300 */ 302 301 static inline int 303 - waveartist_cmd1(wavnc_info *devc, unsigned int cmd) 302 + waveartist_cmd1(struct wavnc_info *devc, unsigned int cmd) 304 303 { 305 304 return waveartist_cmd(devc, 1, &cmd, 0, NULL); 306 305 } ··· 309 308 * Send one command, receive one word 310 309 */ 311 310 static inline unsigned int 312 - waveartist_cmd1_r(wavnc_info *devc, unsigned int cmd) 311 + waveartist_cmd1_r(struct wavnc_info *devc, unsigned int cmd) 313 312 { 314 313 unsigned int ret; 315 314 ··· 323 322 * word (and throw it away) 324 323 */ 325 324 static inline int 326 - waveartist_cmd2(wavnc_info *devc, unsigned int cmd, unsigned int arg) 325 + waveartist_cmd2(struct wavnc_info *devc, unsigned int cmd, unsigned int arg) 327 326 { 328 327 unsigned int vals[2]; 329 328 ··· 337 336 * Send a triple command 338 337 */ 339 338 static inline int 340 - waveartist_cmd3(wavnc_info *devc, unsigned int cmd, 339 + waveartist_cmd3(struct wavnc_info *devc, unsigned int cmd, 341 340 unsigned int arg1, unsigned int arg2) 342 341 { 343 342 unsigned int vals[3]; ··· 350 349 } 351 350 352 351 static int 353 - waveartist_getrev(wavnc_info *devc, char *rev) 352 + waveartist_getrev(struct wavnc_info *devc, char *rev) 354 353 { 355 354 unsigned int temp[2]; 356 355 unsigned int cmd = WACMD_GETREV; ··· 372 371 static int 373 372 waveartist_open(int dev, int mode) 374 373 { 375 - wavnc_info *devc; 376 - wavnc_port_info *portc; 374 + struct wavnc_info *devc; 375 + struct wavnc_port_info *portc; 377 376 unsigned long flags; 378 377 379 378 if (dev < 0 || dev >= num_audiodevs) 380 379 return -ENXIO; 381 380 382 - devc = (wavnc_info *) audio_devs[dev]->devc; 383 - portc = (wavnc_port_info *) audio_devs[dev]->portc; 381 + devc = (struct wavnc_info *) audio_devs[dev]->devc; 382 + portc = (struct wavnc_port_info *) audio_devs[dev]->portc; 384 383 385 384 spin_lock_irqsave(&waveartist_lock, flags); 386 385 if (portc->open_mode || (devc->open_mode & mode)) { ··· 405 404 static void 406 405 waveartist_close(int dev) 407 406 { 408 - wavnc_info *devc = (wavnc_info *) audio_devs[dev]->devc; 409 - wavnc_port_info *portc = (wavnc_port_info *) audio_devs[dev]->portc; 407 + struct wavnc_info *devc = (struct wavnc_info *) 408 + audio_devs[dev]->devc; 409 + struct wavnc_port_info *portc = (struct wavnc_port_info *) 410 + audio_devs[dev]->portc; 410 411 unsigned long flags; 411 412 412 413 spin_lock_irqsave(&waveartist_lock, flags); ··· 425 422 static void 426 423 waveartist_output_block(int dev, unsigned long buf, int __count, int intrflag) 427 424 { 428 - wavnc_port_info *portc = (wavnc_port_info *) audio_devs[dev]->portc; 429 - wavnc_info *devc = (wavnc_info *) audio_devs[dev]->devc; 425 + struct wavnc_port_info *portc = (struct wavnc_port_info *) 426 + audio_devs[dev]->portc; 427 + struct wavnc_info *devc = (struct wavnc_info *) 428 + audio_devs[dev]->devc; 430 429 unsigned long flags; 431 430 unsigned int count = __count; 432 431 ··· 472 467 static void 473 468 waveartist_start_input(int dev, unsigned long buf, int __count, int intrflag) 474 469 { 475 - wavnc_port_info *portc = (wavnc_port_info *) audio_devs[dev]->portc; 476 - wavnc_info *devc = (wavnc_info *) audio_devs[dev]->devc; 470 + struct wavnc_port_info *portc = (struct wavnc_port_info *) 471 + audio_devs[dev]->portc; 472 + struct wavnc_info *devc = (struct wavnc_info *) 473 + audio_devs[dev]->devc; 477 474 unsigned long flags; 478 475 unsigned int count = __count; 479 476 ··· 521 514 } 522 515 523 516 static unsigned int 524 - waveartist_get_speed(wavnc_port_info *portc) 517 + waveartist_get_speed(struct wavnc_port_info *portc) 525 518 { 526 519 unsigned int speed; 527 520 ··· 549 542 } 550 543 551 544 static unsigned int 552 - waveartist_get_bits(wavnc_port_info *portc) 545 + waveartist_get_bits(struct wavnc_port_info *portc) 553 546 { 554 547 unsigned int bits; 555 548 ··· 567 560 waveartist_prepare_for_input(int dev, int bsize, int bcount) 568 561 { 569 562 unsigned long flags; 570 - wavnc_info *devc = (wavnc_info *) audio_devs[dev]->devc; 571 - wavnc_port_info *portc = (wavnc_port_info *) audio_devs[dev]->portc; 563 + struct wavnc_info *devc = (struct wavnc_info *) 564 + audio_devs[dev]->devc; 565 + struct wavnc_port_info *portc = (struct wavnc_port_info *) 566 + audio_devs[dev]->portc; 572 567 unsigned int speed, bits; 573 568 574 569 if (devc->audio_mode) ··· 624 615 waveartist_prepare_for_output(int dev, int bsize, int bcount) 625 616 { 626 617 unsigned long flags; 627 - wavnc_info *devc = (wavnc_info *) audio_devs[dev]->devc; 628 - wavnc_port_info *portc = (wavnc_port_info *) audio_devs[dev]->portc; 618 + struct wavnc_info *devc = (struct wavnc_info *) 619 + audio_devs[dev]->devc; 620 + struct wavnc_port_info *portc = (struct wavnc_port_info *) 621 + audio_devs[dev]->portc; 629 622 unsigned int speed, bits; 630 623 631 624 /* ··· 671 660 static void 672 661 waveartist_halt(int dev) 673 662 { 674 - wavnc_port_info *portc = (wavnc_port_info *) audio_devs[dev]->portc; 675 - wavnc_info *devc; 663 + struct wavnc_port_info *portc = (struct wavnc_port_info *) 664 + audio_devs[dev]->portc; 665 + struct wavnc_info *devc; 676 666 677 667 if (portc->open_mode & OPEN_WRITE) 678 668 waveartist_halt_output(dev); ··· 681 669 if (portc->open_mode & OPEN_READ) 682 670 waveartist_halt_input(dev); 683 671 684 - devc = (wavnc_info *) audio_devs[dev]->devc; 672 + devc = (struct wavnc_info *) audio_devs[dev]->devc; 685 673 devc->audio_mode = 0; 686 674 } 687 675 688 676 static void 689 677 waveartist_halt_input(int dev) 690 678 { 691 - wavnc_info *devc = (wavnc_info *) audio_devs[dev]->devc; 679 + struct wavnc_info *devc = (struct wavnc_info *) 680 + audio_devs[dev]->devc; 692 681 unsigned long flags; 693 682 694 683 spin_lock_irqsave(&waveartist_lock, flags); ··· 716 703 static void 717 704 waveartist_halt_output(int dev) 718 705 { 719 - wavnc_info *devc = (wavnc_info *) audio_devs[dev]->devc; 706 + struct wavnc_info *devc = (struct wavnc_info *) 707 + audio_devs[dev]->devc; 720 708 unsigned long flags; 721 709 722 710 spin_lock_irqsave(&waveartist_lock, flags); ··· 741 727 static void 742 728 waveartist_trigger(int dev, int state) 743 729 { 744 - wavnc_info *devc = (wavnc_info *) audio_devs[dev]->devc; 745 - wavnc_port_info *portc = (wavnc_port_info *) audio_devs[dev]->portc; 730 + struct wavnc_info *devc = (struct wavnc_info *) 731 + audio_devs[dev]->devc; 732 + struct wavnc_port_info *portc = (struct wavnc_port_info *) 733 + audio_devs[dev]->portc; 746 734 unsigned long flags; 747 735 748 736 if (debug_flg & DEBUG_TRIGGER) { ··· 780 764 static int 781 765 waveartist_set_speed(int dev, int arg) 782 766 { 783 - wavnc_port_info *portc = (wavnc_port_info *) audio_devs[dev]->portc; 767 + struct wavnc_port_info *portc = (struct wavnc_port_info *) 768 + audio_devs[dev]->portc; 784 769 785 770 if (arg <= 0) 786 771 return portc->speed; ··· 799 782 static short 800 783 waveartist_set_channels(int dev, short arg) 801 784 { 802 - wavnc_port_info *portc = (wavnc_port_info *) audio_devs[dev]->portc; 785 + struct wavnc_port_info *portc = (struct wavnc_port_info *) 786 + audio_devs[dev]->portc; 803 787 804 788 if (arg != 1 && arg != 2) 805 789 return portc->channels; ··· 812 794 static unsigned int 813 795 waveartist_set_bits(int dev, unsigned int arg) 814 796 { 815 - wavnc_port_info *portc = (wavnc_port_info *) audio_devs[dev]->portc; 797 + struct wavnc_port_info *portc = (struct wavnc_port_info *) 798 + audio_devs[dev]->portc; 816 799 817 800 if (arg == 0) 818 801 return portc->audio_format; ··· 848 829 static irqreturn_t 849 830 waveartist_intr(int irq, void *dev_id) 850 831 { 851 - wavnc_info *devc = dev_id; 832 + struct wavnc_info *devc = dev_id; 852 833 int irqstatus, status; 853 834 854 835 spin_lock(&waveartist_lock); ··· 931 912 }; 932 913 933 914 static void 934 - waveartist_mixer_update(wavnc_info *devc, int whichDev) 915 + waveartist_mixer_update(struct wavnc_info *devc, int whichDev) 935 916 { 936 917 unsigned int lev_left, lev_right; 937 918 ··· 992 973 * relevant *_select_input function has done that for us. 993 974 */ 994 975 static void 995 - waveartist_set_adc_mux(wavnc_info *devc, char left_dev, char right_dev) 976 + waveartist_set_adc_mux(struct wavnc_info *devc, char left_dev, 977 + char right_dev) 996 978 { 997 979 unsigned int reg_08, reg_09; 998 980 ··· 1016 996 * SOUND_MASK_MIC Mic Microphone 1017 997 */ 1018 998 static unsigned int 1019 - waveartist_select_input(wavnc_info *devc, unsigned int recmask, 999 + waveartist_select_input(struct wavnc_info *devc, unsigned int recmask, 1020 1000 unsigned char *dev_l, unsigned char *dev_r) 1021 1001 { 1022 1002 unsigned int recdev = ADC_MUX_NONE; ··· 1044 1024 } 1045 1025 1046 1026 static int 1047 - waveartist_decode_mixer(wavnc_info *devc, int dev, unsigned char lev_l, 1027 + waveartist_decode_mixer(struct wavnc_info *devc, int dev, 1028 + unsigned char lev_l, 1048 1029 unsigned char lev_r) 1049 1030 { 1050 1031 switch (dev) { ··· 1071 1050 return dev; 1072 1051 } 1073 1052 1074 - static int waveartist_get_mixer(wavnc_info *devc, int dev) 1053 + static int waveartist_get_mixer(struct wavnc_info *devc, int dev) 1075 1054 { 1076 1055 return devc->levels[dev]; 1077 1056 } ··· 1089 1068 }; 1090 1069 1091 1070 static void 1092 - waveartist_set_recmask(wavnc_info *devc, unsigned int recmask) 1071 + waveartist_set_recmask(struct wavnc_info *devc, unsigned int recmask) 1093 1072 { 1094 1073 unsigned char dev_l, dev_r; 1095 1074 ··· 1113 1092 } 1114 1093 1115 1094 static int 1116 - waveartist_set_mixer(wavnc_info *devc, int dev, unsigned int level) 1095 + waveartist_set_mixer(struct wavnc_info *devc, int dev, unsigned int level) 1117 1096 { 1118 1097 unsigned int lev_left = level & 0x00ff; 1119 1098 unsigned int lev_right = (level & 0xff00) >> 8; ··· 1141 1120 static int 1142 1121 waveartist_mixer_ioctl(int dev, unsigned int cmd, void __user * arg) 1143 1122 { 1144 - wavnc_info *devc = (wavnc_info *)audio_devs[dev]->devc; 1123 + struct wavnc_info *devc = (struct wavnc_info *)audio_devs[dev]->devc; 1145 1124 int ret = 0, val, nr; 1146 1125 1147 1126 /* ··· 1225 1204 }; 1226 1205 1227 1206 static void 1228 - waveartist_mixer_reset(wavnc_info *devc) 1207 + waveartist_mixer_reset(struct wavnc_info *devc) 1229 1208 { 1230 1209 int i; 1231 1210 ··· 1262 1241 waveartist_mixer_update(devc, i); 1263 1242 } 1264 1243 1265 - static int __init waveartist_init(wavnc_info *devc) 1244 + static int __init waveartist_init(struct wavnc_info *devc) 1266 1245 { 1267 - wavnc_port_info *portc; 1246 + struct wavnc_port_info *portc; 1268 1247 char rev[3], dev_name[64]; 1269 1248 int my_dev; 1270 1249 ··· 1282 1261 conf_printf2(dev_name, devc->hw.io_base, devc->hw.irq, 1283 1262 devc->hw.dma, devc->hw.dma2); 1284 1263 1285 - portc = kzalloc(sizeof(wavnc_port_info), GFP_KERNEL); 1264 + portc = kzalloc(sizeof(struct wavnc_port_info), GFP_KERNEL); 1286 1265 if (portc == NULL) 1287 1266 goto nomem; 1288 1267 ··· 1351 1330 1352 1331 static int __init probe_waveartist(struct address_info *hw_config) 1353 1332 { 1354 - wavnc_info *devc = &adev_info[nr_waveartist_devs]; 1333 + struct wavnc_info *devc = &adev_info[nr_waveartist_devs]; 1355 1334 1356 1335 if (nr_waveartist_devs >= MAX_AUDIO_DEV) { 1357 1336 printk(KERN_WARNING "waveartist: too many audio devices\n"); ··· 1388 1367 static void __init 1389 1368 attach_waveartist(struct address_info *hw, const struct waveartist_mixer_info *mix) 1390 1369 { 1391 - wavnc_info *devc = &adev_info[nr_waveartist_devs]; 1370 + struct wavnc_info *devc = &adev_info[nr_waveartist_devs]; 1392 1371 1393 1372 /* 1394 1373 * NOTE! If irq < 0, there is another driver which has allocated the ··· 1431 1410 1432 1411 static void __exit unload_waveartist(struct address_info *hw) 1433 1412 { 1434 - wavnc_info *devc = NULL; 1413 + struct wavnc_info *devc = NULL; 1435 1414 int i; 1436 1415 1437 1416 for (i = 0; i < nr_waveartist_devs; i++) ··· 1499 1478 #define VNC_DISABLE_AUTOSWITCH 0x80 1500 1479 1501 1480 static inline void 1502 - vnc_mute_spkr(wavnc_info *devc) 1481 + vnc_mute_spkr(struct wavnc_info *devc) 1503 1482 { 1504 1483 unsigned long flags; 1505 1484 ··· 1509 1488 } 1510 1489 1511 1490 static void 1512 - vnc_mute_lout(wavnc_info *devc) 1491 + vnc_mute_lout(struct wavnc_info *devc) 1513 1492 { 1514 1493 unsigned int left, right; 1515 1494 ··· 1528 1507 } 1529 1508 1530 1509 static int 1531 - vnc_volume_slider(wavnc_info *devc) 1510 + vnc_volume_slider(struct wavnc_info *devc) 1532 1511 { 1533 1512 static signed int old_slider_volume; 1534 1513 unsigned long flags; ··· 1588 1567 * SOUND_MASK_MIC Right Mic Builtin microphone 1589 1568 */ 1590 1569 static unsigned int 1591 - netwinder_select_input(wavnc_info *devc, unsigned int recmask, 1570 + netwinder_select_input(struct wavnc_info *devc, unsigned int recmask, 1592 1571 unsigned char *dev_l, unsigned char *dev_r) 1593 1572 { 1594 1573 unsigned int recdev_l = ADC_MUX_NONE, recdev_r = ADC_MUX_NONE; ··· 1625 1604 } 1626 1605 1627 1606 static int 1628 - netwinder_decode_mixer(wavnc_info *devc, int dev, unsigned char lev_l, 1607 + netwinder_decode_mixer(struct wavnc_info *devc, int dev, unsigned char lev_l, 1629 1608 unsigned char lev_r) 1630 1609 { 1631 1610 switch (dev) { ··· 1664 1643 return dev; 1665 1644 } 1666 1645 1667 - static int netwinder_get_mixer(wavnc_info *devc, int dev) 1646 + static int netwinder_get_mixer(struct wavnc_info *devc, int dev) 1668 1647 { 1669 1648 int levels; 1670 1649 ··· 1724 1703 }; 1725 1704 1726 1705 static void 1727 - vnc_configure_mixer(wavnc_info *devc, unsigned int recmask) 1706 + vnc_configure_mixer(struct wavnc_info *devc, unsigned int recmask) 1728 1707 { 1729 1708 if (!devc->no_autoselect) { 1730 1709 if (devc->handset_detect) { ··· 1750 1729 } 1751 1730 1752 1731 static int 1753 - vnc_slider(wavnc_info *devc) 1732 + vnc_slider(struct wavnc_info *devc) 1754 1733 { 1755 1734 signed int slider_volume; 1756 1735 unsigned int temp, old_hs, old_td; ··· 1816 1795 static int 1817 1796 vnc_private_ioctl(int dev, unsigned int cmd, int __user * arg) 1818 1797 { 1819 - wavnc_info *devc = (wavnc_info *)audio_devs[dev]->devc; 1798 + struct wavnc_info *devc = (struct wavnc_info *)audio_devs[dev]->devc; 1820 1799 int val; 1821 1800 1822 1801 switch (cmd) {
+7
sound/pci/hda/hda_intel.c
··· 265 265 AZX_DRIVER_TERA, 266 266 AZX_DRIVER_CTX, 267 267 AZX_DRIVER_CTHDA, 268 + AZX_DRIVER_CMEDIA, 268 269 AZX_DRIVER_GENERIC, 269 270 AZX_NUM_DRIVERS, /* keep this as last entry */ 270 271 }; ··· 331 330 [AZX_DRIVER_TERA] = "HDA Teradici", 332 331 [AZX_DRIVER_CTX] = "HDA Creative", 333 332 [AZX_DRIVER_CTHDA] = "HDA Creative", 333 + [AZX_DRIVER_CMEDIA] = "HDA C-Media", 334 334 [AZX_DRIVER_GENERIC] = "HD-Audio Generic", 335 335 }; 336 336 ··· 1375 1373 snoop = false; 1376 1374 break; 1377 1375 case AZX_DRIVER_CTHDA: 1376 + case AZX_DRIVER_CMEDIA: 1378 1377 snoop = false; 1379 1378 break; 1380 1379 } ··· 2157 2154 .driver_data = AZX_DRIVER_CTX | AZX_DCAPS_CTX_WORKAROUND | 2158 2155 AZX_DCAPS_RIRB_PRE_DELAY | AZX_DCAPS_POSFIX_LPIB }, 2159 2156 #endif 2157 + /* CM8888 */ 2158 + { PCI_DEVICE(0x13f6, 0x5011), 2159 + .driver_data = AZX_DRIVER_CMEDIA | 2160 + AZX_DCAPS_NO_MSI | AZX_DCAPS_POSFIX_LPIB }, 2160 2161 /* Vortex86MX */ 2161 2162 { PCI_DEVICE(0x17f3, 0x3010), .driver_data = AZX_DRIVER_GENERIC }, 2162 2163 /* VMware HDAudio */
+6 -1
sound/pci/hda/patch_ca0132.c
··· 4376 4376 return; /* NOP */ 4377 4377 #endif 4378 4378 4379 + if (spec->dsp_state == DSP_DOWNLOAD_FAILED) 4380 + return; /* don't retry failures */ 4381 + 4379 4382 chipio_enable_clocks(codec); 4380 4383 spec->dsp_state = DSP_DOWNLOADING; 4381 4384 if (!ca0132_download_dsp_images(codec)) ··· 4555 4552 struct auto_pin_cfg *cfg = &spec->autocfg; 4556 4553 int i; 4557 4554 4558 - spec->dsp_state = DSP_DOWNLOAD_INIT; 4555 + if (spec->dsp_state != DSP_DOWNLOAD_FAILED) 4556 + spec->dsp_state = DSP_DOWNLOAD_INIT; 4559 4557 spec->curr_chip_addx = INVALID_CHIP_ADDRESS; 4560 4558 4561 4559 snd_hda_power_up(codec); ··· 4667 4663 codec->spec = spec; 4668 4664 spec->codec = codec; 4669 4665 4666 + spec->dsp_state = DSP_DOWNLOAD_INIT; 4670 4667 spec->num_mixers = 1; 4671 4668 spec->mixers[0] = ca0132_mixer; 4672 4669
+47
sound/pci/hda/patch_cmedia.c
··· 75 75 return err; 76 76 } 77 77 78 + static 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 124 * patch entries 80 125 */ 81 126 static const struct hda_codec_preset snd_hda_preset_cmedia[] = { 127 + { .id = 0x13f68888, .name = "CMI8888", .patch = patch_cmi8888 }, 82 128 { .id = 0x13f69880, .name = "CMI9880", .patch = patch_cmi9880 }, 83 129 { .id = 0x434d4980, .name = "CMI9880", .patch = patch_cmi9880 }, 84 130 {} /* terminator */ 85 131 }; 86 132 133 + MODULE_ALIAS("snd-hda-codec-id:13f68888"); 87 134 MODULE_ALIAS("snd-hda-codec-id:13f69880"); 88 135 MODULE_ALIAS("snd-hda-codec-id:434d4980"); 89 136
+6
sound/pci/hda/patch_conexant.c
··· 26 26 #include <linux/module.h> 27 27 #include <sound/core.h> 28 28 #include <sound/jack.h> 29 + #include <sound/tlv.h> 29 30 30 31 #include "hda_codec.h" 31 32 #include "hda_local.h" ··· 859 858 err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg); 860 859 if (err < 0) 861 860 goto error; 861 + 862 + if (codec->vendor_id == 0x14f15051) { 863 + /* minimum value is actually mute */ 864 + spec->gen.vmaster_tlv[3] |= TLV_DB_SCALE_MUTE; 865 + } 862 866 863 867 codec->patch_ops = cx_auto_patch_ops; 864 868
+34 -1
sound/pci/hda/patch_realtek.c
··· 2782 2782 return alc_parse_auto_config(codec, alc269_ignore, ssids); 2783 2783 } 2784 2784 2785 + static int find_ext_mic_pin(struct hda_codec *codec); 2786 + 2787 + static 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 + 2785 2806 static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up) 2786 2807 { 2787 2808 int val = alc_read_coef_idx(codec, 0x04); ··· 4093 4072 4094 4073 /* Avoid pop noises when headphones are plugged in */ 4095 4074 if (spec->gen.hp_jack_present) 4096 - if (nid == codec->afg || nid == 0x02) 4075 + if (nid == codec->afg || nid == 0x02 || nid == 0x15) 4097 4076 return AC_PWRST_D0; 4098 4077 return power_state; 4099 4078 } ··· 4103 4082 { 4104 4083 if (action == HDA_FIXUP_ACT_PROBE) { 4105 4084 struct alc_spec *spec = codec->spec; 4085 + struct hda_input_mux *imux = &spec->gen.input_mux; 4086 + int i; 4087 + 4106 4088 spec->shutup = alc_no_shutup; 4107 4089 codec->power_filter = alc_power_filter_xps13; 4090 + 4091 + /* Make the internal mic the default input source. */ 4092 + for (i = 0; i < imux->num_items; i++) { 4093 + if (spec->gen.imux_pins[i] == 0x12) { 4094 + spec->gen.cur_mux[0] = i; 4095 + break; 4096 + } 4097 + } 4108 4098 } 4109 4099 } 4110 4100 ··· 5416 5384 case 0x10ec0286: 5417 5385 case 0x10ec0288: 5418 5386 spec->codec_variant = ALC269_TYPE_ALC286; 5387 + spec->shutup = alc286_shutup; 5419 5388 break; 5420 5389 case 0x10ec0255: 5421 5390 spec->codec_variant = ALC269_TYPE_ALC255;
+29
sound/usb/quirks-table.h
··· 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 1613 /* only 44.1 kHz works at the moment */ 1585 1614 USB_DEVICE(0x0582, 0x0120), 1586 1615 .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {