Skip to content

Commit 25c3e72

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: elantech - touchpad driver miss-recognising logitech mice Input: synaptics - ensure we reset the device on resume Input: usbtouchscreen - fix eGalax HID ignoring Input: ambakmi - fix timeout handling in amba_kmi_write() Input: pxa930_trkball - fix write timeout handling Input: struct device - replace bus_id with dev_name(), dev_set_name() Input: bf54x-keys - fix debounce time validation Input: spitzkbd - mark probe function as __devinit Input: omap-keypad - mark probe function as __devinit Input: corgi_ts - mark probe function as __devinit Input: corgikbd - mark probe function as __devinit Input: uvc - the button on the camera is KEY_CAMERA Input: psmouse - make MOUSE_PS2_LIFEBOOK depend on X86 Input: atkbd - make forced_release_keys[] static Input: usbtouchscreen - allow reporting calibrated data
2 parents 9c38262 + 34df5cc commit 25c3e72

File tree

17 files changed

+84
-49
lines changed

17 files changed

+84
-49
lines changed

drivers/input/keyboard/atkbd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,7 @@ static void atkbd_disconnect(struct serio *serio)
839839
*/
840840
static void atkbd_dell_laptop_keymap_fixup(struct atkbd *atkbd)
841841
{
842-
const unsigned int forced_release_keys[] = {
842+
static const unsigned int forced_release_keys[] = {
843843
0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8f, 0x93,
844844
};
845845
int i;
@@ -856,7 +856,7 @@ static void atkbd_dell_laptop_keymap_fixup(struct atkbd *atkbd)
856856
*/
857857
static void atkbd_hp_keymap_fixup(struct atkbd *atkbd)
858858
{
859-
const unsigned int forced_release_keys[] = {
859+
static const unsigned int forced_release_keys[] = {
860860
0x94,
861861
};
862862
int i;

drivers/input/keyboard/bf54x-keys.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,8 @@ static int __devinit bfin_kpad_probe(struct platform_device *pdev)
209209
goto out;
210210
}
211211

212-
if (!pdata->debounce_time || !pdata->debounce_time > MAX_MULT ||
213-
!pdata->coldrive_time || !pdata->coldrive_time > MAX_MULT) {
212+
if (!pdata->debounce_time || pdata->debounce_time > MAX_MULT ||
213+
!pdata->coldrive_time || pdata->coldrive_time > MAX_MULT) {
214214
printk(KERN_ERR DRV_NAME
215215
": Invalid Debounce/Columdrive Time from pdata\n");
216216
bfin_write_KPAD_MSEL(0xFF0); /* Default MSEL */

drivers/input/keyboard/corgikbd.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ static int corgikbd_resume(struct platform_device *dev)
288288
#define corgikbd_resume NULL
289289
#endif
290290

291-
static int __init corgikbd_probe(struct platform_device *pdev)
291+
static int __devinit corgikbd_probe(struct platform_device *pdev)
292292
{
293293
struct corgikbd *corgikbd;
294294
struct input_dev *input_dev;
@@ -368,7 +368,7 @@ static int __init corgikbd_probe(struct platform_device *pdev)
368368
return err;
369369
}
370370

371-
static int corgikbd_remove(struct platform_device *pdev)
371+
static int __devexit corgikbd_remove(struct platform_device *pdev)
372372
{
373373
int i;
374374
struct corgikbd *corgikbd = platform_get_drvdata(pdev);
@@ -388,7 +388,7 @@ static int corgikbd_remove(struct platform_device *pdev)
388388

389389
static struct platform_driver corgikbd_driver = {
390390
.probe = corgikbd_probe,
391-
.remove = corgikbd_remove,
391+
.remove = __devexit_p(corgikbd_remove),
392392
.suspend = corgikbd_suspend,
393393
.resume = corgikbd_resume,
394394
.driver = {
@@ -397,7 +397,7 @@ static struct platform_driver corgikbd_driver = {
397397
},
398398
};
399399

400-
static int __devinit corgikbd_init(void)
400+
static int __init corgikbd_init(void)
401401
{
402402
return platform_driver_register(&corgikbd_driver);
403403
}

drivers/input/keyboard/omap-keypad.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ static int omap_kp_resume(struct platform_device *dev)
279279
#define omap_kp_resume NULL
280280
#endif
281281

282-
static int __init omap_kp_probe(struct platform_device *pdev)
282+
static int __devinit omap_kp_probe(struct platform_device *pdev)
283283
{
284284
struct omap_kp *omap_kp;
285285
struct input_dev *input_dev;
@@ -422,7 +422,7 @@ static int __init omap_kp_probe(struct platform_device *pdev)
422422
return -EINVAL;
423423
}
424424

425-
static int omap_kp_remove(struct platform_device *pdev)
425+
static int __devexit omap_kp_remove(struct platform_device *pdev)
426426
{
427427
struct omap_kp *omap_kp = platform_get_drvdata(pdev);
428428

@@ -454,7 +454,7 @@ static int omap_kp_remove(struct platform_device *pdev)
454454

455455
static struct platform_driver omap_kp_driver = {
456456
.probe = omap_kp_probe,
457-
.remove = omap_kp_remove,
457+
.remove = __devexit_p(omap_kp_remove),
458458
.suspend = omap_kp_suspend,
459459
.resume = omap_kp_resume,
460460
.driver = {
@@ -463,7 +463,7 @@ static struct platform_driver omap_kp_driver = {
463463
},
464464
};
465465

466-
static int __devinit omap_kp_init(void)
466+
static int __init omap_kp_init(void)
467467
{
468468
printk(KERN_INFO "OMAP Keypad Driver\n");
469469
return platform_driver_register(&omap_kp_driver);

drivers/input/keyboard/spitzkbd.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ static int spitzkbd_resume(struct platform_device *dev)
343343
#define spitzkbd_resume NULL
344344
#endif
345345

346-
static int __init spitzkbd_probe(struct platform_device *dev)
346+
static int __devinit spitzkbd_probe(struct platform_device *dev)
347347
{
348348
struct spitzkbd *spitzkbd;
349349
struct input_dev *input_dev;
@@ -444,7 +444,7 @@ static int __init spitzkbd_probe(struct platform_device *dev)
444444
return err;
445445
}
446446

447-
static int spitzkbd_remove(struct platform_device *dev)
447+
static int __devexit spitzkbd_remove(struct platform_device *dev)
448448
{
449449
int i;
450450
struct spitzkbd *spitzkbd = platform_get_drvdata(dev);
@@ -470,7 +470,7 @@ static int spitzkbd_remove(struct platform_device *dev)
470470

471471
static struct platform_driver spitzkbd_driver = {
472472
.probe = spitzkbd_probe,
473-
.remove = spitzkbd_remove,
473+
.remove = __devexit_p(spitzkbd_remove),
474474
.suspend = spitzkbd_suspend,
475475
.resume = spitzkbd_resume,
476476
.driver = {
@@ -479,7 +479,7 @@ static struct platform_driver spitzkbd_driver = {
479479
},
480480
};
481481

482-
static int __devinit spitzkbd_init(void)
482+
static int __init spitzkbd_init(void)
483483
{
484484
return platform_driver_register(&spitzkbd_driver);
485485
}

drivers/input/mouse/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ config MOUSE_PS2_SYNAPTICS
7070
config MOUSE_PS2_LIFEBOOK
7171
bool "Fujitsu Lifebook PS/2 mouse protocol extension" if EMBEDDED
7272
default y
73-
depends on MOUSE_PS2
73+
depends on MOUSE_PS2 && X86
7474
help
7575
Say Y here if you have a Fujitsu B-series Lifebook PS/2
7676
TouchScreen connected to your system.

drivers/input/mouse/elantech.c

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ int elantech_detect(struct psmouse *psmouse, int set_properties)
542542
ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) ||
543543
ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) ||
544544
ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO)) {
545-
pr_err("elantech.c: sending Elantech magic knock failed.\n");
545+
pr_debug("elantech.c: sending Elantech magic knock failed.\n");
546546
return -1;
547547
}
548548

@@ -551,8 +551,27 @@ int elantech_detect(struct psmouse *psmouse, int set_properties)
551551
* set of magic numbers
552552
*/
553553
if (param[0] != 0x3c || param[1] != 0x03 || param[2] != 0xc8) {
554-
pr_info("elantech.c: unexpected magic knock result 0x%02x, 0x%02x, 0x%02x.\n",
555-
param[0], param[1], param[2]);
554+
pr_debug("elantech.c: "
555+
"unexpected magic knock result 0x%02x, 0x%02x, 0x%02x.\n",
556+
param[0], param[1], param[2]);
557+
return -1;
558+
}
559+
560+
/*
561+
* Query touchpad's firmware version and see if it reports known
562+
* value to avoid mis-detection. Logitech mice are known to respond
563+
* to Elantech magic knock and there might be more.
564+
*/
565+
if (synaptics_send_cmd(psmouse, ETP_FW_VERSION_QUERY, param)) {
566+
pr_debug("elantech.c: failed to query firmware version.\n");
567+
return -1;
568+
}
569+
570+
pr_debug("elantech.c: Elantech version query result 0x%02x, 0x%02x, 0x%02x.\n",
571+
param[0], param[1], param[2]);
572+
573+
if (param[0] == 0 || param[1] != 0) {
574+
pr_debug("elantech.c: Probably not a real Elantech touchpad. Aborting.\n");
556575
return -1;
557576
}
558577

@@ -600,8 +619,7 @@ int elantech_init(struct psmouse *psmouse)
600619
int i, error;
601620
unsigned char param[3];
602621

603-
etd = kzalloc(sizeof(struct elantech_data), GFP_KERNEL);
604-
psmouse->private = etd;
622+
psmouse->private = etd = kzalloc(sizeof(struct elantech_data), GFP_KERNEL);
605623
if (!etd)
606624
return -1;
607625

@@ -610,14 +628,12 @@ int elantech_init(struct psmouse *psmouse)
610628
etd->parity[i] = etd->parity[i & (i - 1)] ^ 1;
611629

612630
/*
613-
* Find out what version hardware this is
631+
* Do the version query again so we can store the result
614632
*/
615633
if (synaptics_send_cmd(psmouse, ETP_FW_VERSION_QUERY, param)) {
616634
pr_err("elantech.c: failed to query firmware version.\n");
617635
goto init_fail;
618636
}
619-
pr_info("elantech.c: Elantech version query result 0x%02x, 0x%02x, 0x%02x.\n",
620-
param[0], param[1], param[2]);
621637
etd->fw_version_maj = param[0];
622638
etd->fw_version_min = param[2];
623639

drivers/input/mouse/pxa930_trkball.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ static int write_tbcr(struct pxa930_trkball *trkball, int v)
8383

8484
__raw_writel(v, trkball->mmio_base + TBCR);
8585

86-
while (i--) {
86+
while (--i) {
8787
if (__raw_readl(trkball->mmio_base + TBCR) == v)
8888
break;
8989
msleep(1);

drivers/input/mouse/synaptics.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,6 @@ static int synaptics_identify(struct psmouse *psmouse)
182182

183183
static int synaptics_query_hardware(struct psmouse *psmouse)
184184
{
185-
int retries = 0;
186-
187-
while ((retries++ < 3) && psmouse_reset(psmouse))
188-
/* empty */;
189-
190185
if (synaptics_identify(psmouse))
191186
return -1;
192187
if (synaptics_model_id(psmouse))
@@ -582,6 +577,8 @@ static int synaptics_reconnect(struct psmouse *psmouse)
582577
struct synaptics_data *priv = psmouse->private;
583578
struct synaptics_data old_priv = *priv;
584579

580+
psmouse_reset(psmouse);
581+
585582
if (synaptics_detect(psmouse, 0))
586583
return -1;
587584

@@ -640,6 +637,8 @@ int synaptics_init(struct psmouse *psmouse)
640637
if (!priv)
641638
return -1;
642639

640+
psmouse_reset(psmouse);
641+
643642
if (synaptics_query_hardware(psmouse)) {
644643
printk(KERN_ERR "Unable to query Synaptics hardware.\n");
645644
goto init_fail;

drivers/input/serio/ambakmi.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ static int amba_kmi_write(struct serio *io, unsigned char val)
5757
struct amba_kmi_port *kmi = io->port_data;
5858
unsigned int timeleft = 10000; /* timeout in 100ms */
5959

60-
while ((readb(KMISTAT) & KMISTAT_TXEMPTY) == 0 && timeleft--)
60+
while ((readb(KMISTAT) & KMISTAT_TXEMPTY) == 0 && --timeleft)
6161
udelay(10);
6262

6363
if (timeleft)
@@ -129,8 +129,8 @@ static int amba_kmi_probe(struct amba_device *dev, void *id)
129129
io->write = amba_kmi_write;
130130
io->open = amba_kmi_open;
131131
io->close = amba_kmi_close;
132-
strlcpy(io->name, dev->dev.bus_id, sizeof(io->name));
133-
strlcpy(io->phys, dev->dev.bus_id, sizeof(io->phys));
132+
strlcpy(io->name, dev_name(&dev->dev), sizeof(io->name));
133+
strlcpy(io->phys, dev_name(&dev->dev), sizeof(io->phys));
134134
io->port_data = kmi;
135135
io->dev.parent = &dev->dev;
136136

0 commit comments

Comments
 (0)