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-3.9' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
"A collection of small fixes, as expected for the middle rc:
- A couple of fixes for potential NULL dereferences and out-of-range
array accesses revealed by static code parsers
- A fix for the wrong error handling detected by trinity
- A regression fix for missing audio on some MacBooks
- CA0132 DSP loader fixes
- Fix for EAPD control of IDT codecs on machines w/o speaker
- Fix a regression in the HD-audio widget list parser code
- Workaround for the NuForce UDH-100 USB audio"

* tag 'sound-3.9' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
ALSA: hda - Fix missing EAPD/GPIO setup for Cirrus codecs
sound: sequencer: cap array index in seq_chn_common_event()
ALSA: hda/ca0132 - Remove extra setting of dsp_state.
ALSA: hda/ca0132 - Check download state of DSP.
ALSA: hda/ca0132 - Check if dspload_image succeeded.
ALSA: hda - Disable IDT eapd_switch if there are no internal speakers
ALSA: hda - Fix snd_hda_get_num_raw_conns() to return a correct value
ALSA: usb-audio: add a workaround for the NuForce UDH-100
ALSA: asihpi - fix potential NULL pointer dereference
ALSA: seq: Fix missing error handling in snd_seq_timer_open()

+90 -29
+4 -4
sound/core/seq/seq_timer.c
··· 290 290 tid.device = SNDRV_TIMER_GLOBAL_SYSTEM; 291 291 err = snd_timer_open(&t, str, &tid, q->queue); 292 292 } 293 - if (err < 0) { 294 - snd_printk(KERN_ERR "seq fatal error: cannot create timer (%i)\n", err); 295 - return err; 296 - } 293 + } 294 + if (err < 0) { 295 + snd_printk(KERN_ERR "seq fatal error: cannot create timer (%i)\n", err); 296 + return err; 297 297 } 298 298 t->callback = snd_seq_timer_interrupt; 299 299 t->callback_data = q;
+6
sound/oss/sequencer.c
··· 545 545 case MIDI_PGM_CHANGE: 546 546 if (seq_mode == SEQ_2) 547 547 { 548 + if (chn > 15) 549 + break; 550 + 548 551 synth_devs[dev]->chn_info[chn].pgm_num = p1; 549 552 if ((int) dev >= num_synths) 550 553 synth_devs[dev]->set_instr(dev, chn, p1); ··· 599 596 case MIDI_PITCH_BEND: 600 597 if (seq_mode == SEQ_2) 601 598 { 599 + if (chn > 15) 600 + break; 601 + 602 602 synth_devs[dev]->chn_info[chn].bender_value = w14; 603 603 604 604 if ((int) dev < num_synths)
+2 -1
sound/pci/asihpi/asihpi.c
··· 2549 2549 2550 2550 static int snd_card_asihpi_mixer_new(struct snd_card_asihpi *asihpi) 2551 2551 { 2552 - struct snd_card *card = asihpi->card; 2552 + struct snd_card *card; 2553 2553 unsigned int idx = 0; 2554 2554 unsigned int subindex = 0; 2555 2555 int err; ··· 2557 2557 2558 2558 if (snd_BUG_ON(!asihpi)) 2559 2559 return -EINVAL; 2560 + card = asihpi->card; 2560 2561 strcpy(card->mixername, "Asihpi Mixer"); 2561 2562 2562 2563 err =
+15 -11
sound/pci/hda/hda_codec.c
··· 494 494 495 495 int snd_hda_get_num_raw_conns(struct hda_codec *codec, hda_nid_t nid) 496 496 { 497 - return get_num_conns(codec, nid) & AC_CLIST_LENGTH; 497 + return snd_hda_get_raw_connections(codec, nid, NULL, 0); 498 498 } 499 499 500 500 /** ··· 516 516 unsigned int shift, num_elems, mask; 517 517 hda_nid_t prev_nid; 518 518 int null_count = 0; 519 - 520 - if (snd_BUG_ON(!conn_list || max_conns <= 0)) 521 - return -EINVAL; 522 519 523 520 parm = get_num_conns(codec, nid); 524 521 if (!parm) ··· 542 545 AC_VERB_GET_CONNECT_LIST, 0); 543 546 if (parm == -1 && codec->bus->rirb_error) 544 547 return -EIO; 545 - conn_list[0] = parm & mask; 548 + if (conn_list) 549 + conn_list[0] = parm & mask; 546 550 return 1; 547 551 } 548 552 ··· 578 580 continue; 579 581 } 580 582 for (n = prev_nid + 1; n <= val; n++) { 581 - if (conns >= max_conns) 582 - return -ENOSPC; 583 - conn_list[conns++] = n; 583 + if (conn_list) { 584 + if (conns >= max_conns) 585 + return -ENOSPC; 586 + conn_list[conns] = n; 587 + } 588 + conns++; 584 589 } 585 590 } else { 586 - if (conns >= max_conns) 587 - return -ENOSPC; 588 - conn_list[conns++] = val; 591 + if (conn_list) { 592 + if (conns >= max_conns) 593 + return -ENOSPC; 594 + conn_list[conns] = val; 595 + } 596 + conns++; 589 597 } 590 598 prev_nid = val; 591 599 }
+15 -13
sound/pci/hda/patch_ca0132.c
··· 3239 3239 struct ca0132_spec *spec = codec->spec; 3240 3240 unsigned int tmp; 3241 3241 3242 - if (!dspload_is_loaded(codec)) 3242 + if (spec->dsp_state != DSP_DOWNLOADED) 3243 3243 return 0; 3244 3244 3245 3245 /* if CrystalVoice if off, vipsource should be 0 */ ··· 4267 4267 */ 4268 4268 static void ca0132_setup_defaults(struct hda_codec *codec) 4269 4269 { 4270 + struct ca0132_spec *spec = codec->spec; 4270 4271 unsigned int tmp; 4271 4272 int num_fx; 4272 4273 int idx, i; 4273 4274 4274 - if (!dspload_is_loaded(codec)) 4275 + if (spec->dsp_state != DSP_DOWNLOADED) 4275 4276 return; 4276 4277 4277 4278 /* out, in effects + voicefx */ ··· 4352 4351 return false; 4353 4352 4354 4353 dsp_os_image = (struct dsp_image_seg *)(fw_entry->data); 4355 - dspload_image(codec, dsp_os_image, 0, 0, true, 0); 4354 + if (dspload_image(codec, dsp_os_image, 0, 0, true, 0)) { 4355 + pr_err("ca0132 dspload_image failed.\n"); 4356 + goto exit_download; 4357 + } 4358 + 4356 4359 dsp_loaded = dspload_wait_loaded(codec); 4357 4360 4361 + exit_download: 4358 4362 release_firmware(fw_entry); 4359 - 4360 4363 4361 4364 return dsp_loaded; 4362 4365 } ··· 4372 4367 #ifndef CONFIG_SND_HDA_CODEC_CA0132_DSP 4373 4368 return; /* NOP */ 4374 4369 #endif 4375 - spec->dsp_state = DSP_DOWNLOAD_INIT; 4376 4370 4377 - if (spec->dsp_state == DSP_DOWNLOAD_INIT) { 4378 - chipio_enable_clocks(codec); 4379 - spec->dsp_state = DSP_DOWNLOADING; 4380 - if (!ca0132_download_dsp_images(codec)) 4381 - spec->dsp_state = DSP_DOWNLOAD_FAILED; 4382 - else 4383 - spec->dsp_state = DSP_DOWNLOADED; 4384 - } 4371 + chipio_enable_clocks(codec); 4372 + spec->dsp_state = DSP_DOWNLOADING; 4373 + if (!ca0132_download_dsp_images(codec)) 4374 + spec->dsp_state = DSP_DOWNLOAD_FAILED; 4375 + else 4376 + spec->dsp_state = DSP_DOWNLOADED; 4385 4377 4386 4378 if (spec->dsp_state == DSP_DOWNLOADED) 4387 4379 ca0132_set_dsp_msr(codec, true);
+4
sound/pci/hda/patch_cirrus.c
··· 506 506 if (!spec) 507 507 return -ENOMEM; 508 508 509 + spec->gen.automute_hook = cs_automute; 510 + 509 511 snd_hda_pick_fixup(codec, cs420x_models, cs420x_fixup_tbl, 510 512 cs420x_fixups); 511 513 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); ··· 894 892 spec = cs_alloc_spec(codec, CS4210_VENDOR_NID); 895 893 if (!spec) 896 894 return -ENOMEM; 895 + 896 + spec->gen.automute_hook = cs_automute; 897 897 898 898 snd_hda_pick_fixup(codec, cs421x_models, cs421x_fixup_tbl, 899 899 cs421x_fixups);
+29
sound/pci/hda/patch_sigmatel.c
··· 815 815 return 0; 816 816 } 817 817 818 + /* check whether a built-in speaker is included in parsed pins */ 819 + static bool has_builtin_speaker(struct hda_codec *codec) 820 + { 821 + struct sigmatel_spec *spec = codec->spec; 822 + hda_nid_t *nid_pin; 823 + int nids, i; 824 + 825 + if (spec->gen.autocfg.line_out_type == AUTO_PIN_SPEAKER_OUT) { 826 + nid_pin = spec->gen.autocfg.line_out_pins; 827 + nids = spec->gen.autocfg.line_outs; 828 + } else { 829 + nid_pin = spec->gen.autocfg.speaker_pins; 830 + nids = spec->gen.autocfg.speaker_outs; 831 + } 832 + 833 + for (i = 0; i < nids; i++) { 834 + unsigned int def_conf = snd_hda_codec_get_pincfg(codec, nid_pin[i]); 835 + if (snd_hda_get_input_pin_attr(def_conf) == INPUT_PIN_ATTR_INT) 836 + return true; 837 + } 838 + return false; 839 + } 840 + 818 841 /* 819 842 * PC beep controls 820 843 */ ··· 3912 3889 stac_free(codec); 3913 3890 return err; 3914 3891 } 3892 + 3893 + /* Don't GPIO-mute speakers if there are no internal speakers, because 3894 + * the GPIO might be necessary for Headphone 3895 + */ 3896 + if (spec->eapd_switch && !has_builtin_speaker(codec)) 3897 + spec->eapd_switch = 0; 3915 3898 3916 3899 codec->proc_widget_hook = stac92hd7x_proc_hook; 3917 3900
+15
sound/usb/card.c
··· 244 244 usb_ifnum_to_if(dev, ctrlif)->intf_assoc; 245 245 246 246 if (!assoc) { 247 + /* 248 + * Firmware writers cannot count to three. So to find 249 + * the IAD on the NuForce UDH-100, also check the next 250 + * interface. 251 + */ 252 + struct usb_interface *iface = 253 + usb_ifnum_to_if(dev, ctrlif + 1); 254 + if (iface && 255 + iface->intf_assoc && 256 + iface->intf_assoc->bFunctionClass == USB_CLASS_AUDIO && 257 + iface->intf_assoc->bFunctionProtocol == UAC_VERSION_2) 258 + assoc = iface->intf_assoc; 259 + } 260 + 261 + if (!assoc) { 247 262 snd_printk(KERN_ERR "Audio class v2 interfaces need an interface association\n"); 248 263 return -EINVAL; 249 264 }