History

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

Pull sound fixes from Takashi Iwai: "A collection of usual suspects: - a handful USB-audio and HD-audio device-specific quirks - some trivial fixes for the new AC97 bus stuff - another race fix in ALSA sequencer core" * tag 'sound-4.16-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda/realtek: PCI quirk for Fujitsu U7x7 ALSA: seq: Fix racy pool initializations ALSA: usb: add more device quirks for USB DSD devices ALSA: usb-audio: Fix UAC2 get_ctl request with a RANGE attribute ALSA: ac97: Fix copy and paste typo in documentation ALSA: usb-audio: add implicit fb quirk for Behringer UFX1204 ALSA: ac97: kconfig: Remove select of undefined symbol AC97 ALSA: hda/realtek - Enable Thinkpad Dock device for ALC298 platform ALSA: hda/realtek - Add headset mode support for Dell laptop ALSA: hda - Fix headset mic detection problem for two Dell machines

Linus Torvalds committed 8 years ago

Commit 1a2a7d32 parents bad5753 fdcc9687 files · +104 −13Browse files

Unified · Split

7 files
  1. include/sound/ac97/regs.h +1 −1
  2. sound/ac97/Kconfig +0 −1
  3. sound/core/seq/seq_clientmgr.c +6 −2
  4. sound/pci/hda/patch_realtek.c +72 −0
  5. sound/usb/mixer.c +11 −7
  6. sound/usb/pcm.c +9 −0
  7. sound/usb/quirks.c +5 −2
include/sound/ac97/regs.h+1−1
@@ -31,7 +31,7 @@ · 30 unmodified lines
3131 #define AC97_HEADPHONE 0x04 /* Headphone Volume (optional) */
3232 #define AC97_MASTER_MONO 0x06 /* Master Volume Mono (optional) */
3333 #define AC97_MASTER_TONE 0x08 /* Master Tone (Bass & Treble) (optional) */
34−#define AC97_PC_BEEP 0x0a /* PC Beep Volume (optinal) */
34+#define AC97_PC_BEEP 0x0a /* PC Beep Volume (optional) */
3535 #define AC97_PHONE 0x0c /* Phone Volume (optional) */
3636 #define AC97_MIC 0x0e /* MIC Volume */
3737 #define AC97_LINE 0x10 /* Line In Volume */
sound/ac97/Kconfig+0−1
@@ -5,7 +5,6 @@ · 4 unmodified lines
55
66 config AC97_BUS_NEW
77 tristate
8− select AC97
98 help
109 This is the new AC97 bus type, successor of AC97_BUS. The ported
1110 drivers which benefit from the AC97 automatic probing should "select"
sound/core/seq/seq_clientmgr.c+6−2
@@ -1003,7 +1003,7 @@ static ssize_t snd_seq_write(struct file *file, const char __user *buf, · 1002 unmodified lines
10031003 {
10041004 struct snd_seq_client *client = file->private_data;
10051005 int written = 0, len;
1006− int err = -EINVAL;
1006+ int err;
10071007 struct snd_seq_event event;
10081008
10091009 if (!(snd_seq_file_flags(file) & SNDRV_SEQ_LFLG_OUTPUT))
@@ -1018,11 +1018,15 @@ static ssize_t snd_seq_write(struct file *file, const char __user *buf, · 8 unmodified lines
10181018
10191019 /* allocate the pool now if the pool is not allocated yet */
10201020 if (client->pool->size > 0 && !snd_seq_write_pool_allocated(client)) {
1021− if (snd_seq_pool_init(client->pool) < 0)
1021+ mutex_lock(&client->ioctl_mutex);
1022+ err = snd_seq_pool_init(client->pool);
1023+ mutex_unlock(&client->ioctl_mutex);
1024+ if (err < 0)
10221025 return -ENOMEM;
10231026 }
10241027
10251028 /* only process whole events */
1029+ err = -EINVAL;
10261030 while (count >= sizeof(struct snd_seq_event)) {
10271031 /* Read in the event header from the user */
10281032 len = sizeof(event);
sound/pci/hda/patch_realtek.c+72−0
@@ -3465,6 +3465,19 @@ static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec, · 3464 unmodified lines
34653465 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
34663466 }
34673467
3468+static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec,
3469+ const struct hda_fixup *fix,
3470+ int action)
3471+{
3472+ unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21);
3473+ unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19);
3474+
3475+ if (cfg_headphone && cfg_headset_mic == 0x411111f0)
3476+ snd_hda_codec_set_pincfg(codec, 0x19,
3477+ (cfg_headphone & ~AC_DEFCFG_DEVICE) |
3478+ (AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT));
3479+}
3480+
34683481 static void alc269_fixup_hweq(struct hda_codec *codec,
34693482 const struct hda_fixup *fix, int action)
34703483 {
@@ -4972,6 +4985,28 @@ static void alc_fixup_tpt440_dock(struct hda_codec *codec, · 1501 unmodified lines
49724985 }
49734986 }
49744987
4988+static void alc_fixup_tpt470_dock(struct hda_codec *codec,
4989+ const struct hda_fixup *fix, int action)
4990+{
4991+ static const struct hda_pintbl pincfgs[] = {
4992+ { 0x17, 0x21211010 }, /* dock headphone */
4993+ { 0x19, 0x21a11010 }, /* dock mic */
4994+ { }
4995+ };
4996+ struct alc_spec *spec = codec->spec;
4997+
4998+ if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4999+ spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
5000+ /* Enable DOCK device */
5001+ snd_hda_codec_write(codec, 0x17, 0,
5002+ AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
5003+ /* Enable DOCK device */
5004+ snd_hda_codec_write(codec, 0x19, 0,
5005+ AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
5006+ snd_hda_apply_pincfgs(codec, pincfgs);
5007+ }
5008+}
5009+
49755010 static void alc_shutup_dell_xps13(struct hda_codec *codec)
49765011 {
49775012 struct alc_spec *spec = codec->spec;
@@ -5351,6 +5386,7 @@ enum { · 373 unmodified lines
53515386 ALC269_FIXUP_LIFEBOOK_EXTMIC,
53525387 ALC269_FIXUP_LIFEBOOK_HP_PIN,
53535388 ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT,
5389+ ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC,
53545390 ALC269_FIXUP_AMIC,
53555391 ALC269_FIXUP_DMIC,
53565392 ALC269VB_FIXUP_AMIC,
@@ -5446,6 +5482,7 @@ enum { · 89 unmodified lines
54465482 ALC700_FIXUP_INTEL_REFERENCE,
54475483 ALC274_FIXUP_DELL_BIND_DACS,
54485484 ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
5485+ ALC298_FIXUP_TPT470_DOCK,
54495486 };
54505487
54515488 static const struct hda_fixup alc269_fixups[] = {
@@ -5556,6 +5593,10 @@ static const struct hda_fixup alc269_fixups[] = { · 104 unmodified lines
55565593 .type = HDA_FIXUP_FUNC,
55575594 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
55585595 },
5596+ [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = {
5597+ .type = HDA_FIXUP_FUNC,
5598+ .v.func = alc269_fixup_pincfg_U7x7_headset_mic,
5599+ },
55595600 [ALC269_FIXUP_AMIC] = {
55605601 .type = HDA_FIXUP_PINS,
55615602 .v.pins = (const struct hda_pintbl[]) {
@@ -6271,6 +6312,12 @@ static const struct hda_fixup alc269_fixups[] = { · 709 unmodified lines
62716312 .chained = true,
62726313 .chain_id = ALC274_FIXUP_DELL_BIND_DACS
62736314 },
6315+ [ALC298_FIXUP_TPT470_DOCK] = {
6316+ .type = HDA_FIXUP_FUNC,
6317+ .v.func = alc_fixup_tpt470_dock,
6318+ .chained = true,
6319+ .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE
6320+ },
62746321 };
62756322
62766323 static const struct snd_pci_quirk alc269_fixup_tbl[] = {
@@ -6321,6 +6368,8 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { · 44 unmodified lines
63216368 SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME),
63226369 SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
63236370 SND_PCI_QUIRK(0x1028, 0x082a, "Dell XPS 13 9360", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE),
6371+ SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
6372+ SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
63246373 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
63256374 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
63266375 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
@@ -6422,6 +6471,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { · 95 unmodified lines
64226471 SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT),
64236472 SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN),
64246473 SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN),
6474+ SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC),
64256475 SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC),
64266476 SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE),
64276477 SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC),
@@ -6450,8 +6500,16 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { · 22 unmodified lines
64506500 SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK),
64516501 SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK),
64526502 SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK),
6503+ SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6504+ SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
64536505 SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460),
64546506 SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460),
6507+ SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK),
6508+ SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6509+ SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6510+ SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6511+ SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6512+ SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
64556513 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
64566514 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
64576515 SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
@@ -6472,7 +6530,12 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { · 14 unmodified lines
64726530 SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460),
64736531 SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460),
64746532 SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460),
6533+ SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6534+ SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6535+ SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
64756536 SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
6537+ SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6538+ SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
64766539 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),
64776540 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
64786541 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */
@@ -6734,6 +6797,11 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { · 255 unmodified lines
67346797 {0x12, 0xb7a60130},
67356798 {0x14, 0x90170110},
67366799 {0x21, 0x02211020}),
6800+ SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
6801+ {0x12, 0x90a60130},
6802+ {0x14, 0x90170110},
6803+ {0x14, 0x01011020},
6804+ {0x21, 0x0221101f}),
67376805 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
67386806 ALC256_STANDARD_PINS),
67396807 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
@@ -6803,6 +6871,10 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { · 63 unmodified lines
68036871 {0x12, 0x90a60120},
68046872 {0x14, 0x90170110},
68056873 {0x21, 0x0321101f}),
6874+ SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
6875+ {0x12, 0xb7a60130},
6876+ {0x14, 0x90170110},
6877+ {0x21, 0x04211020}),
68066878 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
68076879 ALC290_STANDARD_PINS,
68086880 {0x15, 0x04211040},
sound/usb/mixer.c+11−7
@@ -347,17 +347,20 @@ static int get_ctl_value_v2(struct usb_mixer_elem_info *cval, int request, · 346 unmodified lines
347347 int validx, int *value_ret)
348348 {
349349 struct snd_usb_audio *chip = cval->head.mixer->chip;
350− unsigned char buf[4 + 3 * sizeof(__u32)]; /* enough space for one range */
350+ /* enough space for one range */
351+ unsigned char buf[sizeof(__u16) + 3 * sizeof(__u32)];
351352 unsigned char *val;
352− int idx = 0, ret, size;
353+ int idx = 0, ret, val_size, size;
353354 __u8 bRequest;
354355
356+ val_size = uac2_ctl_value_size(cval->val_type);
357+
355358 if (request == UAC_GET_CUR) {
356359 bRequest = UAC2_CS_CUR;
357− size = uac2_ctl_value_size(cval->val_type);
360+ size = val_size;
358361 } else {
359362 bRequest = UAC2_CS_RANGE;
360− size = sizeof(buf);
363+ size = sizeof(__u16) + 3 * val_size;
361364 }
362365
363366 memset(buf, 0, sizeof(buf));
@@ -390,16 +393,17 @@ error: · 26 unmodified lines
390393 val = buf + sizeof(__u16);
391394 break;
392395 case UAC_GET_MAX:
393− val = buf + sizeof(__u16) * 2;
396+ val = buf + sizeof(__u16) + val_size;
394397 break;
395398 case UAC_GET_RES:
396− val = buf + sizeof(__u16) * 3;
399+ val = buf + sizeof(__u16) + val_size * 2;
397400 break;
398401 default:
399402 return -EINVAL;
400403 }
401404
402− *value_ret = convert_signed_value(cval, snd_usb_combine_bytes(val, sizeof(__u16)));
405+ *value_ret = convert_signed_value(cval,
406+ snd_usb_combine_bytes(val, val_size));
403407
404408 return 0;
405409 }
sound/usb/pcm.c+9−0
@@ -352,6 +352,15 @@ static int set_sync_ep_implicit_fb_quirk(struct snd_usb_substream *subs, · 351 unmodified lines
352352 ep = 0x86;
353353 iface = usb_ifnum_to_if(dev, 2);
354354
355+ if (!iface || iface->num_altsetting == 0)
356+ return -EINVAL;
357+
358+ alts = &iface->altsetting[1];
359+ goto add_sync_ep;
360+ case USB_ID(0x1397, 0x0002):
361+ ep = 0x81;
362+ iface = usb_ifnum_to_if(dev, 1);
363+
355364 if (!iface || iface->num_altsetting == 0)
356365 return -EINVAL;
357366
sound/usb/quirks.c+5−2
@@ -1363,8 +1363,11 @@ u64 snd_usb_interface_dsd_format_quirks(struct snd_usb_audio *chip, · 1362 unmodified lines
13631363 return SNDRV_PCM_FMTBIT_DSD_U32_BE;
13641364 break;
13651365
1366− /* Amanero Combo384 USB interface with native DSD support */
1367− case USB_ID(0x16d0, 0x071a):
1366+ /* Amanero Combo384 USB based DACs with native DSD support */
1367+ case USB_ID(0x16d0, 0x071a): /* Amanero - Combo384 */
1368+ case USB_ID(0x2ab6, 0x0004): /* T+A DAC8DSD-V2.0, MP1000E-V2.0, MP2000R-V2.0, MP2500R-V2.0, MP3100HV-V2.0 */
1369+ case USB_ID(0x2ab6, 0x0005): /* T+A USB HD Audio 1 */
1370+ case USB_ID(0x2ab6, 0x0006): /* T+A USB HD Audio 2 */
13681371 if (fp->altsetting == 2) {
13691372 switch (le16_to_cpu(chip->dev->descriptor.bcdDevice)) {
13701373 case 0x199: