Skip to content

Commit c5ba171

Browse files
committed
Merge tag 'sound-5.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "No big surprises here, just a few device-specific fixes. HD-audio received several fixes for Acer, Dell, Huawei and other laptops as well as the workaround for the new Intel chipset. One significant one-liner fix is the disablement of the node-power saving on Realtek codecs, which may potentially cover annoying bugs like the background noises or click noises on many devices. Other than that, a fix for FireWire bit definitions, and another fix for LINE6 USB audio bug that was discovered by syzkaller" * tag 'sound-5.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: fireface: Use ULL suffixes for 64-bit constants ALSA: hda/realtek - Improve the headset mic for Acer Aspire laptops ALSA: line6: Assure canceling delayed work at disconnection ALSA: hda - Force polling mode on CNL for fixing codec communication ALSA: hda/realtek - Enable micmute LED for Huawei laptops ALSA: hda/realtek - Set default power save node to 0 ALSA: hda/realtek - Check headset type by unplug and resume
2 parents 20f9449 + 6954158 commit c5ba171

File tree

6 files changed

+51
-33
lines changed

6 files changed

+51
-33
lines changed

sound/firewire/fireface/ff-protocol-latter.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99

1010
#include "ff.h"
1111

12-
#define LATTER_STF 0xffff00000004
13-
#define LATTER_ISOC_CHANNELS 0xffff00000008
14-
#define LATTER_ISOC_START 0xffff0000000c
15-
#define LATTER_FETCH_MODE 0xffff00000010
16-
#define LATTER_SYNC_STATUS 0x0000801c0000
12+
#define LATTER_STF 0xffff00000004ULL
13+
#define LATTER_ISOC_CHANNELS 0xffff00000008ULL
14+
#define LATTER_ISOC_START 0xffff0000000cULL
15+
#define LATTER_FETCH_MODE 0xffff00000010ULL
16+
#define LATTER_SYNC_STATUS 0x0000801c0000ULL
1717

1818
static int parse_clock_bits(u32 data, unsigned int *rate,
1919
enum snd_ff_clock_src *src)

sound/pci/hda/hda_intel.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@ enum {
375375

376376
#define IS_BXT(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0x5a98)
377377
#define IS_CFL(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0xa348)
378+
#define IS_CNL(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0x9dc8)
378379

379380
static char *driver_short_names[] = {
380381
[AZX_DRIVER_ICH] = "HDA Intel",
@@ -1700,8 +1701,8 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci,
17001701
else
17011702
chip->bdl_pos_adj = bdl_pos_adj[dev];
17021703

1703-
/* Workaround for a communication error on CFL (bko#199007) */
1704-
if (IS_CFL(pci))
1704+
/* Workaround for a communication error on CFL (bko#199007) and CNL */
1705+
if (IS_CFL(pci) || IS_CNL(pci))
17051706
chip->polling_mode = 1;
17061707

17071708
err = azx_bus_init(chip, model[dev], &pci_hda_io_ops);

sound/pci/hda/patch_realtek.c

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -821,6 +821,8 @@ static void alc_pre_init(struct hda_codec *codec)
821821
alc_fill_eapd_coef(codec);
822822
}
823823

824+
#define is_s3_resume(codec) \
825+
((codec)->core.dev.power.power_state.event == PM_EVENT_RESUME)
824826
#define is_s4_resume(codec) \
825827
((codec)->core.dev.power.power_state.event == PM_EVENT_RESTORE)
826828

@@ -4888,6 +4890,8 @@ static void alc_update_headset_mode(struct hda_codec *codec)
48884890
switch (new_headset_mode) {
48894891
case ALC_HEADSET_MODE_UNPLUGGED:
48904892
alc_headset_mode_unplugged(codec);
4893+
spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
4894+
spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
48914895
spec->gen.hp_jack_present = false;
48924896
break;
48934897
case ALC_HEADSET_MODE_HEADSET:
@@ -4930,8 +4934,6 @@ static void alc_update_headset_mode_hook(struct hda_codec *codec,
49304934
static void alc_update_headset_jack_cb(struct hda_codec *codec,
49314935
struct hda_jack_callback *jack)
49324936
{
4933-
struct alc_spec *spec = codec->spec;
4934-
spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
49354937
snd_hda_gen_hp_automute(codec, jack);
49364938
}
49374939

@@ -4968,7 +4970,10 @@ static void alc_fixup_headset_mode(struct hda_codec *codec,
49684970
alc_probe_headset_mode(codec);
49694971
break;
49704972
case HDA_FIXUP_ACT_INIT:
4971-
spec->current_headset_mode = 0;
4973+
if (is_s3_resume(codec) || is_s4_resume(codec)) {
4974+
spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
4975+
spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
4976+
}
49724977
alc_update_headset_mode(codec);
49734978
break;
49744979
}
@@ -5734,7 +5739,7 @@ enum {
57345739
ALC298_FIXUP_TPT470_DOCK,
57355740
ALC255_FIXUP_DUMMY_LINEOUT_VERB,
57365741
ALC255_FIXUP_DELL_HEADSET_MIC,
5737-
ALC256_FIXUP_HUAWEI_MBXP_PINS,
5742+
ALC256_FIXUP_HUAWEI_MACH_WX9_PINS,
57385743
ALC295_FIXUP_HP_X360,
57395744
ALC221_FIXUP_HP_HEADSET_MIC,
57405745
ALC285_FIXUP_LENOVO_HEADPHONE_NOISE,
@@ -6025,7 +6030,7 @@ static const struct hda_fixup alc269_fixups[] = {
60256030
.chained = true,
60266031
.chain_id = ALC269_FIXUP_HEADSET_MIC
60276032
},
6028-
[ALC256_FIXUP_HUAWEI_MBXP_PINS] = {
6033+
[ALC256_FIXUP_HUAWEI_MACH_WX9_PINS] = {
60296034
.type = HDA_FIXUP_PINS,
60306035
.v.pins = (const struct hda_pintbl[]) {
60316036
{0x12, 0x90a60130},
@@ -6205,13 +6210,15 @@ static const struct hda_fixup alc269_fixups[] = {
62056210
.chain_id = ALC269_FIXUP_THINKPAD_ACPI,
62066211
},
62076212
[ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = {
6208-
.type = HDA_FIXUP_PINS,
6209-
.v.pins = (const struct hda_pintbl[]) {
6210-
{ 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6211-
{ }
6213+
.type = HDA_FIXUP_VERBS,
6214+
.v.verbs = (const struct hda_verb[]) {
6215+
/* Enable the Mic */
6216+
{ 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
6217+
{ 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
6218+
{}
62126219
},
62136220
.chained = true,
6214-
.chain_id = ALC255_FIXUP_HEADSET_MODE
6221+
.chain_id = ALC269_FIXUP_LIFEBOOK_EXTMIC
62156222
},
62166223
[ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = {
62176224
.type = HDA_FIXUP_PINS,
@@ -7050,9 +7057,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
70507057
SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
70517058
SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),
70527059
SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
7053-
SND_PCI_QUIRK(0x19e5, 0x3200, "Huawei MBX", ALC255_FIXUP_MIC_MUTE_LED),
7054-
SND_PCI_QUIRK(0x19e5, 0x3201, "Huawei MBX", ALC255_FIXUP_MIC_MUTE_LED),
7055-
SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MBXP", ALC256_FIXUP_HUAWEI_MBXP_PINS),
7060+
SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS),
70567061
SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */
70577062

70587063
#if 0
@@ -7111,6 +7116,7 @@ static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = {
71117116
SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED),
71127117
SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
71137118
SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI),
7119+
SND_PCI_QUIRK_VENDOR(0x19e5, "Huawei Matebook", ALC255_FIXUP_MIC_MUTE_LED),
71147120
{}
71157121
};
71167122

@@ -7256,6 +7262,10 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
72567262
{0x18, 0x02a11030},
72577263
{0x19, 0x0181303F},
72587264
{0x21, 0x0221102f}),
7265+
SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
7266+
{0x12, 0x90a60140},
7267+
{0x14, 0x90170120},
7268+
{0x21, 0x02211030}),
72597269
SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
72607270
{0x12, 0x90a601c0},
72617271
{0x14, 0x90171120},
@@ -7693,7 +7703,7 @@ static int patch_alc269(struct hda_codec *codec)
76937703

76947704
spec = codec->spec;
76957705
spec->gen.shared_mic_vref_pin = 0x18;
7696-
codec->power_save_node = 1;
7706+
codec->power_save_node = 0;
76977707

76987708
#ifdef CONFIG_PM
76997709
codec->patch_ops.suspend = alc269_suspend;

sound/usb/line6/driver.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,15 @@ static int line6_init_cap_control(struct usb_line6 *line6)
720720
return 0;
721721
}
722722

723+
static void line6_startup_work(struct work_struct *work)
724+
{
725+
struct usb_line6 *line6 =
726+
container_of(work, struct usb_line6, startup_work.work);
727+
728+
if (line6->startup)
729+
line6->startup(line6);
730+
}
731+
723732
/*
724733
Probe USB device.
725734
*/
@@ -755,6 +764,7 @@ int line6_probe(struct usb_interface *interface,
755764
line6->properties = properties;
756765
line6->usbdev = usbdev;
757766
line6->ifcdev = &interface->dev;
767+
INIT_DELAYED_WORK(&line6->startup_work, line6_startup_work);
758768

759769
strcpy(card->id, properties->id);
760770
strcpy(card->driver, driver_name);
@@ -825,6 +835,8 @@ void line6_disconnect(struct usb_interface *interface)
825835
if (WARN_ON(usbdev != line6->usbdev))
826836
return;
827837

838+
cancel_delayed_work(&line6->startup_work);
839+
828840
if (line6->urb_listen != NULL)
829841
line6_stop_listen(line6);
830842

sound/usb/line6/driver.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,15 @@ struct usb_line6 {
178178
fifo;
179179
} messages;
180180

181+
/* Work for delayed PCM startup */
182+
struct delayed_work startup_work;
183+
181184
/* If MIDI is supported, buffer_message contains the pre-processed data;
182185
* otherwise the data is only in urb_listen (buffer_incoming).
183186
*/
184187
void (*process_message)(struct usb_line6 *);
185188
void (*disconnect)(struct usb_line6 *line6);
189+
void (*startup)(struct usb_line6 *line6);
186190
};
187191

188192
extern char *line6_alloc_sysex_buffer(struct usb_line6 *line6, int code1,

sound/usb/line6/toneport.c

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,6 @@ struct usb_line6_toneport {
5454
/* Firmware version (x 100) */
5555
u8 firmware_version;
5656

57-
/* Work for delayed PCM startup */
58-
struct delayed_work pcm_work;
59-
6057
/* Device type */
6158
enum line6_device_type type;
6259

@@ -241,12 +238,8 @@ static int snd_toneport_source_put(struct snd_kcontrol *kcontrol,
241238
return 1;
242239
}
243240

244-
static void toneport_start_pcm(struct work_struct *work)
241+
static void toneport_startup(struct usb_line6 *line6)
245242
{
246-
struct usb_line6_toneport *toneport =
247-
container_of(work, struct usb_line6_toneport, pcm_work.work);
248-
struct usb_line6 *line6 = &toneport->line6;
249-
250243
line6_pcm_acquire(line6->line6pcm, LINE6_STREAM_MONITOR, true);
251244
}
252245

@@ -394,7 +387,7 @@ static int toneport_setup(struct usb_line6_toneport *toneport)
394387
if (toneport_has_led(toneport))
395388
toneport_update_led(toneport);
396389

397-
schedule_delayed_work(&toneport->pcm_work,
390+
schedule_delayed_work(&toneport->line6.startup_work,
398391
msecs_to_jiffies(TONEPORT_PCM_DELAY * 1000));
399392
return 0;
400393
}
@@ -407,8 +400,6 @@ static void line6_toneport_disconnect(struct usb_line6 *line6)
407400
struct usb_line6_toneport *toneport =
408401
(struct usb_line6_toneport *)line6;
409402

410-
cancel_delayed_work_sync(&toneport->pcm_work);
411-
412403
if (toneport_has_led(toneport))
413404
toneport_remove_leds(toneport);
414405
}
@@ -424,9 +415,9 @@ static int toneport_init(struct usb_line6 *line6,
424415
struct usb_line6_toneport *toneport = (struct usb_line6_toneport *) line6;
425416

426417
toneport->type = id->driver_info;
427-
INIT_DELAYED_WORK(&toneport->pcm_work, toneport_start_pcm);
428418

429419
line6->disconnect = line6_toneport_disconnect;
420+
line6->startup = toneport_startup;
430421

431422
/* initialize PCM subsystem: */
432423
err = line6_init_pcm(line6, &toneport_pcm_properties);

0 commit comments

Comments
 (0)