Thread (3 messages) 3 messages, 2 authors, 2011-05-06

Re: [PATCH V2 3/3] input: pmic8xxx_pwrkey: Add support for power key

From: Anirudh Ghayal <hidden>
Date: 2011-05-06 13:32:43
Also in: linux-arm-msm

Possibly related (same subject, not in this thread)

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:
quoted
From: Trilok Soni<redacted>

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help