aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/serio/serio.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2009-09-16 00:48:32 -0400
committerPaul Mundt <lethal@linux-sh.org>2009-09-16 00:48:32 -0400
commitea88023b3491a384575ebcd5e8a449e841a28a24 (patch)
treef46e3d8302e44dc55ce31823501e100472d29683 /drivers/input/serio/serio.c
parenta6f15ade97989d414e9bf33874c9d5d1f39808ec (diff)
parent0cb583fd2862f19ea88b02eb307d11c09e51e2f8 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts: arch/sh/kernel/vmlinux.lds.S
Diffstat (limited to 'drivers/input/serio/serio.c')
-rw-r--r--drivers/input/serio/serio.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
index d66f4944f2a0..0236f0d5fd91 100644
--- a/drivers/input/serio/serio.c
+++ b/drivers/input/serio/serio.c
@@ -931,15 +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
941 serio->suspended = state.event == PM_EVENT_SUSPEND ||
942 state.event == PM_EVENT_FREEZE;
943 939
944 return 0; 940 return 0;
945} 941}
@@ -952,13 +948,17 @@ static int serio_resume(struct device *dev)
952 * Driver reconnect can take a while, so better let kseriod 948 * Driver reconnect can take a while, so better let kseriod
953 * deal with it. 949 * deal with it.
954 */ 950 */
955 if (serio->suspended) { 951 serio_queue_event(serio, NULL, SERIO_RECONNECT_PORT);
956 serio->suspended = false;
957 serio_queue_event(serio, NULL, SERIO_RECONNECT_PORT);
958 }
959 952
960 return 0; 953 return 0;
961} 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};
962#endif /* CONFIG_PM */ 962#endif /* CONFIG_PM */
963 963
964/* called from serio_driver->connect/disconnect methods under serio_mutex */ 964/* called from serio_driver->connect/disconnect methods under serio_mutex */
@@ -1015,8 +1015,7 @@ static struct bus_type serio_bus = {
1015 .remove = serio_driver_remove, 1015 .remove = serio_driver_remove,
1016 .shutdown = serio_shutdown, 1016 .shutdown = serio_shutdown,
1017#ifdef CONFIG_PM 1017#ifdef CONFIG_PM
1018 .suspend = serio_suspend, 1018 .pm = &serio_pm_ops,
1019 .resume = serio_resume,
1020#endif 1019#endif
1021}; 1020};
1022 1021