Re: [PATCH 5/5] Input: omap4-keypad - implement errata check for lost key-up events

From: Tony Lindgren
Date: Mon Jan 11 2021 - 01:13:18 EST


* Tony Lindgren <tony@xxxxxxxxxxx> [210110 19:08]:
> --- a/drivers/input/keyboard/omap4-keypad.c
> +++ b/drivers/input/keyboard/omap4-keypad.c
> +/*
> + * Errata ID i689 "1.32 Keyboard Key Up Event Can Be Missed".
> + * Interrupt may not happen for key-up events. We must clear stuck
> + * key-up events after the keyboard hardware has auto-idled.
> + */
> +static int __maybe_unused omap4_keypad_runtime_suspend(struct device *dev)
> +{
> + struct platform_device *pdev = to_platform_device(dev);
> + struct omap4_keypad *keypad_data = platform_get_drvdata(pdev);
> + u32 active;
> +
> + active = kbd_readl(keypad_data, OMAP4_KBD_STATEMACHINE);
> + if (active) {
> + pm_runtime_mark_last_busy(dev);
> + return -EBUSY;
> + }
> +
> + omap4_keypad_scan_keys(keypad_data, true);
> +
> + return 0;
> +}

So with the improvments done, here we need to replace the true above with 0
so when the hardware is idle we clear any stuck keys. Updated patch below.

Regards,

Tony

8< -----------------------