Hi Anirudh,

On Thu, May 05, 2011 at 11:03:24AM +0530, Anirudh Ghayal wrote:
> From: Trilok Soni <[email protected]>
> 
> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to