Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp445079pxf; Thu, 25 Mar 2021 07:33:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzycdh9MZZnAVFJQdUQDj+FBoOWGZa9ZVvM1mtGqZk0pT10VcKpCF5OvLUAQs6/pM7aqjK X-Received: by 2002:a17:906:ecfb:: with SMTP id qt27mr9581383ejb.245.1616682791715; Thu, 25 Mar 2021 07:33:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616682791; cv=none; d=google.com; s=arc-20160816; b=qS8SUI3KktWfjvMN/p1ixsz9IFMRA5tpkz8p0gZCPEE5QmCYZyNqEbehHQcLnfO+19 nZIs9JdOT9y1S68Y8yTuQFlEglUrQn85/ZCyHKXLONI3lJA49gwGDXwBN6J55L4T8Ky7 dPZoE6u8AGMxxbyS8FY66ihWceECQxGjd6yHyQVfMTnb5pAGR9krJ7TtE9C4A6qtR+X7 wbjbqAUXPbz8iqnCw0aVc1byPKHcy9BM5T90k60IRbtvXj99U5VSZn6FIzeZ15vZ4ts1 H7Cz6IH8K0jHocUGL0ZeQ4143kPNYyNkqKhq1O3Efq159GAy/atUc0qWUd3XWlOKMmql hrhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date; bh=d2Tak2RvXMBdVZxroJ/+n4mFdCLoSC0bC5fBfVyT6ss=; b=NPrEH47XfY0f2BEN3yx8HXPq9QrAiRH0vBeQhfiiQ7xVA7Gjba/bdmG/wmE4woD+my yQFSyXfDBGIZ4Jw3BO1WMJh4EwpPzLkJ2PJwiwLefg90S8mj2kuppnvXN/QH9AgG+zey /puqg+VH+wpC6LHAEZ+cn8aKptEUcsfqNVSQ5YEidtJvYM3JNPhNIFuyIRsO133jGi7u a234eCcMUn+7gUph3WE8F16ehKhMLv+RDLhwPV/3ihozNxnzcENdYJMqBLyDOk6w5ir4 FgSzdnPBnTSWct8+wz2RNUy+5SGmh1Zydv1lHN8YhwRGG42953nKCPhjL12054HUoauQ MC+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q4si4744305edn.433.2021.03.25.07.32.47; Thu, 25 Mar 2021 07:33:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230134AbhCYOaR (ORCPT + 99 others); Thu, 25 Mar 2021 10:30:17 -0400 Received: from mx2.suse.de ([195.135.220.15]:42188 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230281AbhCYOaE (ORCPT ); Thu, 25 Mar 2021 10:30:04 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 74181ADAA; Thu, 25 Mar 2021 14:30:03 +0000 (UTC) Date: Thu, 25 Mar 2021 15:30:03 +0100 Message-ID: From: Takashi Iwai To: Kai-Heng Feng Cc: Takashi Iwai , Jaroslav Kysela , Pavel Skripkin , Chris Chiu , Mark Brown , Lars-Peter Clausen , Tom Yan , Joe Perches , "moderated list:SOUND" , open list Subject: Re: [PATCH v2 2/2] ALSA: usb-audio: Check connector value on resume In-Reply-To: References: <20210325121250.133009-1-kai.heng.feng@canonical.com> <20210325121250.133009-2-kai.heng.feng@canonical.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 25 Mar 2021 15:24:42 +0100, Kai-Heng Feng wrote: > > On Thu, Mar 25, 2021 at 9:55 PM Kai-Heng Feng > wrote: > > > > On Thu, Mar 25, 2021 at 9:41 PM Takashi Iwai wrote: > > > > > > On Thu, 25 Mar 2021 13:12:48 +0100, > > > Kai-Heng Feng wrote: > > > > > > > > Rear Mic on Lenovo P620 cannot record after S3, despite that there's no > > > > error and the other two functions of the USB audio, Line In and Line > > > > Out, work just fine. > > > > > > > > The mic starts to work again after running userspace app like "alsactl > > > > store". Following the lead, the evidence shows that as soon as connector > > > > status is queried, the mic can work again. > > > > > > > > So also check connector value on resume to "wake up" the USB audio to > > > > make it functional. > > > > > > > > This can be device specific, however I think this generic approach may > > > > benefit more than one device. > > > > > > > > While at it, also remove reset-resume path to consolidate mixer resume > > > > path. > > > > > > > > Signed-off-by: Kai-Heng Feng > > > > --- > > > > v2: > > > > - Remove reset-resume. > > > > - Fold the connector checking to the mixer resume callback. > > > > > > That's not what I meant exactly... I meant to put both into the > > > single resume callback, but handle each part conditionally depending > > > on reset_resume argument. > > > > OK, I get what you mean now. > > > > > > > > But this turned out to need more changes in mixer_quirks.c > > > unnecessarily. Maybe adding the two resume functions is a better > > > approach in the end, but not for the specific connection thing but > > > generically both resume and reset_resume callbacks. Something like > > > below. > > > > This approach looks good. Let me send another one. > > Actually, it works really well and I don't I think I should send the > code you wrote. > Is it possible to push your version with my commit log, and with my tested tag? > > Tested-by: Kai-Heng Feng Heh, I'm too lazy to write up the whole commit. Could you just fold into yours and submit a v3 series? I don't mind who is credited as the author, just put me as Suggested-by or such, if any. thanks, Takashi