linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] Input/spear-keyboard: Fix for balancing the enable_irq_wake in Power Mgmt
@ 2012-02-23  9:40 Viresh Kumar
  2012-02-23  9:40 ` [PATCH 2/2] Input/spear-keyboard: Provide thaw and poweroff routines Viresh Kumar
  2012-02-24  8:34 ` [PATCH 1/2] Input/spear-keyboard: Fix for balancing the enable_irq_wake in Power Mgmt Dmitry Torokhov
  0 siblings, 2 replies; 12+ messages in thread
From: Viresh Kumar @ 2012-02-23  9:40 UTC (permalink / raw)
  To: dmitry.torokhov
  Cc: linux-input, armando.visconti, shiraz.hashim, vipin.kumar,
	rajeev-dlh.kumar, deepak.sikri, vipulkumar.samar, amit.virdi,
	viresh.kumar, pratyush.anand, bhupesh.sharma, viresh.linux,
	bhavna.yadav, vincenzo.frascino, mirko.gardi

From: Deepak Sikri <deepak.sikri@st.com>

This patch handles the fix for unbalanced irq for the cases when
enable_irq_wake fails, and a warning related to same is displayed
on the console. The workaround is handled at the driver level.

Signed-off-by: Deepak Sikri <deepak.sikri@st.com>
Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Rajeev Kumar <rajeev-dlh.kumar@st.com>
---
 drivers/input/keyboard/spear-keyboard.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/input/keyboard/spear-keyboard.c b/drivers/input/keyboard/spear-keyboard.c
index 0e7f686..6eb2dd8 100644
--- a/drivers/input/keyboard/spear-keyboard.c
+++ b/drivers/input/keyboard/spear-keyboard.c
@@ -58,6 +58,7 @@ struct spear_kbd {
 	void __iomem *io_base;
 	struct clk *clk;
 	unsigned int irq;
+	unsigned int irq_wake;
 	unsigned short last_key;
 	unsigned int mode;
 	unsigned short keycodes[256];
@@ -287,8 +288,10 @@ static int spear_kbd_suspend(struct device *dev)
 	if (input_dev->users)
 		clk_enable(kbd->clk);
 
-	if (device_may_wakeup(&pdev->dev))
-		enable_irq_wake(kbd->irq);
+	if (device_may_wakeup(&pdev->dev)) {
+		if (!enable_irq_wake(kbd->irq))
+			kbd->irq_wake = 1;
+	}
 
 	mutex_unlock(&input_dev->mutex);
 
@@ -303,8 +306,12 @@ static int spear_kbd_resume(struct device *dev)
 
 	mutex_lock(&input_dev->mutex);
 
-	if (device_may_wakeup(&pdev->dev))
-		disable_irq_wake(kbd->irq);
+	if (device_may_wakeup(&pdev->dev)) {
+		if (kbd->irq_wake) {
+			kbd->irq_wake = 0;
+			disable_irq_wake(kbd->irq);
+		}
+	}
 
 	if (input_dev->users)
 		clk_enable(kbd->clk);
-- 
1.7.8.110.g4cb5d


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2012-02-24  9:13 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-23  9:40 [PATCH 1/2] Input/spear-keyboard: Fix for balancing the enable_irq_wake in Power Mgmt Viresh Kumar
2012-02-23  9:40 ` [PATCH 2/2] Input/spear-keyboard: Provide thaw and poweroff routines Viresh Kumar
2012-02-23 10:35   ` Viresh Kumar
2012-02-23 11:29   ` Shubhrajyoti
2012-02-23 11:56     ` Viresh Kumar
2012-02-23 11:59       ` Viresh Kumar
2012-02-23 12:11       ` Shubhrajyoti
2012-02-24  5:29   ` [PATCH V2] " Viresh Kumar
2012-02-24  8:34 ` [PATCH 1/2] Input/spear-keyboard: Fix for balancing the enable_irq_wake in Power Mgmt Dmitry Torokhov
2012-02-24  8:58   ` deepaksi
2012-02-24  9:02     ` Dmitry Torokhov
2012-02-24  9:12       ` deepaksi

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).