* [PATCH v1] Input: tegra-kbc - report wakeup key for some platforms.
@ 2011-11-30 20:43 riyer-DDmLM1+adcrQT0dZR+AlfA
[not found] ` <1322685811-14060-1-git-send-email-riyer-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
` (2 more replies)
0 siblings, 3 replies; 11+ messages in thread
From: riyer-DDmLM1+adcrQT0dZR+AlfA @ 2011-11-30 20:43 UTC (permalink / raw)
To: dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w
Cc: rydberg-Hk7bIW8heu4wFerOooGFRg, swarren-DDmLM1+adcrQT0dZR+AlfA,
ldewangan-DDmLM1+adcrQT0dZR+AlfA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-input-u79uwXL29TY76Z2rM5mHXA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA, Rakesh Iyer
From: Rakesh Iyer <riyer-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Tegra kbc cannot detect exact keypress causing wakeup in interrupt mode.
Allow wakeup keypress to be reported for certain platforms.
Signed-off-by: Rakesh Iyer <riyer-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
arch/arm/mach-tegra/include/mach/kbc.h | 1 +
drivers/input/keyboard/tegra-kbc.c | 20 ++++++++++++++++----
2 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-tegra/include/mach/kbc.h b/arch/arm/mach-tegra/include/mach/kbc.h
index 4f3572a..20bb054 100644
--- a/arch/arm/mach-tegra/include/mach/kbc.h
+++ b/arch/arm/mach-tegra/include/mach/kbc.h
@@ -53,6 +53,7 @@ struct tegra_kbc_platform_data {
struct tegra_kbc_pin_cfg pin_cfg[KBC_MAX_GPIO];
const struct matrix_keymap_data *keymap_data;
+ u32 wakeup_key;
bool wakeup;
bool use_fn_map;
bool use_ghost_filter;
diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c
index cf3228b..ceb1185 100644
--- a/drivers/input/keyboard/tegra-kbc.c
+++ b/drivers/input/keyboard/tegra-kbc.c
@@ -52,6 +52,7 @@
/* KBC Interrupt Register */
#define KBC_INT_0 0x4
#define KBC_INT_FIFO_CNT_INT_STATUS (1 << 2)
+#define KBC_INT_KEYPRESS_INT_STATUS (1 << 0)
#define KBC_ROW_CFG0_0 0x8
#define KBC_COL_CFG0_0 0x18
@@ -74,10 +75,12 @@ struct tegra_kbc {
unsigned int cp_to_wkup_dly;
bool use_fn_map;
bool use_ghost_filter;
+ bool keypress_caused_wake;
const struct tegra_kbc_platform_data *pdata;
unsigned short keycode[KBC_MAX_KEY * 2];
unsigned short current_keys[KBC_MAX_KPENT];
unsigned int num_pressed_keys;
+ u32 wakeup_key;
struct timer_list timer;
struct clk *clk;
};
@@ -409,6 +412,9 @@ static irqreturn_t tegra_kbc_isr(int irq, void *args)
*/
tegra_kbc_set_fifo_interrupt(kbc, false);
mod_timer(&kbc->timer, jiffies + kbc->cp_dly_jiffies);
+ } else if (val & KBC_INT_KEYPRESS_INT_STATUS) {
+ /* We can be here only through system resume path */
+ kbc->keypress_caused_wake = true;
}
spin_unlock_irqrestore(&kbc->lock, flags);
@@ -674,9 +680,10 @@ static int __devinit tegra_kbc_probe(struct platform_device *pdev)
keymap_data = pdata->keymap_data ?: &tegra_kbc_default_keymap_data;
matrix_keypad_build_keymap(keymap_data, KBC_ROW_SHIFT,
input_dev->keycode, input_dev->keybit);
+ kbc->wakeup_key = pdata->wakeup_key;
- err = request_irq(kbc->irq, tegra_kbc_isr, IRQF_TRIGGER_HIGH,
- pdev->name, kbc);
+ err = request_irq(kbc->irq, tegra_kbc_isr,
+ IRQF_NO_SUSPEND | IRQF_TRIGGER_HIGH, pdev->name, kbc);
if (err) {
dev_err(&pdev->dev, "failed to request keyboard IRQ\n");
goto err_put_clk;
@@ -738,7 +745,6 @@ static int tegra_kbc_suspend(struct device *dev)
mutex_lock(&kbc->idev->mutex);
if (device_may_wakeup(&pdev->dev)) {
- disable_irq(kbc->irq);
del_timer_sync(&kbc->timer);
tegra_kbc_set_fifo_interrupt(kbc, false);
@@ -754,6 +760,7 @@ static int tegra_kbc_suspend(struct device *dev)
tegra_kbc_setup_wakekeys(kbc, true);
msleep(30);
+ kbc->keypress_caused_wake = false;
enable_irq_wake(kbc->irq);
} else {
if (kbc->idev->users)
@@ -780,7 +787,12 @@ static int tegra_kbc_resume(struct device *dev)
tegra_kbc_set_fifo_interrupt(kbc, true);
- enable_irq(kbc->irq);
+ if (kbc->keypress_caused_wake && kbc->wakeup_key) {
+ input_report_key(kbc->idev, kbc->wakeup_key, 1);
+ input_sync(kbc->idev);
+ input_report_key(kbc->idev, kbc->wakeup_key, 0);
+ input_sync(kbc->idev);
+ }
} else {
if (kbc->idev->users)
err = tegra_kbc_start(kbc);
--
1.7.4.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
[parent not found: <1322685811-14060-1-git-send-email-riyer-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>]
* RE: [PATCH v1] Input: tegra-kbc - report wakeup key for some platforms.
[not found] ` <1322685811-14060-1-git-send-email-riyer-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
@ 2011-11-30 21:07 ` Stephen Warren
0 siblings, 0 replies; 11+ messages in thread
From: Stephen Warren @ 2011-11-30 21:07 UTC (permalink / raw)
To: Rakesh Iyer,
dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Cc: rydberg-Hk7bIW8heu4wFerOooGFRg@public.gmane.org, Laxman Dewangan,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Rakesh Iyer wrote at Wednesday, November 30, 2011 1:44 PM:
> Tegra kbc cannot detect exact keypress causing wakeup in interrupt mode.
> Allow wakeup keypress to be reported for certain platforms.
>
> Signed-off-by: Rakesh Iyer <riyer-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Acked-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
--
nvpublic
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v1] Input: tegra-kbc - report wakeup key for some platforms.
2011-11-30 20:43 [PATCH v1] Input: tegra-kbc - report wakeup key for some platforms riyer-DDmLM1+adcrQT0dZR+AlfA
[not found] ` <1322685811-14060-1-git-send-email-riyer-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
@ 2011-11-30 21:20 ` Dmitry Torokhov
2011-11-30 22:14 ` Rakesh Iyer
2011-12-29 10:32 ` Dmitry Torokhov
2 siblings, 1 reply; 11+ messages in thread
From: Dmitry Torokhov @ 2011-11-30 21:20 UTC (permalink / raw)
To: riyer; +Cc: rydberg, swarren, ldewangan, linux-kernel, linux-input,
linux-tegra
Hi Rakesh,
On Wed, Nov 30, 2011 at 12:43:31PM -0800, riyer@nvidia.com wrote:
> From: Rakesh Iyer <riyer@nvidia.com>
>
> Tegra kbc cannot detect exact keypress causing wakeup in interrupt mode.
> Allow wakeup keypress to be reported for certain platforms.
>
> Signed-off-by: Rakesh Iyer <riyer@nvidia.com>
> ---
> arch/arm/mach-tegra/include/mach/kbc.h | 1 +
> drivers/input/keyboard/tegra-kbc.c | 20 ++++++++++++++++----
> 2 files changed, 17 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/mach-tegra/include/mach/kbc.h b/arch/arm/mach-tegra/include/mach/kbc.h
> index 4f3572a..20bb054 100644
> --- a/arch/arm/mach-tegra/include/mach/kbc.h
> +++ b/arch/arm/mach-tegra/include/mach/kbc.h
> @@ -53,6 +53,7 @@ struct tegra_kbc_platform_data {
> struct tegra_kbc_pin_cfg pin_cfg[KBC_MAX_GPIO];
> const struct matrix_keymap_data *keymap_data;
>
> + u32 wakeup_key;
> bool wakeup;
> bool use_fn_map;
> bool use_ghost_filter;
> diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c
> index cf3228b..ceb1185 100644
> --- a/drivers/input/keyboard/tegra-kbc.c
> +++ b/drivers/input/keyboard/tegra-kbc.c
> @@ -52,6 +52,7 @@
> /* KBC Interrupt Register */
> #define KBC_INT_0 0x4
> #define KBC_INT_FIFO_CNT_INT_STATUS (1 << 2)
> +#define KBC_INT_KEYPRESS_INT_STATUS (1 << 0)
>
> #define KBC_ROW_CFG0_0 0x8
> #define KBC_COL_CFG0_0 0x18
> @@ -74,10 +75,12 @@ struct tegra_kbc {
> unsigned int cp_to_wkup_dly;
> bool use_fn_map;
> bool use_ghost_filter;
> + bool keypress_caused_wake;
> const struct tegra_kbc_platform_data *pdata;
> unsigned short keycode[KBC_MAX_KEY * 2];
> unsigned short current_keys[KBC_MAX_KPENT];
> unsigned int num_pressed_keys;
> + u32 wakeup_key;
> struct timer_list timer;
> struct clk *clk;
> };
> @@ -409,6 +412,9 @@ static irqreturn_t tegra_kbc_isr(int irq, void *args)
> */
> tegra_kbc_set_fifo_interrupt(kbc, false);
> mod_timer(&kbc->timer, jiffies + kbc->cp_dly_jiffies);
> + } else if (val & KBC_INT_KEYPRESS_INT_STATUS) {
> + /* We can be here only through system resume path */
> + kbc->keypress_caused_wake = true;
> }
>
> spin_unlock_irqrestore(&kbc->lock, flags);
> @@ -674,9 +680,10 @@ static int __devinit tegra_kbc_probe(struct platform_device *pdev)
> keymap_data = pdata->keymap_data ?: &tegra_kbc_default_keymap_data;
> matrix_keypad_build_keymap(keymap_data, KBC_ROW_SHIFT,
> input_dev->keycode, input_dev->keybit);
> + kbc->wakeup_key = pdata->wakeup_key;
>
> - err = request_irq(kbc->irq, tegra_kbc_isr, IRQF_TRIGGER_HIGH,
> - pdev->name, kbc);
> + err = request_irq(kbc->irq, tegra_kbc_isr,
> + IRQF_NO_SUSPEND | IRQF_TRIGGER_HIGH, pdev->name, kbc);
> if (err) {
> dev_err(&pdev->dev, "failed to request keyboard IRQ\n");
> goto err_put_clk;
> @@ -738,7 +745,6 @@ static int tegra_kbc_suspend(struct device *dev)
>
> mutex_lock(&kbc->idev->mutex);
> if (device_may_wakeup(&pdev->dev)) {
> - disable_irq(kbc->irq);
> del_timer_sync(&kbc->timer);
> tegra_kbc_set_fifo_interrupt(kbc, false);
This disturbs locking rules and allows timer to run past this point.
Instead of keeping interrupt enabled can't you simply read controller
state in tegra_kbc_resume (before enabling interrupt) and emit the
keycode if you detect KBC_INT_KEYPRESS_INT_STATUS condition?
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 11+ messages in thread
* RE: [PATCH v1] Input: tegra-kbc - report wakeup key for some platforms.
2011-11-30 21:20 ` Dmitry Torokhov
@ 2011-11-30 22:14 ` Rakesh Iyer
[not found] ` <1FC56210173BB445BD77F608D6FB8D034F3D1BB4BD-lR+7xdUAJVNDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
0 siblings, 1 reply; 11+ messages in thread
From: Rakesh Iyer @ 2011-11-30 22:14 UTC (permalink / raw)
To: 'Dmitry Torokhov'
Cc: rydberg@euromail.se, Stephen Warren, Laxman Dewangan,
linux-kernel@vger.kernel.org, linux-input@vger.kernel.org,
linux-tegra@vger.kernel.org
Thanks Dmitry.
Since there can be multiple wake causes I wanted to isolate wake key generation to the case where keyboard actually generated the wake interrupt.
If the system was woken by some other source and keypress occurs before resume is invoked we will pass on an unintended wake key.
Leaving the disable_irq as is, can I can enable the interrupts at the end of the suspend routine?
Note with the FIFO interrupt disabled, there will be no interrupt after that point from the device unless it's a Wake interrupt.
> -----Original Message-----
> From: Dmitry Torokhov [mailto:dmitry.torokhov@gmail.com]
> Sent: Wednesday, November 30, 2011 1:20 PM
> To: Rakesh Iyer
> Cc: rydberg@euromail.se; Stephen Warren; Laxman Dewangan; linux-
> kernel@vger.kernel.org; linux-input@vger.kernel.org; linux-tegra@vger.kernel.org
> Subject: Re: [PATCH v1] Input: tegra-kbc - report wakeup key for some platforms.
>
> Hi Rakesh,
>
> On Wed, Nov 30, 2011 at 12:43:31PM -0800, riyer@nvidia.com wrote:
> > From: Rakesh Iyer <riyer@nvidia.com>
> >
> > Tegra kbc cannot detect exact keypress causing wakeup in interrupt mode.
> > Allow wakeup keypress to be reported for certain platforms.
> >
> > Signed-off-by: Rakesh Iyer <riyer@nvidia.com>
> > ---
> > arch/arm/mach-tegra/include/mach/kbc.h | 1 +
> > drivers/input/keyboard/tegra-kbc.c | 20 ++++++++++++++++----
> > 2 files changed, 17 insertions(+), 4 deletions(-)
> >
> > diff --git a/arch/arm/mach-tegra/include/mach/kbc.h b/arch/arm/mach-
> tegra/include/mach/kbc.h
> > index 4f3572a..20bb054 100644
> > --- a/arch/arm/mach-tegra/include/mach/kbc.h
> > +++ b/arch/arm/mach-tegra/include/mach/kbc.h
> > @@ -53,6 +53,7 @@ struct tegra_kbc_platform_data {
> > struct tegra_kbc_pin_cfg pin_cfg[KBC_MAX_GPIO];
> > const struct matrix_keymap_data *keymap_data;
> >
> > + u32 wakeup_key;
> > bool wakeup;
> > bool use_fn_map;
> > bool use_ghost_filter;
> > diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c
> > index cf3228b..ceb1185 100644
> > --- a/drivers/input/keyboard/tegra-kbc.c
> > +++ b/drivers/input/keyboard/tegra-kbc.c
> > @@ -52,6 +52,7 @@
> > /* KBC Interrupt Register */
> > #define KBC_INT_0 0x4
> > #define KBC_INT_FIFO_CNT_INT_STATUS (1 << 2)
> > +#define KBC_INT_KEYPRESS_INT_STATUS (1 << 0)
> >
> > #define KBC_ROW_CFG0_0 0x8
> > #define KBC_COL_CFG0_0 0x18
> > @@ -74,10 +75,12 @@ struct tegra_kbc {
> > unsigned int cp_to_wkup_dly;
> > bool use_fn_map;
> > bool use_ghost_filter;
> > + bool keypress_caused_wake;
> > const struct tegra_kbc_platform_data *pdata;
> > unsigned short keycode[KBC_MAX_KEY * 2];
> > unsigned short current_keys[KBC_MAX_KPENT];
> > unsigned int num_pressed_keys;
> > + u32 wakeup_key;
> > struct timer_list timer;
> > struct clk *clk;
> > };
> > @@ -409,6 +412,9 @@ static irqreturn_t tegra_kbc_isr(int irq, void *args)
> > */
> > tegra_kbc_set_fifo_interrupt(kbc, false);
> > mod_timer(&kbc->timer, jiffies + kbc->cp_dly_jiffies);
> > + } else if (val & KBC_INT_KEYPRESS_INT_STATUS) {
> > + /* We can be here only through system resume path */
> > + kbc->keypress_caused_wake = true;
> > }
> >
> > spin_unlock_irqrestore(&kbc->lock, flags);
> > @@ -674,9 +680,10 @@ static int __devinit tegra_kbc_probe(struct platform_device
> *pdev)
> > keymap_data = pdata->keymap_data ?: &tegra_kbc_default_keymap_data;
> > matrix_keypad_build_keymap(keymap_data, KBC_ROW_SHIFT,
> > input_dev->keycode, input_dev->keybit);
> > + kbc->wakeup_key = pdata->wakeup_key;
> >
> > - err = request_irq(kbc->irq, tegra_kbc_isr, IRQF_TRIGGER_HIGH,
> > - pdev->name, kbc);
> > + err = request_irq(kbc->irq, tegra_kbc_isr,
> > + IRQF_NO_SUSPEND | IRQF_TRIGGER_HIGH, pdev->name,
> kbc);
> > if (err) {
> > dev_err(&pdev->dev, "failed to request keyboard IRQ\n");
> > goto err_put_clk;
> > @@ -738,7 +745,6 @@ static int tegra_kbc_suspend(struct device *dev)
> >
> > mutex_lock(&kbc->idev->mutex);
> > if (device_may_wakeup(&pdev->dev)) {
> > - disable_irq(kbc->irq);
> > del_timer_sync(&kbc->timer);
> > tegra_kbc_set_fifo_interrupt(kbc, false);
>
> This disturbs locking rules and allows timer to run past this point.
> Instead of keeping interrupt enabled can't you simply read controller
> state in tegra_kbc_resume (before enabling interrupt) and emit the
> keycode if you detect KBC_INT_KEYPRESS_INT_STATUS condition?
>
> Thanks.
>
> --
> Dmitry
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v1] Input: tegra-kbc - report wakeup key for some platforms.
2011-11-30 20:43 [PATCH v1] Input: tegra-kbc - report wakeup key for some platforms riyer-DDmLM1+adcrQT0dZR+AlfA
[not found] ` <1322685811-14060-1-git-send-email-riyer-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2011-11-30 21:20 ` Dmitry Torokhov
@ 2011-12-29 10:32 ` Dmitry Torokhov
2 siblings, 0 replies; 11+ messages in thread
From: Dmitry Torokhov @ 2011-12-29 10:32 UTC (permalink / raw)
To: riyer; +Cc: rydberg, swarren, ldewangan, linux-kernel, linux-input,
linux-tegra
Hi Rakesh,
On Wed, Nov 30, 2011 at 12:43:31PM -0800, riyer@nvidia.com wrote:
> From: Rakesh Iyer <riyer@nvidia.com>
>
> Tegra kbc cannot detect exact keypress causing wakeup in interrupt mode.
> Allow wakeup keypress to be reported for certain platforms.
>
> Signed-off-by: Rakesh Iyer <riyer@nvidia.com>
> ---
> arch/arm/mach-tegra/include/mach/kbc.h | 1 +
> drivers/input/keyboard/tegra-kbc.c | 20 ++++++++++++++++----
> 2 files changed, 17 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/mach-tegra/include/mach/kbc.h b/arch/arm/mach-tegra/include/mach/kbc.h
> index 4f3572a..20bb054 100644
> --- a/arch/arm/mach-tegra/include/mach/kbc.h
> +++ b/arch/arm/mach-tegra/include/mach/kbc.h
> @@ -53,6 +53,7 @@ struct tegra_kbc_platform_data {
> struct tegra_kbc_pin_cfg pin_cfg[KBC_MAX_GPIO];
> const struct matrix_keymap_data *keymap_data;
>
> + u32 wakeup_key;
> bool wakeup;
> bool use_fn_map;
> bool use_ghost_filter;
> diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c
> index cf3228b..ceb1185 100644
> --- a/drivers/input/keyboard/tegra-kbc.c
> +++ b/drivers/input/keyboard/tegra-kbc.c
> @@ -52,6 +52,7 @@
> /* KBC Interrupt Register */
> #define KBC_INT_0 0x4
> #define KBC_INT_FIFO_CNT_INT_STATUS (1 << 2)
> +#define KBC_INT_KEYPRESS_INT_STATUS (1 << 0)
>
> #define KBC_ROW_CFG0_0 0x8
> #define KBC_COL_CFG0_0 0x18
> @@ -74,10 +75,12 @@ struct tegra_kbc {
> unsigned int cp_to_wkup_dly;
> bool use_fn_map;
> bool use_ghost_filter;
> + bool keypress_caused_wake;
> const struct tegra_kbc_platform_data *pdata;
> unsigned short keycode[KBC_MAX_KEY * 2];
> unsigned short current_keys[KBC_MAX_KPENT];
> unsigned int num_pressed_keys;
> + u32 wakeup_key;
> struct timer_list timer;
> struct clk *clk;
> };
> @@ -409,6 +412,9 @@ static irqreturn_t tegra_kbc_isr(int irq, void *args)
> */
> tegra_kbc_set_fifo_interrupt(kbc, false);
> mod_timer(&kbc->timer, jiffies + kbc->cp_dly_jiffies);
> + } else if (val & KBC_INT_KEYPRESS_INT_STATUS) {
> + /* We can be here only through system resume path */
> + kbc->keypress_caused_wake = true;
> }
>
> spin_unlock_irqrestore(&kbc->lock, flags);
> @@ -674,9 +680,10 @@ static int __devinit tegra_kbc_probe(struct platform_device *pdev)
> keymap_data = pdata->keymap_data ?: &tegra_kbc_default_keymap_data;
> matrix_keypad_build_keymap(keymap_data, KBC_ROW_SHIFT,
> input_dev->keycode, input_dev->keybit);
> + kbc->wakeup_key = pdata->wakeup_key;
>
> - err = request_irq(kbc->irq, tegra_kbc_isr, IRQF_TRIGGER_HIGH,
> - pdev->name, kbc);
> + err = request_irq(kbc->irq, tegra_kbc_isr,
> + IRQF_NO_SUSPEND | IRQF_TRIGGER_HIGH, pdev->name, kbc);
> if (err) {
> dev_err(&pdev->dev, "failed to request keyboard IRQ\n");
> goto err_put_clk;
> @@ -738,7 +745,6 @@ static int tegra_kbc_suspend(struct device *dev)
>
> mutex_lock(&kbc->idev->mutex);
> if (device_may_wakeup(&pdev->dev)) {
> - disable_irq(kbc->irq);
> del_timer_sync(&kbc->timer);
> tegra_kbc_set_fifo_interrupt(kbc, false);
>
> @@ -754,6 +760,7 @@ static int tegra_kbc_suspend(struct device *dev)
> tegra_kbc_setup_wakekeys(kbc, true);
> msleep(30);
>
> + kbc->keypress_caused_wake = false;
> enable_irq_wake(kbc->irq);
> } else {
> if (kbc->idev->users)
> @@ -780,7 +787,12 @@ static int tegra_kbc_resume(struct device *dev)
>
> tegra_kbc_set_fifo_interrupt(kbc, true);
>
> - enable_irq(kbc->irq);
> + if (kbc->keypress_caused_wake && kbc->wakeup_key) {
> + input_report_key(kbc->idev, kbc->wakeup_key, 1);
> + input_sync(kbc->idev);
> + input_report_key(kbc->idev, kbc->wakeup_key, 0);
> + input_sync(kbc->idev);
Would you mind moving this block into the ISR itself? If we leave ISR
running then there is no reason to postpone event generation, is there?
If not then we can get rid of kbc->keypress_caused_wake.
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2011-12-29 10:32 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-30 20:43 [PATCH v1] Input: tegra-kbc - report wakeup key for some platforms riyer-DDmLM1+adcrQT0dZR+AlfA
[not found] ` <1322685811-14060-1-git-send-email-riyer-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2011-11-30 21:07 ` Stephen Warren
2011-11-30 21:20 ` Dmitry Torokhov
2011-11-30 22:14 ` Rakesh Iyer
[not found] ` <1FC56210173BB445BD77F608D6FB8D034F3D1BB4BD-lR+7xdUAJVNDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2011-12-01 7:26 ` Dmitry Torokhov
2011-12-01 21:09 ` Rakesh Iyer
[not found] ` <1FC56210173BB445BD77F608D6FB8D034F3D1BB4C9-lR+7xdUAJVNDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2011-12-04 8:50 ` Dmitry Torokhov
2011-12-05 1:18 ` riyer
[not found] ` <1323047897.3056.14.camel-73r3X0hAYrhxWE4FnwvcdlaTQe2KTcn/@public.gmane.org>
2011-12-05 4:27 ` Dmitry Torokhov
2011-12-05 5:52 ` Rakesh Iyer
2011-12-29 10:32 ` Dmitry Torokhov
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).