Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: "\"Shuming [范書銘]\"" <shumingf@realtek.com>
Cc: "Oder Chiou" <oder_chiou@realtek.com>,
	"Jack Yu" <jack.yu@realtek.com>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"Takashi Iwai" <tiwai@suse.com>,
	"Liam Girdwood" <lgirdwood@gmail.com>,
	"Mark Brown" <broonie@kernel.org>,
	"\"Derek [方德義]\"" <derek.fang@realtek.com>,
	"Curtis Malainey" <cujomalainey@chromium.org>,
	"Bard liao" <yung-chuan.liao@linux.intel.com>,
	"Flove(HsinFu)" <flove@realtek.com>
Subject: Re: [PATCH] ASoC: rt5682: remove jack detect delay
Date: Thu, 18 Feb 2021 09:44:30 +0100	[thread overview]
Message-ID: <s5hr1ld22a9.wl-tiwai@suse.de> (raw)
In-Reply-To: <5b90530b77744937b87bbbd35901e320@realtek.com>

On Thu, 18 Feb 2021 09:38:53 +0100,
Shuming [范書銘] <shumingf@realtek.com> 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 <yung-chuan.liao@linux.intel.com>
> > Cc: Shuming Fan <shumingf@realtek.com>
> > 
> > Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
> > ---
> >  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

  parent reply	other threads:[~2021-02-18  8:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-17 21:49 [PATCH] ASoC: rt5682: remove jack detect delay Curtis Malainey
2021-02-17 21:51 ` Curtis Malainey
     [not found] ` <5b90530b77744937b87bbbd35901e320@realtek.com>
2021-02-18  8:44   ` Takashi Iwai [this message]
2021-02-18 21:06     ` Curtis Malainey
2021-02-22 13:45       ` Mark Brown
2021-02-22 18:59         ` Curtis Malainey
2021-02-23 12:42           ` Mark Brown
2021-02-23 18:50             ` Curtis Malainey
2021-02-23 19:04               ` Mark Brown
2021-02-23 20:07                 ` Curtis Malainey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5hr1ld22a9.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=cujomalainey@chromium.org \
    --cc=derek.fang@realtek.com \
    --cc=flove@realtek.com \
    --cc=jack.yu@realtek.com \
    --cc=lgirdwood@gmail.com \
    --cc=oder_chiou@realtek.com \
    --cc=shumingf@realtek.com \
    --cc=tiwai@suse.com \
    --cc=yung-chuan.liao@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox