Re: [PATCH 2/6] input/spear_keyboard: fix clock handling during suspend/resume

From
Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date
2012-07-08 01:12:00
Reply to
Shiraz Hashim, 2012-07-02
Hi Shiraz,

On Mon, Jul 02, 2012 at 12:20:10PM +0530, Shiraz Hashim wrote:
quoted hunk ↗ jump to hunk
SPEAr keyboard should normally disable clock during suspend and enable it
during resume.

For cases where it is expected to act as a wakeup source the clock can
remain in the same state i.e. kept enabled if it is being used.

Signed-off-by: Shiraz Hashim <redacted>
---
 drivers/input/keyboard/spear-keyboard.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/input/keyboard/spear-keyboard.c b/drivers/input/keyboard/spear-keyboard.c
index 67d9afb..ef147f3 100644
--- a/drivers/input/keyboard/spear-keyboard.c
+++ b/drivers/input/keyboard/spear-keyboard.c
@@ -318,12 +318,12 @@ static int spear_kbd_suspend(struct device *dev)
 
 	mutex_lock(&input_dev->mutex);
 
-	if (input_dev->users)
-		clk_enable(kbd->clk);
-
 	if (device_may_wakeup(&pdev->dev)) {
 		if (!enable_irq_wake(kbd->irq))
 			kbd->irq_wake = 1;
+	} else {
+		if (input_dev->users)
+			clk_disable(kbd->clk);
 	}
This patch does not apply to mainline version of the driver because the
change introducing handling for enable_irq_wake() failures was rejected
from mainline. I also have not appplied the 6th patch in the series
because it depends on this one.

Also, don't you need to enable clock if device is marked as wakeup
source but happens to have no active users?

Thanks.

-- 
Dmitry
Thread (10 messages) 10 messages, 2 authors, last reply 2012-07-09
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help