Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/dtor/input

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: synaptics - retry failed resets when reconnecting
  Input: synaptics - fix reconnect logic on MT devices
  Input: tegra-kbc - fix keymap entry for LeftMeta key
  Input: tegra-kbc - fix build error
  • Loading branch information
torvalds committed Jan 31, 2011
2 parents aa5bd67 + c63fe0a commit 1ca05b7
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 11 deletions.
6 changes: 3 additions & 3 deletions drivers/input/keyboard/tegra-kbc.c
Expand Up @@ -86,7 +86,7 @@ static const u32 tegra_kbc_default_keymap[] = {
KEY(0, 5, KEY_Z),
KEY(0, 7, KEY_FN),

KEY(1, 7, KEY_MENU),
KEY(1, 7, KEY_LEFTMETA),

KEY(2, 6, KEY_RIGHTALT),
KEY(2, 7, KEY_LEFTALT),
Expand Down Expand Up @@ -355,8 +355,8 @@ static void tegra_kbc_config_pins(struct tegra_kbc *kbc)
for (i = 0; i < KBC_MAX_GPIO; i++) {
u32 r_shft = 5 * (i % 6);
u32 c_shft = 4 * (i % 8);
u32 r_mask = 0x1f << r_shift;
u32 c_mask = 0x0f << c_shift;
u32 r_mask = 0x1f << r_shft;
u32 c_mask = 0x0f << c_shft;
u32 r_offs = (i / 6) * 4 + KBC_ROW_CFG0_0;
u32 c_offs = (i / 8) * 4 + KBC_COL_CFG0_0;
u32 row_cfg = readl(kbc->mmio + r_offs);
Expand Down
32 changes: 24 additions & 8 deletions drivers/input/mouse/synaptics.c
Expand Up @@ -755,23 +755,26 @@ static int synaptics_reconnect(struct psmouse *psmouse)
{
struct synaptics_data *priv = psmouse->private;
struct synaptics_data old_priv = *priv;
int retry = 0;
int error;

psmouse_reset(psmouse);
do {
psmouse_reset(psmouse);
error = synaptics_detect(psmouse, 0);
} while (error && ++retry < 3);

if (synaptics_detect(psmouse, 0))
if (error)
return -1;

if (retry > 1)
printk(KERN_DEBUG "Synaptics reconnected after %d tries\n",
retry);

if (synaptics_query_hardware(psmouse)) {
printk(KERN_ERR "Unable to query Synaptics hardware.\n");
return -1;
}

if (old_priv.identity != priv->identity ||
old_priv.model_id != priv->model_id ||
old_priv.capabilities != priv->capabilities ||
old_priv.ext_cap != priv->ext_cap)
return -1;

if (synaptics_set_absolute_mode(psmouse)) {
printk(KERN_ERR "Unable to initialize Synaptics hardware.\n");
return -1;
Expand All @@ -782,6 +785,19 @@ static int synaptics_reconnect(struct psmouse *psmouse)
return -1;
}

if (old_priv.identity != priv->identity ||
old_priv.model_id != priv->model_id ||
old_priv.capabilities != priv->capabilities ||
old_priv.ext_cap != priv->ext_cap) {
printk(KERN_ERR "Synaptics hardware appears to be different: "
"id(%ld-%ld), model(%ld-%ld), caps(%lx-%lx), ext(%lx-%lx).\n",
old_priv.identity, priv->identity,
old_priv.model_id, priv->model_id,
old_priv.capabilities, priv->capabilities,
old_priv.ext_cap, priv->ext_cap);
return -1;
}

return 0;
}

Expand Down

0 comments on commit 1ca05b7

Please sign in to comment.