From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 817C8C433DB for ; Thu, 18 Feb 2021 08:45:40 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2D75164DFF for ; Thu, 18 Feb 2021 08:45:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2D75164DFF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id EA3154E; Thu, 18 Feb 2021 09:44:44 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz EA3154E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1613637935; bh=d8U22QgxwTteAjf0rSZbvrf5sWcCs36EGsMN28LgUvU=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=VzjTXasWs/GScKTEgZ/MhJk7Yjufv+qYFUtQxBhiSz53DRIlhO+AGH5iMQggqnxtO TdLTlc8zbgqKpPbp1feH6l7P+w83+wi0+WldL+GkewXH7xZe23RNqB+bW/UoAo04qJ 91riwToKb2ud8dwQVzaLFTV8NipbcpVpPxLtxnVU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 76AC2F80155; Thu, 18 Feb 2021 09:44:44 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A939DF8015A; Thu, 18 Feb 2021 09:44:42 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id DC7E5F800D0 for ; Thu, 18 Feb 2021 09:44:31 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz DC7E5F800D0 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 0FFD4AC6E; Thu, 18 Feb 2021 08:44:31 +0000 (UTC) Date: Thu, 18 Feb 2021 09:44:30 +0100 Message-ID: From: Takashi Iwai To: =?UTF-8?B?IlNodW1pbmcgW+iMg+abuOmKmF0i?= Subject: Re: [PATCH] ASoC: rt5682: remove jack detect delay In-Reply-To: <5b90530b77744937b87bbbd35901e320@realtek.com> References: <20210217214914.700751-1-cujomalainey@chromium.org> <5b90530b77744937b87bbbd35901e320@realtek.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=UTF-8 Content-Transfer-Encoding: 8bit Cc: Oder Chiou , Jack Yu , "alsa-devel@alsa-project.org" , Takashi Iwai , Liam Girdwood , Mark Brown , =?UTF-8?B?IkRlcmVrIFvmlrnlvrfnvqldIg==?= , Curtis Malainey , Bard liao , "Flove\(HsinFu\)" X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Thu, 18 Feb 2021 09:38:53 +0100, Shuming [θŒƒζ›ΈιŠ˜] wrote: > > > There is a 250ms delay on the jack detect interrupt currently, this delay is > > observable to users who are using inline controls. It can also mask multiple > > presses which is a negative experience. > > > > Cc: Bard liao > > Cc: Shuming Fan > > > > Signed-off-by: Curtis Malainey > > --- > > sound/soc/codecs/rt5682-i2c.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/sound/soc/codecs/rt5682-i2c.c b/sound/soc/codecs/rt5682-i2c.c > > index 93c1603b42f1..b15c3e7d1f59 100644 > > --- a/sound/soc/codecs/rt5682-i2c.c > > +++ b/sound/soc/codecs/rt5682-i2c.c > > @@ -78,7 +78,7 @@ static irqreturn_t rt5682_irq(int irq, void *data) > > struct rt5682_priv *rt5682 = data; > > > > mod_delayed_work(system_power_efficient_wq, > > - &rt5682->jack_detect_work, msecs_to_jiffies(250)); > > + &rt5682->jack_detect_work, 0); > > How about using the device property to adjust the delay time? > I think it should keep the workqueue to do the jack/button detection because the jack type detection will take some times to do. One might check twice (or more) if it's not certain, too. That is, check the jack immediately, and if the jack state really changed, report it so. OTOH, if the jack state doesn't change from the old state, it can retry after some delay. thanks, Takashi