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

Configure Feed

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

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

Pull sound fixes from Takashi Iwai:
"This batch contains a few USB audio fixes, a couple of HD-audio
quirks, various small ASoC driver fixes in addition to an ASoC core
fix that may lead to memory corruption.

Unfortunately slightly more volume than the previous pull request, but
all are reasonable regression fixes"

* tag 'sound-3.11' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
ALSA: hda - Add a fixup for Gateway LT27
ASoC: tegra: fix Tegra30 I2S capture parameter setup
ALSA: usb-audio: Fix invalid volume resolution for Logitech HD Webcam C525
ALSA: hda - Fix missing mute controls for CX5051
ALSA: usb-audio: fix automatic Roland/Yamaha MIDI detection
ALSA: 6fire: make buffers DMA-able (midi)
ALSA: 6fire: make buffers DMA-able (pcm)
ALSA: hda - Add pinfix for LG LW25 laptop
ASoC: cs42l52: Add new TLV for Beep Volume
ASoC: cs42l52: Reorder Min/Max and update to SX_TLV for Beep Volume
ASoC: dapm: Fix empty list check in dapm_new_mux()
ASoC: sgtl5000: fix buggy 'Capture Attenuate Switch' control
ASoC: sgtl5000: prevent playback to be muted when terminating concurrent capture

+98 -23
+3 -3
sound/pci/hda/hda_generic.c
··· 522 522 } 523 523 524 524 #define nid_has_mute(codec, nid, dir) \ 525 - check_amp_caps(codec, nid, dir, AC_AMPCAP_MUTE) 525 + check_amp_caps(codec, nid, dir, (AC_AMPCAP_MUTE | AC_AMPCAP_MIN_MUTE)) 526 526 #define nid_has_volume(codec, nid, dir) \ 527 527 check_amp_caps(codec, nid, dir, AC_AMPCAP_NUM_STEPS) 528 528 ··· 624 624 if (enable) 625 625 val = (caps & AC_AMPCAP_OFFSET) >> AC_AMPCAP_OFFSET_SHIFT; 626 626 } 627 - if (caps & AC_AMPCAP_MUTE) { 627 + if (caps & (AC_AMPCAP_MUTE | AC_AMPCAP_MIN_MUTE)) { 628 628 if (!enable) 629 629 val |= HDA_AMP_MUTE; 630 630 } ··· 648 648 { 649 649 unsigned int mask = 0xff; 650 650 651 - if (caps & AC_AMPCAP_MUTE) { 651 + if (caps & (AC_AMPCAP_MUTE | AC_AMPCAP_MIN_MUTE)) { 652 652 if (is_ctl_associated(codec, nid, dir, idx, NID_PATH_MUTE_CTL)) 653 653 mask &= ~0x80; 654 654 }
+11
sound/pci/hda/patch_realtek.c
··· 1031 1031 ALC880_FIXUP_GPIO2, 1032 1032 ALC880_FIXUP_MEDION_RIM, 1033 1033 ALC880_FIXUP_LG, 1034 + ALC880_FIXUP_LG_LW25, 1034 1035 ALC880_FIXUP_W810, 1035 1036 ALC880_FIXUP_EAPD_COEF, 1036 1037 ALC880_FIXUP_TCL_S700, ··· 1087 1086 { 0x16, 0x411111f0 }, 1088 1087 { 0x18, 0x411111f0 }, 1089 1088 { 0x1a, 0x411111f0 }, 1089 + { } 1090 + } 1091 + }, 1092 + [ALC880_FIXUP_LG_LW25] = { 1093 + .type = HDA_FIXUP_PINS, 1094 + .v.pins = (const struct hda_pintbl[]) { 1095 + { 0x1a, 0x0181344f }, /* line-in */ 1096 + { 0x1b, 0x0321403f }, /* headphone */ 1090 1097 { } 1091 1098 } 1092 1099 }, ··· 1350 1341 SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG), 1351 1342 SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG), 1352 1343 SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG), 1344 + SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25), 1353 1345 SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700), 1354 1346 1355 1347 /* Below is the copied entries from alc880_quirks.c. ··· 4339 4329 SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE), 4340 4330 SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE), 4341 4331 SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC), 4332 + SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC), 4342 4333 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE), 4343 4334 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), 4344 4335 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
+4 -1
sound/soc/codecs/cs42l52.c
··· 195 195 196 196 static DECLARE_TLV_DB_SCALE(mix_tlv, -50, 50, 0); 197 197 198 + static DECLARE_TLV_DB_SCALE(beep_tlv, -56, 200, 0); 199 + 198 200 static const unsigned int limiter_tlv[] = { 199 201 TLV_DB_RANGE_HEAD(2), 200 202 0, 2, TLV_DB_SCALE_ITEM(-3000, 600, 0), ··· 453 451 SOC_ENUM("Beep Pitch", beep_pitch_enum), 454 452 SOC_ENUM("Beep on Time", beep_ontime_enum), 455 453 SOC_ENUM("Beep off Time", beep_offtime_enum), 456 - SOC_SINGLE_TLV("Beep Volume", CS42L52_BEEP_VOL, 0, 0x1f, 0x07, hl_tlv), 454 + SOC_SINGLE_SX_TLV("Beep Volume", CS42L52_BEEP_VOL, 455 + 0, 0x07, 0x1f, beep_tlv), 457 456 SOC_SINGLE("Beep Mixer Switch", CS42L52_BEEP_TONE_CTL, 5, 1, 1), 458 457 SOC_ENUM("Beep Treble Corner Freq", beep_treble_enum), 459 458 SOC_ENUM("Beep Bass Corner Freq", beep_bass_enum),
+14 -4
sound/soc/codecs/sgtl5000.c
··· 153 153 static int power_vag_event(struct snd_soc_dapm_widget *w, 154 154 struct snd_kcontrol *kcontrol, int event) 155 155 { 156 + const u32 mask = SGTL5000_DAC_POWERUP | SGTL5000_ADC_POWERUP; 157 + 156 158 switch (event) { 157 159 case SND_SOC_DAPM_POST_PMU: 158 160 snd_soc_update_bits(w->codec, SGTL5000_CHIP_ANA_POWER, ··· 162 160 break; 163 161 164 162 case SND_SOC_DAPM_PRE_PMD: 165 - snd_soc_update_bits(w->codec, SGTL5000_CHIP_ANA_POWER, 166 - SGTL5000_VAG_POWERUP, 0); 167 - msleep(400); 163 + /* 164 + * Don't clear VAG_POWERUP, when both DAC and ADC are 165 + * operational to prevent inadvertently starving the 166 + * other one of them. 167 + */ 168 + if ((snd_soc_read(w->codec, SGTL5000_CHIP_ANA_POWER) & 169 + mask) != mask) { 170 + snd_soc_update_bits(w->codec, SGTL5000_CHIP_ANA_POWER, 171 + SGTL5000_VAG_POWERUP, 0); 172 + msleep(400); 173 + } 168 174 break; 169 175 default: 170 176 break; ··· 398 388 SOC_DOUBLE("Capture Volume", SGTL5000_CHIP_ANA_ADC_CTRL, 0, 4, 0xf, 0), 399 389 SOC_SINGLE_TLV("Capture Attenuate Switch (-6dB)", 400 390 SGTL5000_CHIP_ANA_ADC_CTRL, 401 - 8, 2, 0, capture_6db_attenuate), 391 + 8, 1, 0, capture_6db_attenuate), 402 392 SOC_SINGLE("Capture ZC Switch", SGTL5000_CHIP_ANA_CTRL, 1, 1, 0), 403 393 404 394 SOC_DOUBLE_TLV("Headphone Playback Volume",
+4 -3
sound/soc/soc-dapm.c
··· 679 679 return -EINVAL; 680 680 } 681 681 682 - path = list_first_entry(&w->sources, struct snd_soc_dapm_path, 683 - list_sink); 684 - if (!path) { 682 + if (list_empty(&w->sources)) { 685 683 dev_err(dapm->dev, "ASoC: mux %s has no paths\n", w->name); 686 684 return -EINVAL; 687 685 } 686 + 687 + path = list_first_entry(&w->sources, struct snd_soc_dapm_path, 688 + list_sink); 688 689 689 690 ret = dapm_create_or_share_mixmux_kcontrol(w, 0, path); 690 691 if (ret < 0)
+1 -1
sound/soc/tegra/tegra30_i2s.c
··· 228 228 reg = TEGRA30_I2S_CIF_RX_CTRL; 229 229 } else { 230 230 val |= TEGRA30_AUDIOCIF_CTRL_DIRECTION_TX; 231 - reg = TEGRA30_I2S_CIF_RX_CTRL; 231 + reg = TEGRA30_I2S_CIF_TX_CTRL; 232 232 } 233 233 234 234 regmap_write(i2s->regmap, reg, val);
+15 -1
sound/usb/6fire/midi.c
··· 19 19 #include "chip.h" 20 20 #include "comm.h" 21 21 22 + enum { 23 + MIDI_BUFSIZE = 64 24 + }; 25 + 22 26 static void usb6fire_midi_out_handler(struct urb *urb) 23 27 { 24 28 struct midi_runtime *rt = urb->context; ··· 160 156 if (!rt) 161 157 return -ENOMEM; 162 158 159 + rt->out_buffer = kzalloc(MIDI_BUFSIZE, GFP_KERNEL); 160 + if (!rt->out_buffer) { 161 + kfree(rt); 162 + return -ENOMEM; 163 + } 164 + 163 165 rt->chip = chip; 164 166 rt->in_received = usb6fire_midi_in_received; 165 167 rt->out_buffer[0] = 0x80; /* 'send midi' command */ ··· 179 169 180 170 ret = snd_rawmidi_new(chip->card, "6FireUSB", 0, 1, 1, &rt->instance); 181 171 if (ret < 0) { 172 + kfree(rt->out_buffer); 182 173 kfree(rt); 183 174 snd_printk(KERN_ERR PREFIX "unable to create midi.\n"); 184 175 return ret; ··· 208 197 209 198 void usb6fire_midi_destroy(struct sfire_chip *chip) 210 199 { 211 - kfree(chip->midi); 200 + struct midi_runtime *rt = chip->midi; 201 + 202 + kfree(rt->out_buffer); 203 + kfree(rt); 212 204 chip->midi = NULL; 213 205 }
+1 -5
sound/usb/6fire/midi.h
··· 16 16 17 17 #include "common.h" 18 18 19 - enum { 20 - MIDI_BUFSIZE = 64 21 - }; 22 - 23 19 struct midi_runtime { 24 20 struct sfire_chip *chip; 25 21 struct snd_rawmidi *instance; ··· 28 32 struct snd_rawmidi_substream *out; 29 33 struct urb out_urb; 30 34 u8 out_serial; /* serial number of out packet */ 31 - u8 out_buffer[MIDI_BUFSIZE]; 35 + u8 *out_buffer; 32 36 int buffer_offset; 33 37 34 38 void (*in_received)(struct midi_runtime *rt, u8 *data, int length);
+40 -1
sound/usb/6fire/pcm.c
··· 582 582 urb->instance.number_of_packets = PCM_N_PACKETS_PER_URB; 583 583 } 584 584 585 + static int usb6fire_pcm_buffers_init(struct pcm_runtime *rt) 586 + { 587 + int i; 588 + 589 + for (i = 0; i < PCM_N_URBS; i++) { 590 + rt->out_urbs[i].buffer = kzalloc(PCM_N_PACKETS_PER_URB 591 + * PCM_MAX_PACKET_SIZE, GFP_KERNEL); 592 + if (!rt->out_urbs[i].buffer) 593 + return -ENOMEM; 594 + rt->in_urbs[i].buffer = kzalloc(PCM_N_PACKETS_PER_URB 595 + * PCM_MAX_PACKET_SIZE, GFP_KERNEL); 596 + if (!rt->in_urbs[i].buffer) 597 + return -ENOMEM; 598 + } 599 + return 0; 600 + } 601 + 602 + static void usb6fire_pcm_buffers_destroy(struct pcm_runtime *rt) 603 + { 604 + int i; 605 + 606 + for (i = 0; i < PCM_N_URBS; i++) { 607 + kfree(rt->out_urbs[i].buffer); 608 + kfree(rt->in_urbs[i].buffer); 609 + } 610 + } 611 + 585 612 int usb6fire_pcm_init(struct sfire_chip *chip) 586 613 { 587 614 int i; ··· 619 592 620 593 if (!rt) 621 594 return -ENOMEM; 595 + 596 + ret = usb6fire_pcm_buffers_init(rt); 597 + if (ret) { 598 + usb6fire_pcm_buffers_destroy(rt); 599 + kfree(rt); 600 + return ret; 601 + } 622 602 623 603 rt->chip = chip; 624 604 rt->stream_state = STREAM_DISABLED; ··· 648 614 649 615 ret = snd_pcm_new(chip->card, "DMX6FireUSB", 0, 1, 1, &pcm); 650 616 if (ret < 0) { 617 + usb6fire_pcm_buffers_destroy(rt); 651 618 kfree(rt); 652 619 snd_printk(KERN_ERR PREFIX "cannot create pcm instance.\n"); 653 620 return ret; ··· 660 625 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &pcm_ops); 661 626 662 627 if (ret) { 628 + usb6fire_pcm_buffers_destroy(rt); 663 629 kfree(rt); 664 630 snd_printk(KERN_ERR PREFIX 665 631 "error preallocating pcm buffers.\n"); ··· 705 669 706 670 void usb6fire_pcm_destroy(struct sfire_chip *chip) 707 671 { 708 - kfree(chip->pcm); 672 + struct pcm_runtime *rt = chip->pcm; 673 + 674 + usb6fire_pcm_buffers_destroy(rt); 675 + kfree(rt); 709 676 chip->pcm = NULL; 710 677 }
+1 -1
sound/usb/6fire/pcm.h
··· 32 32 struct urb instance; 33 33 struct usb_iso_packet_descriptor packets[PCM_N_PACKETS_PER_URB]; 34 34 /* END DO NOT SEPARATE */ 35 - u8 buffer[PCM_N_PACKETS_PER_URB * PCM_MAX_PACKET_SIZE]; 35 + u8 *buffer; 36 36 37 37 struct pcm_urb *peer; 38 38 };
+1
sound/usb/mixer.c
··· 888 888 case USB_ID(0x046d, 0x081b): /* HD Webcam c310 */ 889 889 case USB_ID(0x046d, 0x081d): /* HD Webcam c510 */ 890 890 case USB_ID(0x046d, 0x0825): /* HD Webcam c270 */ 891 + case USB_ID(0x046d, 0x0826): /* HD Webcam c525 */ 891 892 case USB_ID(0x046d, 0x0991): 892 893 /* Most audio usb devices lie about volume resolution. 893 894 * Most Logitech webcams have res = 384.
+3 -3
sound/usb/quirks.c
··· 319 319 if (altsd->bNumEndpoints < 1) 320 320 return -ENODEV; 321 321 epd = get_endpoint(alts, 0); 322 - if (!usb_endpoint_xfer_bulk(epd) || 322 + if (!usb_endpoint_xfer_bulk(epd) && 323 323 !usb_endpoint_xfer_int(epd)) 324 324 return -ENODEV; 325 325 326 326 switch (USB_ID_VENDOR(chip->usb_id)) { 327 327 case 0x0499: /* Yamaha */ 328 328 err = create_yamaha_midi_quirk(chip, iface, driver, alts); 329 - if (err < 0 && err != -ENODEV) 329 + if (err != -ENODEV) 330 330 return err; 331 331 break; 332 332 case 0x0582: /* Roland */ 333 333 err = create_roland_midi_quirk(chip, iface, driver, alts); 334 - if (err < 0 && err != -ENODEV) 334 + if (err != -ENODEV) 335 335 return err; 336 336 break; 337 337 }