Thread (6 messages) 6 messages, 3 authors, 2010-06-24
STALE5802d

Re: [PATCH v2] input/imx_keypad: add PM support

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2010-06-24 16:39:07
Also in: linux-arm-kernel

On Thu, Jun 17, 2010 at 08:59:01PM +0200, Eric Bénard wrote:
quoted hunk ↗ jump to hunk
We use keypad_data to enable wakeup from platform data

suspend/resume is tested on an i.MX27 when keypad is not
in use and when it's is in use (in which case we immediatly
get the key pressed at wakeup)

Signed-off-by: Eric Bénard <redacted>
Cc: maramaopercheseimorto@gmail.com
Cc: linux-input@vger.kernel.org
Cc: dmitry.torokhov@gmail.com
Cc: linux-arm-kernel@lists.infradead.org
---
v2 :
	- simplify suspend & resume functions
	- convert to pm_ops

 drivers/input/keyboard/imx_keypad.c |   40 +++++++++++++++++++++++++++++++++-
 1 files changed, 38 insertions(+), 2 deletions(-)
diff --git a/drivers/input/keyboard/imx_keypad.c b/drivers/input/keyboard/imx_keypad.c
index d92c15c..9aa0005 100644
--- a/drivers/input/keyboard/imx_keypad.c
+++ b/drivers/input/keyboard/imx_keypad.c
@@ -364,6 +364,38 @@ static void imx_keypad_inhibit(struct imx_keypad *keypad)
 	writew(0xff00, keypad->mmio_base + KPCR);
 }
 
+#ifdef CONFIG_PM
+static int mxc_kpp_suspend(struct device *dev)
+{
+	struct platform_device *pdev = to_platform_device(dev);
+	struct imx_keypad *keypad = platform_get_drvdata(pdev);
+
+	keypad->enabled = false;
+	synchronize_irq(keypad->irq);
+	disable_irq(keypad->irq);
+	clk_disable(keypad->clk);
+
This is not correct. imx_keypad_probe() keypad->enabled = false, waiting for
imx_keypad_open() to be called. However if nobody opens the device and
you go through suspend/resume cycle you'll leave keypad->enabled = true.


BTW, why do you call new functions mxc_kpp_XXX  while the rest of the
driver uses imx_keypad_XXX naming?

Thanks.

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help