Thread (4 messages) 4 messages, 4 authors, 2010-12-08

RE: [PATCH v6 8/8] Input: omap4 - pm runtime

From: Datta, Shubhrajyoti <hidden>
Date: 2010-12-06 13:00:00
Also in: linux-omap

Possibly related (same subject, not in this thread)

Kevin,
-----Original Message-----
From: linux-input-owner@vger.kernel.org [mailto:linux-input-
owner@vger.kernel.org] On Behalf Of Kevin Hilman
Sent: Thursday, September 30, 2010 7:21 PM
To: Arce, Abraham
Cc: linux-input@vger.kernel.org; linux-omap@vger.kernel.org
Subject: Re: [PATCH v6 8/8] Input: omap4 - pm runtime

Abraham Arce [off-list ref] writes:
quoted
Enable pm runtime in driver
So power is enabled on probe and cut on _remove().  Did you consider
doing any more fine grained PM for this device?  For example, cutting
power after some inactivity timer and re-enabling on a
keypress/interrupt?
My idea is that the clock needs to be on to get interrupts (OMAP4 the control is at module level and  ick/fclk level control is difficult). So disabling will prevent interrupts. 
The keypad is in wakeup domain which is always on. So the power impact may be minimal.

What do you think.
Kevin


quoted
Reviewed-by: Basak, Partha <redacted>
Signed-off-by: Abraham Arce <redacted>
---
 drivers/input/keyboard/omap4-keypad.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/drivers/input/keyboard/omap4-keypad.c
b/drivers/input/keyboard/omap4-keypad.c
quoted
index 45bd097..ed47e9a 100644
--- a/drivers/input/keyboard/omap4-keypad.c
+++ b/drivers/input/keyboard/omap4-keypad.c
@@ -29,6 +29,7 @@
 #include <linux/io.h>
 #include <linux/input.h>
 #include <linux/slab.h>
+#include <linux/pm_runtime.h>

 #include <plat/omap4-keypad.h>
@@ -239,6 +240,9 @@ static int __devinit omap4_keypad_probe(struct
platform_device *pdev)
quoted
 	matrix_keypad_build_keymap(pdata->keymap_data, row_shift,
 			input_dev->keycode, input_dev->keybit);

+	pm_runtime_enable(&pdev->dev);
+	pm_runtime_get_sync(&pdev->dev);
+
 	omap4_keypad_config(keypad_data);

 	error = request_irq(keypad_data->irq, omap4_keypad_interrupt,
@@ -277,6 +281,9 @@ static int __devexit omap4_keypad_remove(struct
platform_device *pdev)
quoted
 	struct omap4_keypad *keypad_data = platform_get_drvdata(pdev);
 	struct resource *res;

+	pm_runtime_put_sync(&pdev->dev);
+	pm_runtime_disable(&pdev->dev);
+
 	free_irq(keypad_data->irq, keypad_data);
 	input_unregister_device(keypad_data->input);
--
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