diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/input/keyboard/atkbd.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c index 904d4c9fbf22..73b530424729 100644 --- a/drivers/input/keyboard/atkbd.c +++ b/drivers/input/keyboard/atkbd.c | |||
@@ -770,6 +770,30 @@ static int atkbd_select_set(struct atkbd *atkbd, int target_set, int allow_extra | |||
770 | return 3; | 770 | return 3; |
771 | } | 771 | } |
772 | 772 | ||
773 | static int atkbd_reset_state(struct atkbd *atkbd) | ||
774 | { | ||
775 | struct ps2dev *ps2dev = &atkbd->ps2dev; | ||
776 | unsigned char param[1]; | ||
777 | |||
778 | /* | ||
779 | * Set the LEDs to a predefined state (all off). | ||
780 | */ | ||
781 | |||
782 | param[0] = 0; | ||
783 | if (ps2_command(ps2dev, param, ATKBD_CMD_SETLEDS)) | ||
784 | return -1; | ||
785 | |||
786 | /* | ||
787 | * Set autorepeat to fastest possible. | ||
788 | */ | ||
789 | |||
790 | param[0] = 0; | ||
791 | if (ps2_command(ps2dev, param, ATKBD_CMD_SETREP)) | ||
792 | return -1; | ||
793 | |||
794 | return 0; | ||
795 | } | ||
796 | |||
773 | static int atkbd_activate(struct atkbd *atkbd) | 797 | static int atkbd_activate(struct atkbd *atkbd) |
774 | { | 798 | { |
775 | struct ps2dev *ps2dev = &atkbd->ps2dev; | 799 | struct ps2dev *ps2dev = &atkbd->ps2dev; |
@@ -1087,6 +1111,7 @@ static int atkbd_connect(struct serio *serio, struct serio_driver *drv) | |||
1087 | } | 1111 | } |
1088 | 1112 | ||
1089 | atkbd->set = atkbd_select_set(atkbd, atkbd_set, atkbd_extra); | 1113 | atkbd->set = atkbd_select_set(atkbd, atkbd_set, atkbd_extra); |
1114 | atkbd_reset_state(atkbd); | ||
1090 | atkbd_activate(atkbd); | 1115 | atkbd_activate(atkbd); |
1091 | 1116 | ||
1092 | } else { | 1117 | } else { |
@@ -1267,6 +1292,7 @@ static ssize_t atkbd_set_extra(struct atkbd *atkbd, const char *buf, size_t coun | |||
1267 | 1292 | ||
1268 | atkbd->dev = new_dev; | 1293 | atkbd->dev = new_dev; |
1269 | atkbd->set = atkbd_select_set(atkbd, atkbd->set, value); | 1294 | atkbd->set = atkbd_select_set(atkbd, atkbd->set, value); |
1295 | atkbd_reset_state(atkbd); | ||
1270 | atkbd_activate(atkbd); | 1296 | atkbd_activate(atkbd); |
1271 | atkbd_set_keycode_table(atkbd); | 1297 | atkbd_set_keycode_table(atkbd); |
1272 | atkbd_set_device_attrs(atkbd); | 1298 | atkbd_set_device_attrs(atkbd); |