mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
input: pm8xxx-pwrkey: Update key press status during probe
Power key could be in pressed state during boot. Set the flag to track the press status properly by reading press irq status. CRs-fixed: 404018 Change-Id: I93a8584420002d9cb399484b3ac77fa2ed954690 Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
This commit is contained in:
parent
93c63d759f
commit
aa99a90650
1 changed files with 13 additions and 1 deletions
|
@ -178,10 +178,22 @@ static int __devinit pmic8xxx_pwrkey_probe(struct platform_device *pdev)
|
|||
pwrkey->key_press_irq = key_press_irq;
|
||||
pwrkey->key_release_irq = key_release_irq;
|
||||
pwrkey->pwr = pwr;
|
||||
pwrkey->press = false;
|
||||
|
||||
platform_set_drvdata(pdev, pwrkey);
|
||||
|
||||
/* check power key status during boot */
|
||||
err = pm8xxx_read_irq_stat(pdev->dev.parent, key_press_irq);
|
||||
if (err < 0) {
|
||||
dev_err(&pdev->dev, "reading irq status failed\n");
|
||||
goto unreg_input_dev;
|
||||
}
|
||||
pwrkey->press = !!err;
|
||||
|
||||
if (pwrkey->press) {
|
||||
input_report_key(pwrkey->pwr, KEY_POWER, 1);
|
||||
input_sync(pwrkey->pwr);
|
||||
}
|
||||
|
||||
err = request_any_context_irq(key_press_irq, pwrkey_press_irq,
|
||||
IRQF_TRIGGER_RISING, "pmic8xxx_pwrkey_press", pwrkey);
|
||||
if (err < 0) {
|
||||
|
|
Loading…
Reference in a new issue