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>
This commit is contained in:
Kai-Heng Feng 2020-08-23 18:58:50 +08:00 committed by Takashi Iwai
parent acd46a6b6d
commit 1965c4364b
3 changed files with 25 additions and 4 deletions

View File

@ -2827,14 +2827,24 @@ YAMAHA_DEVICE(0x7010, "UB99"),
/* Lenovo ThinkStation P620 Rear Line-in, Line-out and Microphone */ /* Lenovo ThinkStation P620 Rear Line-in, Line-out and Microphone */
{ {
USB_DEVICE(0x17aa, 0x1046), USB_DEVICE(0x17aa, 0x1046),
QUIRK_DEVICE_PROFILE("Lenovo", "ThinkStation P620 Rear", .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
"Lenovo-ThinkStation-P620-Rear"), .vendor_name = "Lenovo",
.product_name = "ThinkStation P620 Rear",
.profile_name = "Lenovo-ThinkStation-P620-Rear",
.ifnum = QUIRK_ANY_INTERFACE,
.type = QUIRK_SETUP_DISABLE_AUTOSUSPEND
}
}, },
/* Lenovo ThinkStation P620 Internal Speaker + Front Headset */ /* Lenovo ThinkStation P620 Internal Speaker + Front Headset */
{ {
USB_DEVICE(0x17aa, 0x104d), USB_DEVICE(0x17aa, 0x104d),
QUIRK_DEVICE_PROFILE("Lenovo", "ThinkStation P620 Main", .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
"Lenovo-ThinkStation-P620-Main"), .vendor_name = "Lenovo",
.product_name = "ThinkStation P620 Main",
.profile_name = "Lenovo-ThinkStation-P620-Main",
.ifnum = QUIRK_ANY_INTERFACE,
.type = QUIRK_SETUP_DISABLE_AUTOSUSPEND
}
}, },
/* Native Instruments MK2 series */ /* Native Instruments MK2 series */

View File

@ -518,6 +518,15 @@ static int setup_fmt_after_resume_quirk(struct snd_usb_audio *chip,
return 1; /* Continue with creating streams and mixer */ return 1; /* Continue with creating streams and mixer */
} }
static int setup_disable_autosuspend(struct snd_usb_audio *chip,
struct usb_interface *iface,
struct usb_driver *driver,
const struct snd_usb_audio_quirk *quirk)
{
driver->supports_autosuspend = 0;
return 1; /* Continue with creating streams and mixer */
}
/* /*
* audio-interface quirks * audio-interface quirks
* *
@ -557,6 +566,7 @@ int snd_usb_create_quirk(struct snd_usb_audio *chip,
[QUIRK_AUDIO_ALIGN_TRANSFER] = create_align_transfer_quirk, [QUIRK_AUDIO_ALIGN_TRANSFER] = create_align_transfer_quirk,
[QUIRK_AUDIO_STANDARD_MIXER] = create_standard_mixer_quirk, [QUIRK_AUDIO_STANDARD_MIXER] = create_standard_mixer_quirk,
[QUIRK_SETUP_FMT_AFTER_RESUME] = setup_fmt_after_resume_quirk, [QUIRK_SETUP_FMT_AFTER_RESUME] = setup_fmt_after_resume_quirk,
[QUIRK_SETUP_DISABLE_AUTOSUSPEND] = setup_disable_autosuspend,
}; };
if (quirk->type < QUIRK_TYPE_COUNT) { if (quirk->type < QUIRK_TYPE_COUNT) {

View File

@ -102,6 +102,7 @@ enum quirk_type {
QUIRK_AUDIO_ALIGN_TRANSFER, QUIRK_AUDIO_ALIGN_TRANSFER,
QUIRK_AUDIO_STANDARD_MIXER, QUIRK_AUDIO_STANDARD_MIXER,
QUIRK_SETUP_FMT_AFTER_RESUME, QUIRK_SETUP_FMT_AFTER_RESUME,
QUIRK_SETUP_DISABLE_AUTOSUSPEND,
QUIRK_TYPE_COUNT QUIRK_TYPE_COUNT
}; };