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: 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
  • Loading branch information
Linus Torvalds committed Mar 2, 2009
2 parents 36b3110 + 9ab7b25 commit 6b3bf20
Show file tree
Hide file tree
Showing 17 changed files with 84 additions and 49 deletions.
4 changes: 2 additions & 2 deletions drivers/input/keyboard/atkbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ static void atkbd_disconnect(struct serio *serio)
*/
static void atkbd_dell_laptop_keymap_fixup(struct atkbd *atkbd)
{
const unsigned int forced_release_keys[] = {
static const unsigned int forced_release_keys[] = {
0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8f, 0x93,
};
int i;
Expand All @@ -856,7 +856,7 @@ static void atkbd_dell_laptop_keymap_fixup(struct atkbd *atkbd)
*/
static void atkbd_hp_keymap_fixup(struct atkbd *atkbd)
{
const unsigned int forced_release_keys[] = {
static const unsigned int forced_release_keys[] = {
0x94,
};
int i;
Expand Down
4 changes: 2 additions & 2 deletions drivers/input/keyboard/bf54x-keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ static int __devinit bfin_kpad_probe(struct platform_device *pdev)
goto out;
}

if (!pdata->debounce_time || !pdata->debounce_time > MAX_MULT ||
!pdata->coldrive_time || !pdata->coldrive_time > MAX_MULT) {
if (!pdata->debounce_time || pdata->debounce_time > MAX_MULT ||
!pdata->coldrive_time || pdata->coldrive_time > MAX_MULT) {
printk(KERN_ERR DRV_NAME
": Invalid Debounce/Columdrive Time from pdata\n");
bfin_write_KPAD_MSEL(0xFF0); /* Default MSEL */
Expand Down
8 changes: 4 additions & 4 deletions drivers/input/keyboard/corgikbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ static int corgikbd_resume(struct platform_device *dev)
#define corgikbd_resume NULL
#endif

static int __init corgikbd_probe(struct platform_device *pdev)
static int __devinit corgikbd_probe(struct platform_device *pdev)
{
struct corgikbd *corgikbd;
struct input_dev *input_dev;
Expand Down Expand Up @@ -368,7 +368,7 @@ static int __init corgikbd_probe(struct platform_device *pdev)
return err;
}

static int corgikbd_remove(struct platform_device *pdev)
static int __devexit corgikbd_remove(struct platform_device *pdev)
{
int i;
struct corgikbd *corgikbd = platform_get_drvdata(pdev);
Expand All @@ -388,7 +388,7 @@ static int corgikbd_remove(struct platform_device *pdev)

static struct platform_driver corgikbd_driver = {
.probe = corgikbd_probe,
.remove = corgikbd_remove,
.remove = __devexit_p(corgikbd_remove),
.suspend = corgikbd_suspend,
.resume = corgikbd_resume,
.driver = {
Expand All @@ -397,7 +397,7 @@ static struct platform_driver corgikbd_driver = {
},
};

static int __devinit corgikbd_init(void)
static int __init corgikbd_init(void)
{
return platform_driver_register(&corgikbd_driver);
}
Expand Down
8 changes: 4 additions & 4 deletions drivers/input/keyboard/omap-keypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ static int omap_kp_resume(struct platform_device *dev)
#define omap_kp_resume NULL
#endif

static int __init omap_kp_probe(struct platform_device *pdev)
static int __devinit omap_kp_probe(struct platform_device *pdev)
{
struct omap_kp *omap_kp;
struct input_dev *input_dev;
Expand Down Expand Up @@ -422,7 +422,7 @@ static int __init omap_kp_probe(struct platform_device *pdev)
return -EINVAL;
}

static int omap_kp_remove(struct platform_device *pdev)
static int __devexit omap_kp_remove(struct platform_device *pdev)
{
struct omap_kp *omap_kp = platform_get_drvdata(pdev);

Expand Down Expand Up @@ -454,7 +454,7 @@ static int omap_kp_remove(struct platform_device *pdev)

static struct platform_driver omap_kp_driver = {
.probe = omap_kp_probe,
.remove = omap_kp_remove,
.remove = __devexit_p(omap_kp_remove),
.suspend = omap_kp_suspend,
.resume = omap_kp_resume,
.driver = {
Expand All @@ -463,7 +463,7 @@ static struct platform_driver omap_kp_driver = {
},
};

static int __devinit omap_kp_init(void)
static int __init omap_kp_init(void)
{
printk(KERN_INFO "OMAP Keypad Driver\n");
return platform_driver_register(&omap_kp_driver);
Expand Down
8 changes: 4 additions & 4 deletions drivers/input/keyboard/spitzkbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ static int spitzkbd_resume(struct platform_device *dev)
#define spitzkbd_resume NULL
#endif

static int __init spitzkbd_probe(struct platform_device *dev)
static int __devinit spitzkbd_probe(struct platform_device *dev)
{
struct spitzkbd *spitzkbd;
struct input_dev *input_dev;
Expand Down Expand Up @@ -444,7 +444,7 @@ static int __init spitzkbd_probe(struct platform_device *dev)
return err;
}

static int spitzkbd_remove(struct platform_device *dev)
static int __devexit spitzkbd_remove(struct platform_device *dev)
{
int i;
struct spitzkbd *spitzkbd = platform_get_drvdata(dev);
Expand All @@ -470,7 +470,7 @@ static int spitzkbd_remove(struct platform_device *dev)

static struct platform_driver spitzkbd_driver = {
.probe = spitzkbd_probe,
.remove = spitzkbd_remove,
.remove = __devexit_p(spitzkbd_remove),
.suspend = spitzkbd_suspend,
.resume = spitzkbd_resume,
.driver = {
Expand All @@ -479,7 +479,7 @@ static struct platform_driver spitzkbd_driver = {
},
};

static int __devinit spitzkbd_init(void)
static int __init spitzkbd_init(void)
{
return platform_driver_register(&spitzkbd_driver);
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/input/mouse/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ config MOUSE_PS2_SYNAPTICS
config MOUSE_PS2_LIFEBOOK
bool "Fujitsu Lifebook PS/2 mouse protocol extension" if EMBEDDED
default y
depends on MOUSE_PS2
depends on MOUSE_PS2 && X86
help
Say Y here if you have a Fujitsu B-series Lifebook PS/2
TouchScreen connected to your system.
Expand Down
32 changes: 24 additions & 8 deletions drivers/input/mouse/elantech.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ int elantech_detect(struct psmouse *psmouse, int set_properties)
ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) ||
ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) ||
ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO)) {
pr_err("elantech.c: sending Elantech magic knock failed.\n");
pr_debug("elantech.c: sending Elantech magic knock failed.\n");
return -1;
}

Expand All @@ -551,8 +551,27 @@ int elantech_detect(struct psmouse *psmouse, int set_properties)
* set of magic numbers
*/
if (param[0] != 0x3c || param[1] != 0x03 || param[2] != 0xc8) {
pr_info("elantech.c: unexpected magic knock result 0x%02x, 0x%02x, 0x%02x.\n",
param[0], param[1], param[2]);
pr_debug("elantech.c: "
"unexpected magic knock result 0x%02x, 0x%02x, 0x%02x.\n",
param[0], param[1], param[2]);
return -1;
}

/*
* Query touchpad's firmware version and see if it reports known
* value to avoid mis-detection. Logitech mice are known to respond
* to Elantech magic knock and there might be more.
*/
if (synaptics_send_cmd(psmouse, ETP_FW_VERSION_QUERY, param)) {
pr_debug("elantech.c: failed to query firmware version.\n");
return -1;
}

pr_debug("elantech.c: Elantech version query result 0x%02x, 0x%02x, 0x%02x.\n",
param[0], param[1], param[2]);

if (param[0] == 0 || param[1] != 0) {
pr_debug("elantech.c: Probably not a real Elantech touchpad. Aborting.\n");
return -1;
}

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

etd = kzalloc(sizeof(struct elantech_data), GFP_KERNEL);
psmouse->private = etd;
psmouse->private = etd = kzalloc(sizeof(struct elantech_data), GFP_KERNEL);
if (!etd)
return -1;

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

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

Expand Down
2 changes: 1 addition & 1 deletion drivers/input/mouse/pxa930_trkball.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ static int write_tbcr(struct pxa930_trkball *trkball, int v)

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

while (i--) {
while (--i) {
if (__raw_readl(trkball->mmio_base + TBCR) == v)
break;
msleep(1);
Expand Down
9 changes: 4 additions & 5 deletions drivers/input/mouse/synaptics.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,6 @@ static int synaptics_identify(struct psmouse *psmouse)

static int synaptics_query_hardware(struct psmouse *psmouse)
{
int retries = 0;

while ((retries++ < 3) && psmouse_reset(psmouse))
/* empty */;

if (synaptics_identify(psmouse))
return -1;
if (synaptics_model_id(psmouse))
Expand Down Expand Up @@ -582,6 +577,8 @@ static int synaptics_reconnect(struct psmouse *psmouse)
struct synaptics_data *priv = psmouse->private;
struct synaptics_data old_priv = *priv;

psmouse_reset(psmouse);

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

Expand Down Expand Up @@ -640,6 +637,8 @@ int synaptics_init(struct psmouse *psmouse)
if (!priv)
return -1;

psmouse_reset(psmouse);

if (synaptics_query_hardware(psmouse)) {
printk(KERN_ERR "Unable to query Synaptics hardware.\n");
goto init_fail;
Expand Down
6 changes: 3 additions & 3 deletions drivers/input/serio/ambakmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static int amba_kmi_write(struct serio *io, unsigned char val)
struct amba_kmi_port *kmi = io->port_data;
unsigned int timeleft = 10000; /* timeout in 100ms */

while ((readb(KMISTAT) & KMISTAT_TXEMPTY) == 0 && timeleft--)
while ((readb(KMISTAT) & KMISTAT_TXEMPTY) == 0 && --timeleft)
udelay(10);

if (timeleft)
Expand Down Expand Up @@ -129,8 +129,8 @@ static int amba_kmi_probe(struct amba_device *dev, void *id)
io->write = amba_kmi_write;
io->open = amba_kmi_open;
io->close = amba_kmi_close;
strlcpy(io->name, dev->dev.bus_id, sizeof(io->name));
strlcpy(io->phys, dev->dev.bus_id, sizeof(io->phys));
strlcpy(io->name, dev_name(&dev->dev), sizeof(io->name));
strlcpy(io->phys, dev_name(&dev->dev), sizeof(io->phys));
io->port_data = kmi;
io->dev.parent = &dev->dev;

Expand Down
2 changes: 1 addition & 1 deletion drivers/input/serio/gscps2.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ static int __init gscps2_probe(struct parisc_device *dev)

snprintf(serio->name, sizeof(serio->name), "GSC PS/2 %s",
(ps2port->id == GSC_ID_KEYBOARD) ? "keyboard" : "mouse");
strlcpy(serio->phys, dev->dev.bus_id, sizeof(serio->phys));
strlcpy(serio->phys, dev_name(&dev->dev), sizeof(serio->phys));
serio->id.type = SERIO_8042;
serio->write = gscps2_write;
serio->open = gscps2_open;
Expand Down
4 changes: 2 additions & 2 deletions drivers/input/serio/sa1111ps2.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@ static int __devinit ps2_probe(struct sa1111_dev *dev)
serio->write = ps2_write;
serio->open = ps2_open;
serio->close = ps2_close;
strlcpy(serio->name, dev->dev.bus_id, sizeof(serio->name));
strlcpy(serio->phys, dev->dev.bus_id, sizeof(serio->phys));
strlcpy(serio->name, dev_name(&dev->dev), sizeof(serio->name));
strlcpy(serio->phys, dev_name(&dev->dev), sizeof(serio->phys));
serio->port_data = ps2if;
serio->dev.parent = &dev->dev;
ps2if->io = serio;
Expand Down
2 changes: 1 addition & 1 deletion drivers/input/touchscreen/atmel_tsadcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ static int __devinit atmel_tsadcc_probe(struct platform_device *pdev)
ts_dev->bufferedmeasure = 0;

snprintf(ts_dev->phys, sizeof(ts_dev->phys),
"%s/input0", pdev->dev.bus_id);
"%s/input0", dev_name(&pdev->dev));

input_dev->name = "atmel touch screen controller";
input_dev->phys = ts_dev->phys;
Expand Down
9 changes: 5 additions & 4 deletions drivers/input/touchscreen/corgi_ts.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ static int corgits_resume(struct platform_device *dev)
#define corgits_resume NULL
#endif

static int __init corgits_probe(struct platform_device *pdev)
static int __devinit corgits_probe(struct platform_device *pdev)
{
struct corgi_ts *corgi_ts;
struct input_dev *input_dev;
Expand Down Expand Up @@ -343,7 +343,7 @@ static int __init corgits_probe(struct platform_device *pdev)
return err;
}

static int corgits_remove(struct platform_device *pdev)
static int __devexit corgits_remove(struct platform_device *pdev)
{
struct corgi_ts *corgi_ts = platform_get_drvdata(pdev);

Expand All @@ -352,12 +352,13 @@ static int corgits_remove(struct platform_device *pdev)
corgi_ts->machinfo->put_hsync();
input_unregister_device(corgi_ts->input);
kfree(corgi_ts);

return 0;
}

static struct platform_driver corgits_driver = {
.probe = corgits_probe,
.remove = corgits_remove,
.remove = __devexit_p(corgits_remove),
.suspend = corgits_suspend,
.resume = corgits_resume,
.driver = {
Expand All @@ -366,7 +367,7 @@ static struct platform_driver corgits_driver = {
},
};

static int __devinit corgits_init(void)
static int __init corgits_init(void)
{
return platform_driver_register(&corgits_driver);
}
Expand Down
3 changes: 2 additions & 1 deletion drivers/input/touchscreen/tsc2007.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,8 @@ static int tsc2007_probe(struct i2c_client *client,

pdata->init_platform_hw();

snprintf(ts->phys, sizeof(ts->phys), "%s/input0", client->dev.bus_id);
snprintf(ts->phys, sizeof(ts->phys),
"%s/input0", dev_name(&client->dev));

input_dev->name = "TSC2007 Touchscreen";
input_dev->phys = ts->phys;
Expand Down
20 changes: 18 additions & 2 deletions drivers/input/touchscreen/usbtouchscreen.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ static int swap_xy;
module_param(swap_xy, bool, 0644);
MODULE_PARM_DESC(swap_xy, "If set X and Y axes are swapped.");

static int hwcalib_xy;
module_param(hwcalib_xy, bool, 0644);
MODULE_PARM_DESC(hwcalib_xy, "If set hw-calibrated X/Y are used if available");

/* device specifc data/functions */
struct usbtouch_usb;
struct usbtouch_device_info {
Expand Down Expand Up @@ -118,6 +122,7 @@ enum {

#define USB_DEVICE_HID_CLASS(vend, prod) \
.match_flags = USB_DEVICE_ID_MATCH_INT_CLASS \
| USB_DEVICE_ID_MATCH_INT_PROTOCOL \
| USB_DEVICE_ID_MATCH_DEVICE, \
.idVendor = (vend), \
.idProduct = (prod), \
Expand Down Expand Up @@ -260,8 +265,13 @@ static int panjit_read_data(struct usbtouch_usb *dev, unsigned char *pkt)

static int mtouch_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
{
dev->x = (pkt[8] << 8) | pkt[7];
dev->y = (pkt[10] << 8) | pkt[9];
if (hwcalib_xy) {
dev->x = (pkt[4] << 8) | pkt[3];
dev->y = 0xffff - ((pkt[6] << 8) | pkt[5]);
} else {
dev->x = (pkt[8] << 8) | pkt[7];
dev->y = (pkt[10] << 8) | pkt[9];
}
dev->touch = (pkt[2] & 0x40) ? 1 : 0;

return 1;
Expand Down Expand Up @@ -294,6 +304,12 @@ static int mtouch_init(struct usbtouch_usb *usbtouch)
return ret;
}

/* Default min/max xy are the raw values, override if using hw-calib */
if (hwcalib_xy) {
input_set_abs_params(usbtouch->input, ABS_X, 0, 0xffff, 0, 0);
input_set_abs_params(usbtouch->input, ABS_Y, 0, 0xffff, 0, 0);
}

return 0;
}
#endif
Expand Down
Loading

0 comments on commit 6b3bf20

Please sign in to comment.