Skip to content

Commit d54b64e

Browse files
committed
Merge tag 'sound-5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "Only a few last-minute small fixes: the change in ALSA core hwdep is about the undefined behavior of bit shift, which is almost harmless but still worth to pick up quickly. The rest are all device-specific fixes for HD-audio and USB-audio, and safe to apply at the late stage" * tag 'sound-5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda/realtek - Add new codec supported for ALC287 ALSA: usb-audio: Quirks for Gigabyte TRX40 Aorus Master onboard audio ALSA: usb-audio: mixer: volume quirk for ESS Technology Asus USB DAC ALSA: hda/realtek - Add a model for Thinkpad T570 without DAC workaround ALSA: hwdep: fix a left shifting 1 by 31 UB bug
2 parents 170ee4d + 630e361 commit d54b64e

File tree

5 files changed

+83
-12
lines changed

5 files changed

+83
-12
lines changed

sound/core/hwdep.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,12 +216,12 @@ static int snd_hwdep_dsp_load(struct snd_hwdep *hw,
216216
if (info.index >= 32)
217217
return -EINVAL;
218218
/* check whether the dsp was already loaded */
219-
if (hw->dsp_loaded & (1 << info.index))
219+
if (hw->dsp_loaded & (1u << info.index))
220220
return -EBUSY;
221221
err = hw->ops.dsp_load(hw, &info);
222222
if (err < 0)
223223
return err;
224-
hw->dsp_loaded |= (1 << info.index);
224+
hw->dsp_loaded |= (1u << info.index);
225225
return 0;
226226
}
227227

sound/pci/hda/patch_realtek.c

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ static void alc_fill_eapd_coef(struct hda_codec *codec)
384384
case 0x10ec0282:
385385
case 0x10ec0283:
386386
case 0x10ec0286:
387+
case 0x10ec0287:
387388
case 0x10ec0288:
388389
case 0x10ec0285:
389390
case 0x10ec0298:
@@ -5484,18 +5485,9 @@ static void alc_fixup_tpt470_dock(struct hda_codec *codec,
54845485
{ 0x19, 0x21a11010 }, /* dock mic */
54855486
{ }
54865487
};
5487-
/* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise
5488-
* the speaker output becomes too low by some reason on Thinkpads with
5489-
* ALC298 codec
5490-
*/
5491-
static const hda_nid_t preferred_pairs[] = {
5492-
0x14, 0x03, 0x17, 0x02, 0x21, 0x02,
5493-
0
5494-
};
54955488
struct alc_spec *spec = codec->spec;
54965489

54975490
if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5498-
spec->gen.preferred_dacs = preferred_pairs;
54995491
spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
55005492
snd_hda_apply_pincfgs(codec, pincfgs);
55015493
} else if (action == HDA_FIXUP_ACT_INIT) {
@@ -5508,6 +5500,23 @@ static void alc_fixup_tpt470_dock(struct hda_codec *codec,
55085500
}
55095501
}
55105502

5503+
static void alc_fixup_tpt470_dacs(struct hda_codec *codec,
5504+
const struct hda_fixup *fix, int action)
5505+
{
5506+
/* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise
5507+
* the speaker output becomes too low by some reason on Thinkpads with
5508+
* ALC298 codec
5509+
*/
5510+
static const hda_nid_t preferred_pairs[] = {
5511+
0x14, 0x03, 0x17, 0x02, 0x21, 0x02,
5512+
0
5513+
};
5514+
struct alc_spec *spec = codec->spec;
5515+
5516+
if (action == HDA_FIXUP_ACT_PRE_PROBE)
5517+
spec->gen.preferred_dacs = preferred_pairs;
5518+
}
5519+
55115520
static void alc_shutup_dell_xps13(struct hda_codec *codec)
55125521
{
55135522
struct alc_spec *spec = codec->spec;
@@ -6063,6 +6072,7 @@ enum {
60636072
ALC700_FIXUP_INTEL_REFERENCE,
60646073
ALC274_FIXUP_DELL_BIND_DACS,
60656074
ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
6075+
ALC298_FIXUP_TPT470_DOCK_FIX,
60666076
ALC298_FIXUP_TPT470_DOCK,
60676077
ALC255_FIXUP_DUMMY_LINEOUT_VERB,
60686078
ALC255_FIXUP_DELL_HEADSET_MIC,
@@ -6994,12 +7004,18 @@ static const struct hda_fixup alc269_fixups[] = {
69947004
.chained = true,
69957005
.chain_id = ALC274_FIXUP_DELL_BIND_DACS
69967006
},
6997-
[ALC298_FIXUP_TPT470_DOCK] = {
7007+
[ALC298_FIXUP_TPT470_DOCK_FIX] = {
69987008
.type = HDA_FIXUP_FUNC,
69997009
.v.func = alc_fixup_tpt470_dock,
70007010
.chained = true,
70017011
.chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE
70027012
},
7013+
[ALC298_FIXUP_TPT470_DOCK] = {
7014+
.type = HDA_FIXUP_FUNC,
7015+
.v.func = alc_fixup_tpt470_dacs,
7016+
.chained = true,
7017+
.chain_id = ALC298_FIXUP_TPT470_DOCK_FIX
7018+
},
70037019
[ALC255_FIXUP_DUMMY_LINEOUT_VERB] = {
70047020
.type = HDA_FIXUP_PINS,
70057021
.v.pins = (const struct hda_pintbl[]) {
@@ -7638,6 +7654,7 @@ static const struct hda_model_fixup alc269_fixup_models[] = {
76387654
{.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"},
76397655
{.id = ALC292_FIXUP_TPT440, .name = "tpt440"},
76407656
{.id = ALC292_FIXUP_TPT460, .name = "tpt460"},
7657+
{.id = ALC298_FIXUP_TPT470_DOCK_FIX, .name = "tpt470-dock-fix"},
76417658
{.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"},
76427659
{.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
76437660
{.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"},
@@ -8276,6 +8293,7 @@ static int patch_alc269(struct hda_codec *codec)
82768293
case 0x10ec0215:
82778294
case 0x10ec0245:
82788295
case 0x10ec0285:
8296+
case 0x10ec0287:
82798297
case 0x10ec0289:
82808298
spec->codec_variant = ALC269_TYPE_ALC215;
82818299
spec->shutup = alc225_shutup;
@@ -9554,6 +9572,7 @@ static const struct hda_device_id snd_hda_id_realtek[] = {
95549572
HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269),
95559573
HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269),
95569574
HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269),
9575+
HDA_CODEC_ENTRY(0x10ec0287, "ALC287", patch_alc269),
95579576
HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269),
95589577
HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269),
95599578
HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269),

sound/usb/mixer.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,6 +1182,14 @@ static void volume_control_quirks(struct usb_mixer_elem_info *cval,
11821182
cval->res = 384;
11831183
}
11841184
break;
1185+
case USB_ID(0x0495, 0x3042): /* ESS Technology Asus USB DAC */
1186+
if ((strstr(kctl->id.name, "Playback Volume") != NULL) ||
1187+
strstr(kctl->id.name, "Capture Volume") != NULL) {
1188+
cval->min >>= 8;
1189+
cval->max = 0;
1190+
cval->res = 1;
1191+
}
1192+
break;
11851193
}
11861194
}
11871195

sound/usb/mixer_maps.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,21 @@ static const struct usbmix_connector_map trx40_mobo_connector_map[] = {
397397
{}
398398
};
399399

400+
/* Rear panel + front mic on Gigabyte TRX40 Aorus Master with ALC1220-VB */
401+
static const struct usbmix_name_map aorus_master_alc1220vb_map[] = {
402+
{ 17, NULL }, /* OT, IEC958?, disabled */
403+
{ 19, NULL, 12 }, /* FU, Input Gain Pad - broken response, disabled */
404+
{ 16, "Line Out" }, /* OT */
405+
{ 22, "Line Out Playback" }, /* FU */
406+
{ 7, "Line" }, /* IT */
407+
{ 19, "Line Capture" }, /* FU */
408+
{ 8, "Mic" }, /* IT */
409+
{ 20, "Mic Capture" }, /* FU */
410+
{ 9, "Front Mic" }, /* IT */
411+
{ 21, "Front Mic Capture" }, /* FU */
412+
{}
413+
};
414+
400415
/*
401416
* Control map entries
402417
*/
@@ -526,6 +541,10 @@ static const struct usbmix_ctl_map usbmix_ctl_maps[] = {
526541
.id = USB_ID(0x1b1c, 0x0a42),
527542
.map = corsair_virtuoso_map,
528543
},
544+
{ /* Gigabyte TRX40 Aorus Master (rear panel + front mic) */
545+
.id = USB_ID(0x0414, 0xa001),
546+
.map = aorus_master_alc1220vb_map,
547+
},
529548
{ /* Gigabyte TRX40 Aorus Pro WiFi */
530549
.id = USB_ID(0x0414, 0xa002),
531550
.map = trx40_mobo_map,

sound/usb/quirks-table.h

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3566,4 +3566,29 @@ ALC1220_VB_DESKTOP(0x0db0, 0x543d), /* MSI TRX40 */
35663566
ALC1220_VB_DESKTOP(0x26ce, 0x0a01), /* Asrock TRX40 Creator */
35673567
#undef ALC1220_VB_DESKTOP
35683568

3569+
/* Two entries for Gigabyte TRX40 Aorus Master:
3570+
* TRX40 Aorus Master has two USB-audio devices, one for the front headphone
3571+
* with ESS SABRE9218 DAC chip, while another for the rest I/O (the rear
3572+
* panel and the front mic) with Realtek ALC1220-VB.
3573+
* Here we provide two distinct names for making UCM profiles easier.
3574+
*/
3575+
{
3576+
USB_DEVICE(0x0414, 0xa000),
3577+
.driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
3578+
.vendor_name = "Gigabyte",
3579+
.product_name = "Aorus Master Front Headphone",
3580+
.profile_name = "Gigabyte-Aorus-Master-Front-Headphone",
3581+
.ifnum = QUIRK_NO_INTERFACE
3582+
}
3583+
},
3584+
{
3585+
USB_DEVICE(0x0414, 0xa001),
3586+
.driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
3587+
.vendor_name = "Gigabyte",
3588+
.product_name = "Aorus Master Main Audio",
3589+
.profile_name = "Gigabyte-Aorus-Master-Main-Audio",
3590+
.ifnum = QUIRK_NO_INTERFACE
3591+
}
3592+
},
3593+
35693594
#undef USB_DEVICE_VENDOR_SPEC

0 commit comments

Comments
 (0)