All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Michael Auer <mick@yoxcu.de>
Cc: linux-input@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Input: pm8941-pwrkey - report wakeup events
Date: Sun, 22 Nov 2026 20:17:00 -0800	[thread overview]
Message-ID: <847ed9034c9869373a150d43d352b2b9@gmail.com> (raw)
In-Reply-To: <20261121204112.847960-1-mick@yoxcu.de>

Hi Michael,

On Sat, Nov 21, 2026 at 09:41:12PM +0100, Michael Auer wrote:
> The power key (and resin, with "wakeup-source") is a wakeup source, but
> the driver never reports a wakeup event. Its wakeup_count in
> /sys/class/wakeup stays 0 even after it woke the system, so user space
> cannot tell a key press from other wakeups. PowerDevil, for example,
> uses the wakeup counts to decide whether to turn the display on after
> resume.
>
> Report a wakeup event from the interrupt handler, as other power key
> drivers do.
>
> Signed-off-by: Michael Auer <mick@yoxcu.de>
...
> @@ -161,6 +161,9 @@ static irqreturn_t pm8941_pwrkey_irq(int irq, void *_data)
>  		}
>  	}
>  
> +	/* Let user space see that the key woke the system */
> +	pm_wakeup_event(pwrkey->dev, 0);
> +
>  	err = regmap_read(pwrkey->regmap, pwrkey->baseaddr + PON_RT_STS, &sts);
>  	if (err)
>  		return IRQ_HANDLED;

Could you please move pm_wakeup_event() below regmap_read() (after the
error check, or right before reporting the key event) so that we do not
report a wakeup event when reading the status register fails?

Thanks.

-- 
Dmitry

      reply	other threads:[~2026-11-23  4:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-21 20:41 [PATCH] Input: pm8941-pwrkey - report wakeup events Michael Auer
2026-11-23  4:17 ` Dmitry Torokhov [this message]

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=847ed9034c9869373a150d43d352b2b9@gmail.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mick@yoxcu.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.