aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/serio/serio.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/serio/serio.c')
-rw-r--r--drivers/input/serio/serio.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
index fb17573f8f2..0236f0d5fd9 100644
--- a/drivers/input/serio/serio.c
+++ b/drivers/input/serio/serio.c
@@ -931,14 +931,11 @@ static int serio_uevent(struct device *dev, struct kobj_uevent_env *env)
931#endif /* CONFIG_HOTPLUG */ 931#endif /* CONFIG_HOTPLUG */
932 932
933#ifdef CONFIG_PM 933#ifdef CONFIG_PM
934static int serio_suspend(struct device *dev, pm_message_t state) 934static int serio_suspend(struct device *dev)
935{ 935{
936 struct serio *serio = to_serio_port(dev); 936 struct serio *serio = to_serio_port(dev);
937 937
938 if (!serio->suspended && state.event == PM_EVENT_SUSPEND) { 938 serio_cleanup(serio);
939 serio_cleanup(serio);
940 serio->suspended = true;
941 }
942 939
943 return 0; 940 return 0;
944} 941}
@@ -951,13 +948,17 @@ static int serio_resume(struct device *dev)
951 * Driver reconnect can take a while, so better let kseriod 948 * Driver reconnect can take a while, so better let kseriod
952 * deal with it. 949 * deal with it.
953 */ 950 */
954 if (serio->suspended) { 951 serio_queue_event(serio, NULL, SERIO_RECONNECT_PORT);
955 serio->suspended = false;
956 serio_queue_event(serio, NULL, SERIO_RECONNECT_PORT);
957 }
958 952
959 return 0; 953 return 0;
960} 954}
955
956static const struct dev_pm_ops serio_pm_ops = {
957 .suspend = serio_suspend,
958 .resume = serio_resume,
959 .poweroff = serio_suspend,
960 .restore = serio_resume,
961};
961#endif /* CONFIG_PM */ 962#endif /* CONFIG_PM */
962 963
963/* called from serio_driver->connect/disconnect methods under serio_mutex */ 964/* called from serio_driver->connect/disconnect methods under serio_mutex */
@@ -1014,8 +1015,7 @@ static struct bus_type serio_bus = {
1014 .remove = serio_driver_remove, 1015 .remove = serio_driver_remove,
1015 .shutdown = serio_shutdown, 1016 .shutdown = serio_shutdown,
1016#ifdef CONFIG_PM 1017#ifdef CONFIG_PM
1017 .suspend = serio_suspend, 1018 .pm = &serio_pm_ops,
1018 .resume = serio_resume,
1019#endif 1019#endif
1020}; 1020};
1021 1021