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

Pull sound fixes from Takashi Iwai:
"Nothing too serious here: a couple of compress-offload core fixes,
Haswell HDMI audio fix, a fixup for new MacBook Airs and a few COEF
setups for ALC283 mic problems"

* tag 'sound-3.12' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
ALSA: hda - Enable internal mic on a Thinkpad machine with ALC283
ALSA: hda - Fix Internal Mic boost can't control with ALC283
ALSA: hda - Add documentation for CS4208 fixups
ALSA: hda - Add fixup for MacBook Air 6,1 and 6,2 with CS4208 codec
ALSA : hda - not use assigned converters for all unused pins
ALSA: compress: Make sure we trigger STOP before closing the stream.
ALSA: compress: Fix compress device unregister.

+132 -26
+6
Documentation/sound/alsa/HD-Audio-Models.txt
··· 296 296 imac27 IMac 27 Inch 297 297 auto BIOS setup (default) 298 298 299 + Cirrus Logic CS4208 300 + =================== 301 + mba6 MacBook Air 6,1 and 6,2 302 + gpio0 Enable GPIO 0 amp 303 + auto BIOS setup (default) 304 + 299 305 VIA VT17xx/VT18xx/VT20xx 300 306 ======================== 301 307 auto BIOS setup (default)
+14 -1
sound/core/compress_offload.c
··· 139 139 static int snd_compr_free(struct inode *inode, struct file *f) 140 140 { 141 141 struct snd_compr_file *data = f->private_data; 142 + struct snd_compr_runtime *runtime = data->stream.runtime; 143 + 144 + switch (runtime->state) { 145 + case SNDRV_PCM_STATE_RUNNING: 146 + case SNDRV_PCM_STATE_DRAINING: 147 + case SNDRV_PCM_STATE_PAUSED: 148 + data->stream.ops->trigger(&data->stream, SNDRV_PCM_TRIGGER_STOP); 149 + break; 150 + default: 151 + break; 152 + } 153 + 142 154 data->stream.ops->free(&data->stream); 143 155 kfree(data->stream.runtime->buffer); 144 156 kfree(data->stream.runtime); ··· 849 837 struct snd_compr *compr; 850 838 851 839 compr = device->device_data; 852 - snd_unregister_device(compr->direction, compr->card, compr->device); 840 + snd_unregister_device(SNDRV_DEVICE_TYPE_COMPRESS, compr->card, 841 + compr->device); 853 842 return 0; 854 843 } 855 844
+67 -5
sound/pci/hda/patch_cirrus.c
··· 111 111 /* 0x0009 - 0x0014 -> 12 test regs */ 112 112 /* 0x0015 - visibility reg */ 113 113 114 + /* Cirrus Logic CS4208 */ 115 + #define CS4208_VENDOR_NID 0x24 116 + 114 117 /* 115 118 * Cirrus Logic CS4210 116 119 * ··· 226 223 {} /* terminator */ 227 224 }; 228 225 226 + static const struct hda_verb cs4208_coef_init_verbs[] = { 227 + {0x01, AC_VERB_SET_POWER_STATE, 0x00}, /* AFG: D0 */ 228 + {0x24, AC_VERB_SET_PROC_STATE, 0x01}, /* VPW: processing on */ 229 + {0x24, AC_VERB_SET_COEF_INDEX, 0x0033}, 230 + {0x24, AC_VERB_SET_PROC_COEF, 0x0001}, /* A1 ICS */ 231 + {0x24, AC_VERB_SET_COEF_INDEX, 0x0034}, 232 + {0x24, AC_VERB_SET_PROC_COEF, 0x1C01}, /* A1 Enable, A Thresh = 300mV */ 233 + {} /* terminator */ 234 + }; 235 + 229 236 /* Errata: CS4207 rev C0/C1/C2 Silicon 230 237 * 231 238 * http://www.cirrus.com/en/pubs/errata/ER880C3.pdf ··· 308 295 /* init_verb sequence for C0/C1/C2 errata*/ 309 296 snd_hda_sequence_write(codec, cs_errata_init_verbs); 310 297 snd_hda_sequence_write(codec, cs_coef_init_verbs); 298 + } else if (spec->vendor_nid == CS4208_VENDOR_NID) { 299 + snd_hda_sequence_write(codec, cs4208_coef_init_verbs); 311 300 } 312 301 313 302 snd_hda_gen_init(codec); ··· 449 434 {} /* terminator */ 450 435 }; 451 436 437 + static const struct hda_pintbl mba6_pincfgs[] = { 438 + { 0x10, 0x032120f0 }, /* HP */ 439 + { 0x11, 0x500000f0 }, 440 + { 0x12, 0x90100010 }, /* Speaker */ 441 + { 0x13, 0x500000f0 }, 442 + { 0x14, 0x500000f0 }, 443 + { 0x15, 0x770000f0 }, 444 + { 0x16, 0x770000f0 }, 445 + { 0x17, 0x430000f0 }, 446 + { 0x18, 0x43ab9030 }, /* Mic */ 447 + { 0x19, 0x770000f0 }, 448 + { 0x1a, 0x770000f0 }, 449 + { 0x1b, 0x770000f0 }, 450 + { 0x1c, 0x90a00090 }, 451 + { 0x1d, 0x500000f0 }, 452 + { 0x1e, 0x500000f0 }, 453 + { 0x1f, 0x500000f0 }, 454 + { 0x20, 0x500000f0 }, 455 + { 0x21, 0x430000f0 }, 456 + { 0x22, 0x430000f0 }, 457 + {} /* terminator */ 458 + }; 459 + 452 460 static void cs420x_fixup_gpio_13(struct hda_codec *codec, 453 461 const struct hda_fixup *fix, int action) 454 462 { ··· 594 556 595 557 /* 596 558 * CS4208 support: 597 - * Its layout is no longer compatible with CS4206/CS4207, and the generic 598 - * parser seems working fairly well, except for trivial fixups. 559 + * Its layout is no longer compatible with CS4206/CS4207 599 560 */ 600 561 enum { 562 + CS4208_MBA6, 601 563 CS4208_GPIO0, 602 564 }; 603 565 604 566 static const struct hda_model_fixup cs4208_models[] = { 605 567 { .id = CS4208_GPIO0, .name = "gpio0" }, 568 + { .id = CS4208_MBA6, .name = "mba6" }, 606 569 {} 607 570 }; 608 571 609 572 static const struct snd_pci_quirk cs4208_fixup_tbl[] = { 610 573 /* codec SSID */ 611 - SND_PCI_QUIRK(0x106b, 0x7100, "MacBookPro 6,1", CS4208_GPIO0), 612 - SND_PCI_QUIRK(0x106b, 0x7200, "MacBookPro 6,2", CS4208_GPIO0), 574 + SND_PCI_QUIRK(0x106b, 0x7100, "MacBookAir 6,1", CS4208_MBA6), 575 + SND_PCI_QUIRK(0x106b, 0x7200, "MacBookAir 6,2", CS4208_MBA6), 613 576 {} /* terminator */ 614 577 }; 615 578 ··· 627 588 } 628 589 629 590 static const struct hda_fixup cs4208_fixups[] = { 591 + [CS4208_MBA6] = { 592 + .type = HDA_FIXUP_PINS, 593 + .v.pins = mba6_pincfgs, 594 + .chained = true, 595 + .chain_id = CS4208_GPIO0, 596 + }, 630 597 [CS4208_GPIO0] = { 631 598 .type = HDA_FIXUP_FUNC, 632 599 .v.func = cs4208_fixup_gpio0, 633 600 }, 634 601 }; 635 602 603 + /* correct the 0dB offset of input pins */ 604 + static void cs4208_fix_amp_caps(struct hda_codec *codec, hda_nid_t adc) 605 + { 606 + unsigned int caps; 607 + 608 + caps = query_amp_caps(codec, adc, HDA_INPUT); 609 + caps &= ~(AC_AMPCAP_OFFSET); 610 + caps |= 0x02; 611 + snd_hda_override_amp_caps(codec, adc, HDA_INPUT, caps); 612 + } 613 + 636 614 static int patch_cs4208(struct hda_codec *codec) 637 615 { 638 616 struct cs_spec *spec; 639 617 int err; 640 618 641 - spec = cs_alloc_spec(codec, 0); /* no specific w/a */ 619 + spec = cs_alloc_spec(codec, CS4208_VENDOR_NID); 642 620 if (!spec) 643 621 return -ENOMEM; 644 622 ··· 664 608 snd_hda_pick_fixup(codec, cs4208_models, cs4208_fixup_tbl, 665 609 cs4208_fixups); 666 610 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); 611 + 612 + snd_hda_override_wcaps(codec, 0x18, 613 + get_wcaps(codec, 0x18) | AC_WCAP_STEREO); 614 + cs4208_fix_amp_caps(codec, 0x18); 615 + cs4208_fix_amp_caps(codec, 0x1b); 616 + cs4208_fix_amp_caps(codec, 0x1c); 667 617 668 618 err = cs_parse_auto_config(codec); 669 619 if (err < 0)
+30 -19
sound/pci/hda/patch_hdmi.c
··· 1149 1149 } 1150 1150 1151 1151 static void haswell_config_cvts(struct hda_codec *codec, 1152 - int pin_id, int mux_id) 1152 + hda_nid_t pin_nid, int mux_idx) 1153 1153 { 1154 1154 struct hdmi_spec *spec = codec->spec; 1155 - struct hdmi_spec_per_pin *per_pin; 1156 - int pin_idx, mux_idx; 1157 - int curr; 1158 - int err; 1155 + hda_nid_t nid, end_nid; 1156 + int cvt_idx, curr; 1157 + struct hdmi_spec_per_cvt *per_cvt; 1159 1158 1160 - for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) { 1161 - per_pin = get_pin(spec, pin_idx); 1159 + /* configure all pins, including "no physical connection" ones */ 1160 + end_nid = codec->start_nid + codec->num_nodes; 1161 + for (nid = codec->start_nid; nid < end_nid; nid++) { 1162 + unsigned int wid_caps = get_wcaps(codec, nid); 1163 + unsigned int wid_type = get_wcaps_type(wid_caps); 1162 1164 1163 - if (pin_idx == pin_id) 1165 + if (wid_type != AC_WID_PIN) 1164 1166 continue; 1165 1167 1166 - curr = snd_hda_codec_read(codec, per_pin->pin_nid, 0, 1167 - AC_VERB_GET_CONNECT_SEL, 0); 1168 + if (nid == pin_nid) 1169 + continue; 1168 1170 1169 - /* Choose another unused converter */ 1170 - if (curr == mux_id) { 1171 - err = hdmi_choose_cvt(codec, pin_idx, NULL, &mux_idx); 1172 - if (err < 0) 1173 - return; 1174 - snd_printdd("HDMI: choose converter %d for pin %d\n", mux_idx, pin_idx); 1175 - snd_hda_codec_write_cache(codec, per_pin->pin_nid, 0, 1171 + curr = snd_hda_codec_read(codec, nid, 0, 1172 + AC_VERB_GET_CONNECT_SEL, 0); 1173 + if (curr != mux_idx) 1174 + continue; 1175 + 1176 + /* choose an unassigned converter. The conveters in the 1177 + * connection list are in the same order as in the codec. 1178 + */ 1179 + for (cvt_idx = 0; cvt_idx < spec->num_cvts; cvt_idx++) { 1180 + per_cvt = get_cvt(spec, cvt_idx); 1181 + if (!per_cvt->assigned) { 1182 + snd_printdd("choose cvt %d for pin nid %d\n", 1183 + cvt_idx, nid); 1184 + snd_hda_codec_write_cache(codec, nid, 0, 1176 1185 AC_VERB_SET_CONNECT_SEL, 1177 - mux_idx); 1186 + cvt_idx); 1187 + break; 1188 + } 1178 1189 } 1179 1190 } 1180 1191 } ··· 1227 1216 1228 1217 /* configure unused pins to choose other converters */ 1229 1218 if (is_haswell(codec)) 1230 - haswell_config_cvts(codec, pin_idx, mux_idx); 1219 + haswell_config_cvts(codec, per_pin->pin_nid, mux_idx); 1231 1220 1232 1221 snd_hda_spdif_ctls_assign(codec, pin_idx, per_cvt->cvt_nid); 1233 1222
+15 -1
sound/pci/hda/patch_realtek.c
··· 3439 3439 /* Set to manual mode */ 3440 3440 val = alc_read_coef_idx(codec, 0x06); 3441 3441 alc_write_coef_idx(codec, 0x06, val & ~0x000c); 3442 + /* Enable Line1 input control by verb */ 3443 + val = alc_read_coef_idx(codec, 0x1a); 3444 + alc_write_coef_idx(codec, 0x1a, val | (1 << 4)); 3442 3445 break; 3443 3446 } 3444 3447 } ··· 3534 3531 ALC269VB_FIXUP_ORDISSIMO_EVE2, 3535 3532 ALC283_FIXUP_CHROME_BOOK, 3536 3533 ALC282_FIXUP_ASUS_TX300, 3534 + ALC283_FIXUP_INT_MIC, 3537 3535 }; 3538 3536 3539 3537 static const struct hda_fixup alc269_fixups[] = { ··· 3794 3790 .type = HDA_FIXUP_FUNC, 3795 3791 .v.func = alc282_fixup_asus_tx300, 3796 3792 }, 3793 + [ALC283_FIXUP_INT_MIC] = { 3794 + .type = HDA_FIXUP_VERBS, 3795 + .v.verbs = (const struct hda_verb[]) { 3796 + {0x20, AC_VERB_SET_COEF_INDEX, 0x1a}, 3797 + {0x20, AC_VERB_SET_PROC_COEF, 0x0011}, 3798 + { } 3799 + }, 3800 + .chained = true, 3801 + .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST 3802 + }, 3797 3803 }; 3798 3804 3799 3805 static const struct snd_pci_quirk alc269_fixup_tbl[] = { ··· 3888 3874 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 3889 3875 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 3890 3876 SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 3891 - SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 3877 + SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC), 3892 3878 SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 3893 3879 SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 3894 3880 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),