atkbd: fix resume from ACPI S3
authorAlexander Polakov <polachok@gmail.com>
Thu, 15 Oct 2009 17:25:03 +0000 (21:25 +0400)
committerAlexander Polakov <polachok@gmail.com>
Thu, 15 Oct 2009 17:25:03 +0000 (21:25 +0400)
sys/dev/misc/atkbd/atkbd_isa.c

index 02eaa64..f3915f8 100644 (file)
@@ -120,13 +120,23 @@ atkbdattach(device_t dev)
 static int
 atkbdresume(device_t dev)
 {
-       keyboard_t *kbd;
-
-       kbd = kbd_get_keyboard(kbd_find_keyboard(ATKBD_DRIVER_NAME,
-                                                device_get_unit(dev)));
-       if (kbd)
-               kbd_clear_state(kbd);
-       return 0;
+        atkbd_softc_t *sc;
+        keyboard_t *kbd;
+        int args[2];
+
+        sc = device_get_softc(dev);
+        kbd = kbd_get_keyboard(kbd_find_keyboard(ATKBD_DRIVER_NAME,
+                                                 device_get_unit(dev)));
+        if (kbd) {
+                kbd->kb_flags &= ~KB_INITIALIZED;
+                args[0] = device_get_unit(device_get_parent(dev));
+                args[1] = rman_get_start(sc->intr);
+               (*kbdsw[kbd->kb_index]->init)(device_get_unit(dev), &kbd,
+                                              args, device_get_flags(dev));
+               (*kbdsw[kbd->kb_index]->clear_state)(kbd);
+
+        }
+        return 0;
 }
 
 static void