History

Input: add INPUT_PROP_POINTING_STICK property

It is useful for userspace to know that there not dealing with a regular mouse but rather with a pointing stick (e.g. a trackpoint) so that userspace can e.g. automatically enable middle button scrollwheel emulation. It is impossible to tell the difference from the evdev info without resorting to putting a list of device / driver names in userspace, this is undesirable. Add a property which allows userspace to see if a device is a pointing stick, and set it on all the pointing stick drivers.

Hans de Goede committed 12 years ago

Commit 76113921 parent 271329b5 files · +10 −0Browse files

Unified · Split

5 files
  1. drivers/input/mouse/alps.c +3 −0
  2. drivers/input/mouse/elantech.c +3 −0
  3. drivers/input/mouse/synaptics_usb.c +1 −0
  4. drivers/input/mouse/trackpoint.c +2 −0
  5. include/uapi/linux/input.h +1 −0
drivers/input/mouse/alps.c+3−0
@@ -2373,6 +2373,9 @@ int alps_init(struct psmouse *psmouse) · 2372 unmodified lines
2373 dev2->keybit[BIT_WORD(BTN_LEFT)] =2373 dev2->keybit[BIT_WORD(BTN_LEFT)] =
2374 BIT_MASK(BTN_LEFT) | BIT_MASK(BTN_MIDDLE) | BIT_MASK(BTN_RIGHT);2374 BIT_MASK(BTN_LEFT) | BIT_MASK(BTN_MIDDLE) | BIT_MASK(BTN_RIGHT);
2375 2375
2376 if (priv->flags & ALPS_DUALPOINT)
2377 __set_bit(INPUT_PROP_POINTING_STICK, dev2->propbit);
2378
2376 if (input_register_device(priv->dev2))2379 if (input_register_device(priv->dev2))
2377 goto init_fail;2380 goto init_fail;
2378 2381
drivers/input/mouse/elantech.c+3−0
@@ -1614,6 +1614,9 @@ int elantech_init(struct psmouse *psmouse) · 1613 unmodified lines
1614 tp_dev->keybit[BIT_WORD(BTN_LEFT)] =1614 tp_dev->keybit[BIT_WORD(BTN_LEFT)] =
1615 BIT_MASK(BTN_LEFT) | BIT_MASK(BTN_MIDDLE) |1615 BIT_MASK(BTN_LEFT) | BIT_MASK(BTN_MIDDLE) |
1616 BIT_MASK(BTN_RIGHT);1616 BIT_MASK(BTN_RIGHT);
1617
1618 __set_bit(INPUT_PROP_POINTING_STICK, tp_dev->propbit);
1619
1617 error = input_register_device(etd->tp_dev);1620 error = input_register_device(etd->tp_dev);
1618 if (error < 0)1621 if (error < 0)
1619 goto init_fail_tp_reg;1622 goto init_fail_tp_reg;
drivers/input/mouse/synaptics_usb.c+1−0
@@ -387,6 +387,7 @@ static int synusb_probe(struct usb_interface *intf, · 386 unmodified lines
387 __set_bit(EV_REL, input_dev->evbit);387 __set_bit(EV_REL, input_dev->evbit);
388 __set_bit(REL_X, input_dev->relbit);388 __set_bit(REL_X, input_dev->relbit);
389 __set_bit(REL_Y, input_dev->relbit);389 __set_bit(REL_Y, input_dev->relbit);
390 __set_bit(INPUT_PROP_POINTING_STICK, input_dev->propbit);
390 input_set_abs_params(input_dev, ABS_PRESSURE, 0, 127, 0, 0);391 input_set_abs_params(input_dev, ABS_PRESSURE, 0, 127, 0, 0);
391 } else {392 } else {
392 input_set_abs_params(input_dev, ABS_X,393 input_set_abs_params(input_dev, ABS_X,
drivers/input/mouse/trackpoint.c+2−0
@@ -393,6 +393,8 @@ int trackpoint_detect(struct psmouse *psmouse, bool set_properties) · 392 unmodified lines
393 if ((button_info & 0x0f) >= 3)393 if ((button_info & 0x0f) >= 3)
394 __set_bit(BTN_MIDDLE, psmouse->dev->keybit);394 __set_bit(BTN_MIDDLE, psmouse->dev->keybit);
395 395
396 __set_bit(INPUT_PROP_POINTING_STICK, psmouse->dev->propbit);
397
396 trackpoint_defaults(psmouse->private);398 trackpoint_defaults(psmouse->private);
397 399
398 error = trackpoint_power_on_reset(&psmouse->ps2dev);400 error = trackpoint_power_on_reset(&psmouse->ps2dev);
include/uapi/linux/input.h+1−0
@@ -165,6 +165,7 @@ struct input_keymap_entry { · 164 unmodified lines
165#define INPUT_PROP_BUTTONPAD 0x02 /* has button(s) under pad */165#define INPUT_PROP_BUTTONPAD 0x02 /* has button(s) under pad */
166#define INPUT_PROP_SEMI_MT 0x03 /* touch rectangle only */166#define INPUT_PROP_SEMI_MT 0x03 /* touch rectangle only */
167#define INPUT_PROP_TOPBUTTONPAD 0x04 /* softbuttons at top of pad */167#define INPUT_PROP_TOPBUTTONPAD 0x04 /* softbuttons at top of pad */
168#define INPUT_PROP_POINTING_STICK 0x05 /* is a pointing stick */
168 169
169#define INPUT_PROP_MAX 0x1f170#define INPUT_PROP_MAX 0x1f
170#define INPUT_PROP_CNT (INPUT_PROP_MAX + 1)171#define INPUT_PROP_CNT (INPUT_PROP_MAX + 1)