linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Anirudh Ghayal <aghayal@codeaurora.org>
Cc: linux-input@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	Samuel Ortiz <sameo@linux.intel.com>,
	Trilok Soni <tsoni@codeaurora.org>
Subject: Re: [PATCH V2 3/3] input: pmic8xxx_pwrkey: Add support for power key
Date: Thu, 5 May 2011 09:08:20 -0700	[thread overview]
Message-ID: <20110505160819.GD27251@core.coreip.homeip.net> (raw)
In-Reply-To: <1304573604-21843-3-git-send-email-aghayal@codeaurora.org>

Hi Anirudh,

On Thu, May 05, 2011 at 11:03:24AM +0530, Anirudh Ghayal wrote:
> From: Trilok Soni <tsoni@codeaurora.org>
> 
> Add support for PMIC8XXX power key driven over dedicated
> KYPD_PWR_N pin. It allows the user to specify the amount
> of time by which the power key reporting can be delayed.
> 
> +
> +static irqreturn_t pwrkey_press_irq(int irq, void *_pwrkey)
> +{
> +	struct pmic8xxx_pwrkey *pwrkey = _pwrkey;
> +	const struct pm8xxx_pwrkey_platform_data *pdata = pwrkey->pdata;
> +	unsigned long flags;
> +
> +	/* no pwrkey time duration, means no screen lock key simulation */
> +	if (!pwrkey->pdata->pwrkey_time_ms) {
> +		input_report_key(pwrkey->pwr, KEY_POWER, 1);
> +		input_sync(pwrkey->pwr);
> +		return IRQ_HANDLED;
> +	}
> +
> +	spin_lock_irqsave(&pwrkey->lock, flags);
> +
> +	input_report_key(pwrkey->pwr, KEY_SCREENLOCK, 1);
> +	input_sync(pwrkey->pwr);
> +

I am very sorry for misleading Trilok and you earlier but I think this
kind of transformation should be done in your userspace framework. Have
the driver emit KEY_SCREENLOCK and have userspace initiate device
shutdown if it detects that KEY_SCREENLOCK is pressed for longer than X
seconds.

Thanks.

-- 
Dmitry

  reply	other threads:[~2011-05-05 16:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1304573604-21843-1-git-send-email-aghayal@codeaurora.org>
2011-05-05  5:33 ` [PATCH V2 2/3] input: pmic8xxx-keypad: Add row and column gpio configuration Anirudh Ghayal
2011-05-05 16:05   ` Dmitry Torokhov
2011-05-06  4:29     ` Anirudh Ghayal
2011-05-05  5:33 ` [PATCH V2 3/3] input: pmic8xxx_pwrkey: Add support for power key Anirudh Ghayal
2011-05-05 16:08   ` Dmitry Torokhov [this message]
2011-05-06 13:32     ` Anirudh Ghayal
     [not found] <1304573365-21427-1-git-send-email-y>
2011-05-05  5:29 ` y
2011-05-05  5:29 ` y

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=20110505160819.GD27251@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=aghayal@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=sameo@linux.intel.com \
    --cc=tsoni@codeaurora.org \
    /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;
as well as URLs for NNTP newsgroup(s).