aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/keyboard/atkbd.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2009-11-13 02:19:05 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2009-11-13 02:21:04 -0500
commitd4119bdacfcd88a763e250fe0efa6a2e11d30e88 (patch)
treefc48992cd86f3f9d2226915490464599490ca66c /drivers/input/keyboard/atkbd.c
parent3cc96351799d3d82c3809aa6970ef537bc1af553 (diff)
Input: atkbd - restore LED state at reconnect
Even though input core tells us to restore LED state and repeat rate at resume keyboard may be reconnected either by request from userspace (via sysfs) or just by pulling it from the box and plugging it back in. In these cases we still need to restore state ourselves. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/keyboard/atkbd.c')
-rw-r--r--drivers/input/keyboard/atkbd.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
index 4452eabbee6d..28e6110d1ff8 100644
--- a/drivers/input/keyboard/atkbd.c
+++ b/drivers/input/keyboard/atkbd.c
@@ -1174,6 +1174,18 @@ static int atkbd_reconnect(struct serio *serio)
1174 return -1; 1174 return -1;
1175 1175
1176 atkbd_activate(atkbd); 1176 atkbd_activate(atkbd);
1177
1178 /*
1179 * Restore LED state and repeat rate. While input core
1180 * will do this for us at resume time reconnect may happen
1181 * because user requested it via sysfs or simply because
1182 * keyboard was unplugged and plugged in again so we need
1183 * to do it ourselves here.
1184 */
1185 atkbd_set_leds(atkbd);
1186 if (!atkbd->softrepeat)
1187 atkbd_set_repeat_rate(atkbd);
1188
1177 } 1189 }
1178 1190
1179 atkbd_enable(atkbd); 1191 atkbd_enable(atkbd);
@@ -1422,6 +1434,7 @@ static ssize_t atkbd_set_set(struct atkbd *atkbd, const char *buf, size_t count)
1422 1434
1423 atkbd->dev = new_dev; 1435 atkbd->dev = new_dev;
1424 atkbd->set = atkbd_select_set(atkbd, value, atkbd->extra); 1436 atkbd->set = atkbd_select_set(atkbd, value, atkbd->extra);
1437 atkbd_reset_state(atkbd);
1425 atkbd_activate(atkbd); 1438 atkbd_activate(atkbd);
1426 atkbd_set_keycode_table(atkbd); 1439 atkbd_set_keycode_table(atkbd);
1427 atkbd_set_device_attrs(atkbd); 1440 atkbd_set_device_attrs(atkbd);