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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'sound-5.1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
"A few stable fixes at this round.

The USB Line6 audio fixes are a bit large, but they are rather trivial
and pretty much device-specific, so should be safe to apply at this
late stage. Ditto for other HD-audio quirks"

* tag 'sound-5.1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
ALSA: hda/realtek - Apply the fixup for ASUS Q325UAR
ALSA: line6: use dynamic buffers
ALSA: hda/realtek - Fixed Dell AIO speaker noise
ALSA: hda/realtek - Add new Dell platform for headset mode

+78 -40
+13
sound/pci/hda/patch_realtek.c
··· 5450 5450 return; 5451 5451 5452 5452 spec->gen.preferred_dacs = preferred_pairs; 5453 + spec->gen.auto_mute_via_amp = 1; 5454 + codec->power_save_node = 0; 5453 5455 } 5454 5456 5455 5457 /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */ ··· 7270 7268 {0x21, 0x02211020}), 7271 7269 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 7272 7270 {0x21, 0x02211020}), 7271 + SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 7272 + {0x12, 0x40000000}, 7273 + {0x14, 0x90170110}, 7274 + {0x21, 0x02211020}), 7273 7275 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, 7274 7276 {0x14, 0x90170110}, 7275 7277 {0x21, 0x02211020}), ··· 7546 7540 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK, 7547 7541 {0x12, 0x90a60130}, 7548 7542 {0x17, 0x90170110}, 7543 + {0x21, 0x04211020}), 7544 + SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK, 7545 + {0x12, 0x90a60130}, 7546 + {0x17, 0x90170110}, 7547 + {0x21, 0x03211020}), 7548 + SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, 7549 + {0x14, 0x90170110}, 7549 7550 {0x21, 0x04211020}), 7550 7551 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, 7551 7552 ALC295_STANDARD_PINS,
+35 -25
sound/usb/line6/driver.c
··· 351 351 { 352 352 struct usb_device *usbdev = line6->usbdev; 353 353 int ret; 354 - unsigned char len; 354 + unsigned char *len; 355 355 unsigned count; 356 356 357 357 if (address > 0xffff || datalen > 0xff) 358 358 return -EINVAL; 359 + 360 + len = kmalloc(sizeof(*len), GFP_KERNEL); 361 + if (!len) 362 + return -ENOMEM; 359 363 360 364 /* query the serial number: */ 361 365 ret = usb_control_msg(usbdev, usb_sndctrlpipe(usbdev, 0), 0x67, ··· 369 365 370 366 if (ret < 0) { 371 367 dev_err(line6->ifcdev, "read request failed (error %d)\n", ret); 372 - return ret; 368 + goto exit; 373 369 } 374 370 375 371 /* Wait for data length. We'll get 0xff until length arrives. */ ··· 379 375 ret = usb_control_msg(usbdev, usb_rcvctrlpipe(usbdev, 0), 0x67, 380 376 USB_TYPE_VENDOR | USB_RECIP_DEVICE | 381 377 USB_DIR_IN, 382 - 0x0012, 0x0000, &len, 1, 378 + 0x0012, 0x0000, len, 1, 383 379 LINE6_TIMEOUT * HZ); 384 380 if (ret < 0) { 385 381 dev_err(line6->ifcdev, 386 382 "receive length failed (error %d)\n", ret); 387 - return ret; 383 + goto exit; 388 384 } 389 385 390 - if (len != 0xff) 386 + if (*len != 0xff) 391 387 break; 392 388 } 393 389 394 - if (len == 0xff) { 390 + ret = -EIO; 391 + if (*len == 0xff) { 395 392 dev_err(line6->ifcdev, "read failed after %d retries\n", 396 393 count); 397 - return -EIO; 398 - } else if (len != datalen) { 394 + goto exit; 395 + } else if (*len != datalen) { 399 396 /* should be equal or something went wrong */ 400 397 dev_err(line6->ifcdev, 401 398 "length mismatch (expected %d, got %d)\n", 402 - (int)datalen, (int)len); 403 - return -EIO; 399 + (int)datalen, (int)*len); 400 + goto exit; 404 401 } 405 402 406 403 /* receive the result: */ ··· 410 405 0x0013, 0x0000, data, datalen, 411 406 LINE6_TIMEOUT * HZ); 412 407 413 - if (ret < 0) { 408 + if (ret < 0) 414 409 dev_err(line6->ifcdev, "read failed (error %d)\n", ret); 415 - return ret; 416 - } 417 410 418 - return 0; 411 + exit: 412 + kfree(len); 413 + return ret; 419 414 } 420 415 EXPORT_SYMBOL_GPL(line6_read_data); 421 416 ··· 427 422 { 428 423 struct usb_device *usbdev = line6->usbdev; 429 424 int ret; 430 - unsigned char status; 425 + unsigned char *status; 431 426 int count; 432 427 433 428 if (address > 0xffff || datalen > 0xffff) 434 429 return -EINVAL; 430 + 431 + status = kmalloc(sizeof(*status), GFP_KERNEL); 432 + if (!status) 433 + return -ENOMEM; 435 434 436 435 ret = usb_control_msg(usbdev, usb_sndctrlpipe(usbdev, 0), 0x67, 437 436 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT, ··· 445 436 if (ret < 0) { 446 437 dev_err(line6->ifcdev, 447 438 "write request failed (error %d)\n", ret); 448 - return ret; 439 + goto exit; 449 440 } 450 441 451 442 for (count = 0; count < LINE6_READ_WRITE_MAX_RETRIES; count++) { ··· 456 447 USB_TYPE_VENDOR | USB_RECIP_DEVICE | 457 448 USB_DIR_IN, 458 449 0x0012, 0x0000, 459 - &status, 1, LINE6_TIMEOUT * HZ); 450 + status, 1, LINE6_TIMEOUT * HZ); 460 451 461 452 if (ret < 0) { 462 453 dev_err(line6->ifcdev, 463 454 "receiving status failed (error %d)\n", ret); 464 - return ret; 455 + goto exit; 465 456 } 466 457 467 - if (status != 0xff) 458 + if (*status != 0xff) 468 459 break; 469 460 } 470 461 471 - if (status == 0xff) { 462 + if (*status == 0xff) { 472 463 dev_err(line6->ifcdev, "write failed after %d retries\n", 473 464 count); 474 - return -EIO; 475 - } else if (status != 0) { 465 + ret = -EIO; 466 + } else if (*status != 0) { 476 467 dev_err(line6->ifcdev, "write failed (error %d)\n", ret); 477 - return -EIO; 468 + ret = -EIO; 478 469 } 479 - 480 - return 0; 470 + exit: 471 + kfree(status); 472 + return ret; 481 473 } 482 474 EXPORT_SYMBOL_GPL(line6_write_data); 483 475
+12 -9
sound/usb/line6/podhd.c
··· 225 225 static int podhd_dev_start(struct usb_line6_podhd *pod) 226 226 { 227 227 int ret; 228 - u8 init_bytes[8]; 228 + u8 *init_bytes; 229 229 int i; 230 230 struct usb_device *usbdev = pod->line6.usbdev; 231 + 232 + init_bytes = kmalloc(8, GFP_KERNEL); 233 + if (!init_bytes) 234 + return -ENOMEM; 231 235 232 236 ret = usb_control_msg(usbdev, usb_sndctrlpipe(usbdev, 0), 233 237 0x67, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT, ··· 239 235 NULL, 0, LINE6_TIMEOUT * HZ); 240 236 if (ret < 0) { 241 237 dev_err(pod->line6.ifcdev, "read request failed (error %d)\n", ret); 242 - return ret; 238 + goto exit; 243 239 } 244 240 245 241 /* NOTE: looks like some kind of ping message */ 246 242 ret = usb_control_msg(usbdev, usb_rcvctrlpipe(usbdev, 0), 0x67, 247 243 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN, 248 244 0x11, 0x0, 249 - &init_bytes, 3, LINE6_TIMEOUT * HZ); 245 + init_bytes, 3, LINE6_TIMEOUT * HZ); 250 246 if (ret < 0) { 251 247 dev_err(pod->line6.ifcdev, 252 248 "receive length failed (error %d)\n", ret); 253 - return ret; 249 + goto exit; 254 250 } 255 251 256 252 pod->firmware_version = ··· 259 255 for (i = 0; i <= 16; i++) { 260 256 ret = line6_read_data(&pod->line6, 0xf000 + 0x08 * i, init_bytes, 8); 261 257 if (ret < 0) 262 - return ret; 258 + goto exit; 263 259 } 264 260 265 261 ret = usb_control_msg(usbdev, usb_sndctrlpipe(usbdev, 0), ··· 267 263 USB_TYPE_STANDARD | USB_RECIP_DEVICE | USB_DIR_OUT, 268 264 1, 0, 269 265 NULL, 0, LINE6_TIMEOUT * HZ); 270 - if (ret < 0) 271 - return ret; 272 - 273 - return 0; 266 + exit: 267 + kfree(init_bytes); 268 + return ret; 274 269 } 275 270 276 271 static void podhd_startup_workqueue(struct work_struct *work)
+18 -6
sound/usb/line6/toneport.c
··· 365 365 /* 366 366 Setup Toneport device. 367 367 */ 368 - static void toneport_setup(struct usb_line6_toneport *toneport) 368 + static int toneport_setup(struct usb_line6_toneport *toneport) 369 369 { 370 - u32 ticks; 370 + u32 *ticks; 371 371 struct usb_line6 *line6 = &toneport->line6; 372 372 struct usb_device *usbdev = line6->usbdev; 373 373 374 + ticks = kmalloc(sizeof(*ticks), GFP_KERNEL); 375 + if (!ticks) 376 + return -ENOMEM; 377 + 374 378 /* sync time on device with host: */ 375 379 /* note: 32-bit timestamps overflow in year 2106 */ 376 - ticks = (u32)ktime_get_real_seconds(); 377 - line6_write_data(line6, 0x80c6, &ticks, 4); 380 + *ticks = (u32)ktime_get_real_seconds(); 381 + line6_write_data(line6, 0x80c6, ticks, 4); 382 + kfree(ticks); 378 383 379 384 /* enable device: */ 380 385 toneport_send_cmd(usbdev, 0x0301, 0x0000); ··· 394 389 toneport_update_led(toneport); 395 390 396 391 mod_timer(&toneport->timer, jiffies + TONEPORT_PCM_DELAY * HZ); 392 + return 0; 397 393 } 398 394 399 395 /* ··· 457 451 return err; 458 452 } 459 453 460 - toneport_setup(toneport); 454 + err = toneport_setup(toneport); 455 + if (err) 456 + return err; 461 457 462 458 /* register audio system: */ 463 459 return snd_card_register(line6->card); ··· 471 463 */ 472 464 static int toneport_reset_resume(struct usb_interface *interface) 473 465 { 474 - toneport_setup(usb_get_intfdata(interface)); 466 + int err; 467 + 468 + err = toneport_setup(usb_get_intfdata(interface)); 469 + if (err) 470 + return err; 475 471 return line6_resume(interface); 476 472 } 477 473 #endif