Skip to content

Commit 1965c43

Browse files
khfengtiwai
authored andcommitted
ALSA: usb-audio: Disable autosuspend for Lenovo ThinkStation P620
If USB autosuspend is enabled, both front and rear panel can no longer detect jack insertion. Enable USB remote wakeup, i.e. needs_remote_wakeup = 1, doesn't help either. So disable USB autosuspend to prevent missing jack detection event. Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Link: https://lore.kernel.org/r/20200823105854.26950-1-kai.heng.feng@canonical.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent acd46a6 commit 1965c43

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

sound/usb/quirks-table.h

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2827,14 +2827,24 @@ YAMAHA_DEVICE(0x7010, "UB99"),
28272827
/* Lenovo ThinkStation P620 Rear Line-in, Line-out and Microphone */
28282828
{
28292829
USB_DEVICE(0x17aa, 0x1046),
2830-
QUIRK_DEVICE_PROFILE("Lenovo", "ThinkStation P620 Rear",
2831-
"Lenovo-ThinkStation-P620-Rear"),
2830+
.driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
2831+
.vendor_name = "Lenovo",
2832+
.product_name = "ThinkStation P620 Rear",
2833+
.profile_name = "Lenovo-ThinkStation-P620-Rear",
2834+
.ifnum = QUIRK_ANY_INTERFACE,
2835+
.type = QUIRK_SETUP_DISABLE_AUTOSUSPEND
2836+
}
28322837
},
28332838
/* Lenovo ThinkStation P620 Internal Speaker + Front Headset */
28342839
{
28352840
USB_DEVICE(0x17aa, 0x104d),
2836-
QUIRK_DEVICE_PROFILE("Lenovo", "ThinkStation P620 Main",
2837-
"Lenovo-ThinkStation-P620-Main"),
2841+
.driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
2842+
.vendor_name = "Lenovo",
2843+
.product_name = "ThinkStation P620 Main",
2844+
.profile_name = "Lenovo-ThinkStation-P620-Main",
2845+
.ifnum = QUIRK_ANY_INTERFACE,
2846+
.type = QUIRK_SETUP_DISABLE_AUTOSUSPEND
2847+
}
28382848
},
28392849

28402850
/* Native Instruments MK2 series */

sound/usb/quirks.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,15 @@ static int setup_fmt_after_resume_quirk(struct snd_usb_audio *chip,
518518
return 1; /* Continue with creating streams and mixer */
519519
}
520520

521+
static int setup_disable_autosuspend(struct snd_usb_audio *chip,
522+
struct usb_interface *iface,
523+
struct usb_driver *driver,
524+
const struct snd_usb_audio_quirk *quirk)
525+
{
526+
driver->supports_autosuspend = 0;
527+
return 1; /* Continue with creating streams and mixer */
528+
}
529+
521530
/*
522531
* audio-interface quirks
523532
*
@@ -557,6 +566,7 @@ int snd_usb_create_quirk(struct snd_usb_audio *chip,
557566
[QUIRK_AUDIO_ALIGN_TRANSFER] = create_align_transfer_quirk,
558567
[QUIRK_AUDIO_STANDARD_MIXER] = create_standard_mixer_quirk,
559568
[QUIRK_SETUP_FMT_AFTER_RESUME] = setup_fmt_after_resume_quirk,
569+
[QUIRK_SETUP_DISABLE_AUTOSUSPEND] = setup_disable_autosuspend,
560570
};
561571

562572
if (quirk->type < QUIRK_TYPE_COUNT) {

sound/usb/usbaudio.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ enum quirk_type {
102102
QUIRK_AUDIO_ALIGN_TRANSFER,
103103
QUIRK_AUDIO_STANDARD_MIXER,
104104
QUIRK_SETUP_FMT_AFTER_RESUME,
105+
QUIRK_SETUP_DISABLE_AUTOSUSPEND,
105106

106107
QUIRK_TYPE_COUNT
107108
};

0 commit comments

Comments
 (0)