[PATCH] atkbd: restore autorepeat rate after resume

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Linus Torvalds <[email protected]>

This patch (as728) makes the AT keyboard driver store the current
autorepeat rate so that it can be restored properly following a 
suspend/resume cycle.

Signed-off-by: Alan Stern <[email protected]>

---

Index: usb-2.6/drivers/input/keyboard/atkbd.c
===================================================================
--- usb-2.6.orig/drivers/input/keyboard/atkbd.c
+++ usb-2.6/drivers/input/keyboard/atkbd.c
@@ -39,6 +39,8 @@ static int atkbd_set = 2;
 module_param_named(set, atkbd_set, int, 0);
 MODULE_PARM_DESC(set, "Select keyboard code set (2 = default, 3 = PS/2 native)");
 
+static int atkbd_repeatrate;
+
 #if defined(__i386__) || defined(__x86_64__) || defined(__hppa__)
 static int atkbd_reset;
 #else
@@ -477,7 +479,7 @@ static void atkbd_event_work(void *data)
 			j++;
 		dev->rep[REP_PERIOD] = period[i];
 		dev->rep[REP_DELAY] = delay[j];
-		param[0] = i | (j << 5);
+		param[0] = atkbd_repeatrate = i | (j << 5);
 		ps2_command(&atkbd->ps2dev, param, ATKBD_CMD_SETREP);
 	}
 
@@ -676,10 +678,10 @@ static int atkbd_activate(struct atkbd *
 		return -1;
 
 /*
- * Set autorepeat to fastest possible.
+ * Set autorepeat to whatever it used to be.
  */
 
-	param[0] = 0;
+	param[0] = atkbd_repeatrate;
 	if (ps2_command(ps2dev, param, ATKBD_CMD_SETREP))
 		return -1;
 

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux