[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1428065887-16017-2-git-send-email-tomeu.vizoso@collabora.com>
Date: Fri, 3 Apr 2015 14:57:50 +0200
From: Tomeu Vizoso <tomeu.vizoso@...labora.com>
To: linux-pm@...r.kernel.org
Cc: Tomeu Vizoso <tomeu.vizoso@...labora.com>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
linux-input@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH v2 1/7] Input: Implement dev_pm_ops.prepare in input_class
Have it return 1 so that input handlers don't block input devices from
remaining runtime suspended when the system goes into a sleep state. For
this to happen, the handler device needs to have runtime PM enabled.
This can make resume times considerably shorter because these devices
won't be resumed when the system is awaken.
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@...labora.com>
---
drivers/input/input.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/input/input.c b/drivers/input/input.c
index cc357f1..9666309 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -1748,6 +1748,15 @@ static const struct dev_pm_ops input_dev_pm_ops = {
.poweroff = input_dev_poweroff,
.restore = input_dev_resume,
};
+
+static int input_class_prepare(struct device *dev)
+{
+ return 1;
+}
+
+static const struct dev_pm_ops input_class_pm_ops = {
+ .prepare = input_class_prepare,
+};
#endif /* CONFIG_PM */
static struct device_type input_dev_type = {
@@ -1767,6 +1776,9 @@ static char *input_devnode(struct device *dev, umode_t *mode)
struct class input_class = {
.name = "input",
.devnode = input_devnode,
+#ifdef CONFIG_PM_SLEEP
+ .pm = &input_class_pm_ops,
+#endif
};
EXPORT_SYMBOL_GPL(input_class);
--
2.3.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists