Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 167679
b: refs/heads/master
c: fc0eb28
h: refs/heads/master
i:
  167677: d7e1f9d
  167675: 5ec677d
  167671: 52aebf7
  167663: c0c4c34
  167647: 463b1bb
  167615: 13ee961
  167551: 208df75
  167423: 2973b9e
v: v3
  • Loading branch information
Dmitry Torokhov committed Oct 13, 2009
1 parent d3dffbd commit 0579fef
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7dcc9c230fcef0067efee17c1f8c3c84494a7ec8
refs/heads/master: fc0eb28c0031ec2da872dd296b551453eb1963c9
26 changes: 26 additions & 0 deletions trunk/drivers/input/keyboard/atkbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,30 @@ static int atkbd_select_set(struct atkbd *atkbd, int target_set, int allow_extra
return 3;
}

static int atkbd_reset_state(struct atkbd *atkbd)
{
struct ps2dev *ps2dev = &atkbd->ps2dev;
unsigned char param[1];

/*
* Set the LEDs to a predefined state (all off).
*/

param[0] = 0;
if (ps2_command(ps2dev, param, ATKBD_CMD_SETLEDS))
return -1;

/*
* Set autorepeat to fastest possible.
*/

param[0] = 0;
if (ps2_command(ps2dev, param, ATKBD_CMD_SETREP))
return -1;

return 0;
}

static int atkbd_activate(struct atkbd *atkbd)
{
struct ps2dev *ps2dev = &atkbd->ps2dev;
Expand Down Expand Up @@ -1087,6 +1111,7 @@ static int atkbd_connect(struct serio *serio, struct serio_driver *drv)
}

atkbd->set = atkbd_select_set(atkbd, atkbd_set, atkbd_extra);
atkbd_reset_state(atkbd);
atkbd_activate(atkbd);

} else {
Expand Down Expand Up @@ -1267,6 +1292,7 @@ static ssize_t atkbd_set_extra(struct atkbd *atkbd, const char *buf, size_t coun

atkbd->dev = new_dev;
atkbd->set = atkbd_select_set(atkbd, atkbd->set, value);
atkbd_reset_state(atkbd);
atkbd_activate(atkbd);
atkbd_set_keycode_table(atkbd);
atkbd_set_device_attrs(atkbd);
Expand Down

0 comments on commit 0579fef

Please sign in to comment.