aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/serio/i8042.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2009-05-09 19:08:05 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2009-05-09 19:10:18 -0400
commit7e044e056a6aa0dc695db50461d7b326fde15e8b (patch)
treebc0a26dbd140e54e1cfa9d67ad93ad890f50775f /drivers/input/serio/i8042.c
parent6f660f12d703fa23069317f0a64c6b75d08c15c2 (diff)
Input: serio - do not use deprecated dev.power.power_state
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/serio/i8042.c')
-rw-r--r--drivers/input/serio/i8042.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index 3cffb704e37..f919bf57293 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -10,6 +10,7 @@
10 * the Free Software Foundation. 10 * the Free Software Foundation.
11 */ 11 */
12 12
13#include <linux/types.h>
13#include <linux/delay.h> 14#include <linux/delay.h>
14#include <linux/module.h> 15#include <linux/module.h>
15#include <linux/interrupt.h> 16#include <linux/interrupt.h>
@@ -921,6 +922,9 @@ static void i8042_dritek_enable(void)
921#endif 922#endif
922 923
923#ifdef CONFIG_PM 924#ifdef CONFIG_PM
925
926static bool i8042_suspended;
927
924/* 928/*
925 * Here we try to restore the original BIOS settings. We only want to 929 * Here we try to restore the original BIOS settings. We only want to
926 * do that once, when we really suspend, not when we taking memory 930 * do that once, when we really suspend, not when we taking memory
@@ -930,11 +934,9 @@ static void i8042_dritek_enable(void)
930 934
931static int i8042_suspend(struct platform_device *dev, pm_message_t state) 935static int i8042_suspend(struct platform_device *dev, pm_message_t state)
932{ 936{
933 if (dev->dev.power.power_state.event != state.event) { 937 if (!i8042_suspended && state.event == PM_EVENT_SUSPEND) {
934 if (state.event == PM_EVENT_SUSPEND) 938 i8042_controller_reset();
935 i8042_controller_reset(); 939 i8042_suspended = true;
936
937 dev->dev.power.power_state = state;
938 } 940 }
939 941
940 return 0; 942 return 0;
@@ -952,7 +954,7 @@ static int i8042_resume(struct platform_device *dev)
952/* 954/*
953 * Do not bother with restoring state if we haven't suspened yet 955 * Do not bother with restoring state if we haven't suspened yet
954 */ 956 */
955 if (dev->dev.power.power_state.event == PM_EVENT_ON) 957 if (!i8042_suspended)
956 return 0; 958 return 0;
957 959
958 error = i8042_controller_check(); 960 error = i8042_controller_check();
@@ -998,10 +1000,9 @@ static int i8042_resume(struct platform_device *dev)
998 if (i8042_ports[I8042_KBD_PORT_NO].serio) 1000 if (i8042_ports[I8042_KBD_PORT_NO].serio)
999 i8042_enable_kbd_port(); 1001 i8042_enable_kbd_port();
1000 1002
1003 i8042_suspended = false;
1001 i8042_interrupt(0, NULL); 1004 i8042_interrupt(0, NULL);
1002 1005
1003 dev->dev.power.power_state = PMSG_ON;
1004
1005 return 0; 1006 return 0;
1006} 1007}
1007#endif /* CONFIG_PM */ 1008#endif /* CONFIG_PM */