linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anirudh Ghayal <aghayal@codeaurora.org>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
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: Fri, 06 May 2011 19:02:38 +0530	[thread overview]
Message-ID: <4DC3F876.6010008@codeaurora.org> (raw)
In-Reply-To: <20110505160819.GD27251@core.coreip.homeip.net>

Hi Dmitry,

On 5/5/2011 9:38 PM, Dmitry Torokhov wrote:
> 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.

After giving this a further thought, I agree that this handling should 
be in the userspace. I will submit a new patch with the changes.

>
> Thanks.
>

Thank you,
~Anirudh

  reply	other threads:[~2011-05-06 13:32 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
2011-05-06 13:32     ` Anirudh Ghayal [this message]
     [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=4DC3F876.6010008@codeaurora.org \
    --to=aghayal@codeaurora.org \
    --cc=dmitry.torokhov@gmail.com \
    --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).