All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/4] input/nomadik-ske: suspend and resume support
@ 2012-06-17 14:17 Linus Walleij
  2012-06-25  7:31 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Linus Walleij @ 2012-06-17 14:17 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, Naveen Kumar Gaddipati, Linus Walleij

From: Naveen Kumar Gaddipati <naveen.gaddipati@stericsson.com>

Suspend and resume support for ske keypad by using disable or
enable of keypad.

Signed-off-by: Naveen Kumar Gaddipati <naveen.gaddipati@stericsson.com>
Reviewed-by: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/input/keyboard/nomadik-ske-keypad.c |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/input/keyboard/nomadik-ske-keypad.c b/drivers/input/keyboard/nomadik-ske-keypad.c
index 6857454..68c36a7 100644
--- a/drivers/input/keyboard/nomadik-ske-keypad.c
+++ b/drivers/input/keyboard/nomadik-ske-keypad.c
@@ -368,8 +368,11 @@ static int ske_keypad_suspend(struct device *dev)
 
 	if (device_may_wakeup(dev))
 		enable_irq_wake(irq);
-	else
+	else {
+		disable_irq(keypad->irq);
 		ske_keypad_set_bits(keypad, SKE_IMSC, ~SKE_KPIMA, 0x0);
+		clk_disable(keypad->clk);
+	}
 
 	return 0;
 }
@@ -382,8 +385,11 @@ static int ske_keypad_resume(struct device *dev)
 
 	if (device_may_wakeup(dev))
 		disable_irq_wake(irq);
-	else
-		ske_keypad_set_bits(keypad, SKE_IMSC, 0x0, SKE_KPIMA);
+	else {
+		clk_enable(keypad->clk);
+		enable_irq(keypad->irq);
+		ske_keypad_chip_init(keypad);
+	}
 
 	return 0;
 }
-- 
1.7.9.2


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

* Re: [PATCH 2/4] input/nomadik-ske: suspend and resume support
  2012-06-17 14:17 [PATCH 2/4] input/nomadik-ske: suspend and resume support Linus Walleij
@ 2012-06-25  7:31 ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2012-06-25  7:31 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-input, Naveen Kumar Gaddipati, Linus Walleij

Hi Linus,

On Sun, Jun 17, 2012 at 04:17:51PM +0200, Linus Walleij wrote:
> From: Naveen Kumar Gaddipati <naveen.gaddipati@stericsson.com>
> 
> Suspend and resume support for ske keypad by using disable or
> enable of keypad.

I do not understand this changelog entry. The driver appears to already
have suspend/resume handling, but apparently it is deficient. Please
explain exactly why old implementation is not enough.

> 
> Signed-off-by: Naveen Kumar Gaddipati <naveen.gaddipati@stericsson.com>
> Reviewed-by: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  drivers/input/keyboard/nomadik-ske-keypad.c |   12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/input/keyboard/nomadik-ske-keypad.c b/drivers/input/keyboard/nomadik-ske-keypad.c
> index 6857454..68c36a7 100644
> --- a/drivers/input/keyboard/nomadik-ske-keypad.c
> +++ b/drivers/input/keyboard/nomadik-ske-keypad.c
> @@ -368,8 +368,11 @@ static int ske_keypad_suspend(struct device *dev)
>  
>  	if (device_may_wakeup(dev))
>  		enable_irq_wake(irq);
> -	else
> +	else {
> +		disable_irq(keypad->irq);
>  		ske_keypad_set_bits(keypad, SKE_IMSC, ~SKE_KPIMA, 0x0);
> +		clk_disable(keypad->clk);
> +	}
>  
>  	return 0;
>  }
> @@ -382,8 +385,11 @@ static int ske_keypad_resume(struct device *dev)
>  
>  	if (device_may_wakeup(dev))
>  		disable_irq_wake(irq);
> -	else
> -		ske_keypad_set_bits(keypad, SKE_IMSC, 0x0, SKE_KPIMA);
> +	else {
> +		clk_enable(keypad->clk);
> +		enable_irq(keypad->irq);
> +		ske_keypad_chip_init(keypad);

ske_keypad_chip_init() is marked __init, if it is used in resume it has
to lose this markup.

Thanks.

-- 
Dmitry

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

end of thread, other threads:[~2012-06-25  7:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-17 14:17 [PATCH 2/4] input/nomadik-ske: suspend and resume support Linus Walleij
2012-06-25  7:31 ` Dmitry Torokhov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.