Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp27457pxu; Wed, 6 Jan 2021 20:02:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJyYsqwMDysTtkXNKsMYEJmr7FpH+lMrXIOtq67JM1uCUP1Anv9CDoHKJdVJUhvrzbhdezvt X-Received: by 2002:a17:906:7f0b:: with SMTP id d11mr5099958ejr.7.1609992159628; Wed, 06 Jan 2021 20:02:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609992159; cv=none; d=google.com; s=arc-20160816; b=pNqHMxP8ycuTUO9CWPx5BVmvZNug9+YKXSBNISD99ht7ocK3oZkHuiYlqUtNMJDzel PRXhBV8GUxzrD+tVICAf4Y6ywG9C7lmMZPcLocGQJjd6uCtcy3NpRZOEArxjSawg3dbX OJAvx3mQ4nWFCGk7E28vEpD4JEkjRwMt/mid0ffO0MIeScuJA9SSWdPv5MAwerhmalBo 6RXjuZtsTz9ll0dgaZ0/I2ocwbZuwspLOEPGZDKKnBZz1vEnSEm9idWc5xKsvG6Fa/X+ 3UFn5VV0ilUY057kkn/NLeZJ57L+BmdYToHWPDrvpOsjZKNPkHdQ9NjesIo5qhMNzBna mFYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=oB+VPXmJ5ngbLdpq6YE49ucI1D/rfct5S9a9aSXZ/SU=; b=LvxsFAzrgoT4EbW2W0IievPNyRNPv4W4E8HP2gLMV3tTbR8IQTQk3jNV0lfYfqJ/y+ wCh7SCsEdEMfeSBf8FGOXwFSxn/Nv9R+NSD/02GtJ4aAPYC6JpMBr70TlsXp1mHvcgsQ soY78J73Ugk5EO2fAoJJnuff/FX3aynqCuTh0AkqOqMaKdhejtWdjNGJhAn70Pfo+bkM hgJUuuIHBjTYROFMnxodKk8oeFGAmcZUBizs6Qt52MbtqSmATKTEfPWtXqa9Ntfhtgx2 ZDEfXpz7MvqaZGzCqsSBKCa+jhO91z8au5WvEwU/0t7UxLm+bQY3dIb8dQ//bKZNG4QY KfzA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e23si1647541ejd.730.2021.01.06.20.02.13; Wed, 06 Jan 2021 20:02:39 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726709AbhAGEBN (ORCPT + 99 others); Wed, 6 Jan 2021 23:01:13 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:55671 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726482AbhAGEBM (ORCPT ); Wed, 6 Jan 2021 23:01:12 -0500 Received: from mail-oo1-f71.google.com ([209.85.161.71]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kxMTN-00050Q-AQ for linux-kernel@vger.kernel.org; Thu, 07 Jan 2021 04:00:29 +0000 Received: by mail-oo1-f71.google.com with SMTP id p66so3321986ooa.17 for ; Wed, 06 Jan 2021 20:00:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=oB+VPXmJ5ngbLdpq6YE49ucI1D/rfct5S9a9aSXZ/SU=; b=t7NGhyNIDhs5PY6DcqZCRE82q8BcT3D/XFhwNdZTWsQhg5l2DM/HB/zlEmXzjcQ947 diSHIN91fT9T7/WmqTa8BmwAKFYxZTVExxaUyPukwVAStzncyICa8QRsyTYZGvQYP76V lIO6RrCahI2DfkaNPsoY94ospPT+orkEeGebR14Uj3z6ScsvBxNNNjphRxjoC6f45LRo x3tgddgLet9/iXBKwvUPEyuOl3qLkybkmkuO/6DC99ZttMQdWVkOtZqvDu29zw+sykDX PaIdSPQcoGyjQSvlcxBZu5qYKhmV6ZO6FU+aLcJV19PrVjRm4f4BV/tIekZJXY41QeF0 nGQQ== X-Gm-Message-State: AOAM531veZ5sQ+5H7sQLW/l1wYqoSnEImIVvN/WUgYOVY1k2aW52DlqS uOS+C/czSNx3e/j+ajkyRcJQKX2/CdKaov5qGdDz6/dy0pc1NixwdQeSS6dGbSyS+CPULHNfkAj 5tFlQ+nsTU8b6Insxs1euVd4fZwJwev9Y0AzaDis74jdMS0WtBp1PuOMy2g== X-Received: by 2002:a9d:7411:: with SMTP id n17mr5313059otk.262.1609992028240; Wed, 06 Jan 2021 20:00:28 -0800 (PST) X-Received: by 2002:a9d:7411:: with SMTP id n17mr5313050otk.262.1609992027962; Wed, 06 Jan 2021 20:00:27 -0800 (PST) MIME-Version: 1.0 References: <20210104140853.228448-1-kai.heng.feng@canonical.com> In-Reply-To: From: Kai-Heng Feng Date: Thu, 7 Jan 2021 12:00:16 +0800 Message-ID: Subject: Re: [PATCH v2 1/3] ASoC: SOF: Intel: hda: Resume codec to do jack detection To: Kai Vehmanen Cc: Pierre-Louis Bossart , Liam Girdwood , Ranjani Sridharan , daniel.baluta@nxp.com, Mark Brown , Jaroslav Kysela , Takashi Iwai , Guennadi Liakhovetski , Rander Wang , Payal Kshirsagar , "moderated list:SOUND - SOUND OPEN FIRMWARE (SOF) DRIVERS" , "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , open list Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 5, 2021 at 9:00 PM Kai Vehmanen wrote: > > Hi, > > On Mon, 4 Jan 2021, Kai-Heng Feng wrote: > > > Instead of queueing jackpoll_work, runtime resume the codec to let it > > use different jack detection methods based on jackpoll_interval. > > hmm, but jackpoll_work() does the same thing, right? So end result should > be the same. It depends on the jackpoll_interval value. But yes the end result should be the same. > > > This matches SOF driver's behavior with commit a6e7d0a4bdb0 ("ALSA: hda: > > fix jack detection with Realtek codecs when in D3"). Since SOF only uses > > Realtek codec, we don't need any additional check for the resume. > > This is not quite correct. First, SOF does support any HDA codec, not just > Realteks (see e.g. https://github.com/thesofproject/linux/issues/1807), > and second, this doesn't really match the hda_intel.c patch you mention. > SOF implements a more conservative approach where we basicly assume > codec->forced_resume=1 to always apply, and do not implement support for > codec->relaxed_resume. So the above patch doesn't fully apply to SOF as > the design is not same. OK, I assumed SOF always use Realtek codec, so codec->forced_resume=1 is always applied like the other patch. I'll remove this section. > > > diff --git a/sound/soc/sof/intel/hda-codec.c b/sound/soc/sof/intel/hda-codec.c > > index 6875fa570c2c..df59c79cfdfc 100644 > > --- a/sound/soc/sof/intel/hda-codec.c > > +++ b/sound/soc/sof/intel/hda-codec.c > > @@ -93,8 +93,7 @@ void hda_codec_jack_check(struct snd_sof_dev *sdev) > > * has been recorded in STATESTS > > */ > > if (codec->jacktbl.used) > > - schedule_delayed_work(&codec->jackpoll_work, > > - codec->jackpoll_interval); > > + pm_request_resume(&codec->core.dev); > > I think this change is still good. Just drop the but about Realtek > codecs from commit message and maybe s/matches/aligns/. OK, will do. Kai-Heng > > Br, Kai