20 Oct, 2017

2 commits


22 Sep, 2017

1 commit

  • Normally, when input device supporting force feedback effects is being
    destroyed, we try to "flush" currently playing effects, so that the
    physical device does not continue vibrating (or executing other effects).
    Unfortunately this does not work well for uinput as flushing of the effects
    deadlocks with the destroy action:

    - if device is being destroyed because the file descriptor is being closed,
    then there is noone to even service FF requests;

    - if device is being destroyed because userspace sent UI_DEV_DESTROY,
    while theoretically it could be possible to service FF requests,
    userspace is unlikely to do so (they'd need to make sure FF handling
    happens on a separate thread) even if kernel solves the issue with FF
    ioctls deadlocking with UI_DEV_DESTROY ioctl on udev->mutex.

    To avoid lockups like the one below, let's install a custom input device
    flush handler, and avoid trying to flush force feedback effects when we
    destroying the device, and instead rely on uinput to shut off the device
    properly.

    NMI watchdog: Watchdog detected hard LOCKUP on cpu 3
    ...
    <> [] _raw_spin_lock_irqsave+0x37/0x40
    [] complete+0x1d/0x50
    [] uinput_request_done+0x3c/0x40 [uinput]
    [] uinput_request_submit.part.7+0x47/0xb0 [uinput]
    [] uinput_dev_erase_effect+0x5b/0x76 [uinput]
    [] erase_effect+0xad/0xf0
    [] flush_effects+0x4d/0x90
    [] input_flush_device+0x40/0x60
    [] evdev_cleanup+0xac/0xc0
    [] evdev_disconnect+0x2b/0x60
    [] __input_unregister_device+0xac/0x150
    [] input_unregister_device+0x47/0x70
    [] uinput_destroy_device+0xb5/0xc0 [uinput]
    [] uinput_ioctl_handler.isra.9+0x65e/0x740 [uinput]
    [] ? do_futex+0x12b/0xad0
    [] uinput_ioctl+0x18/0x20 [uinput]
    [] do_vfs_ioctl+0x298/0x480
    [] ? security_file_ioctl+0x43/0x60
    [] SyS_ioctl+0x79/0x90
    [] entry_SYSCALL_64_fastpath+0x12/0x71

    Reported-by: Rodrigo Rivas Costa
    Reported-by: Clément VUCHENER
    Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=193741
    Signed-off-by: Dmitry Torokhov

    Dmitry Torokhov
     

14 Jul, 2016

1 commit


14 Oct, 2015

1 commit

  • Add new function input_enable_softrepeat() that allows drivers to
    initialize their own values for input_dev->rep[REP_DELAY] and
    input_dev->rep[REP_PERIOD], but also use the software autorepeat
    functionality from input.c.

    For example, a HID driver could do:

    static void xyz_input_configured(struct hid_device *hid,
    struct hid_input *hidinput)
    {
    input_enable_softrepeat(hidinput->input, 400, 100);
    }

    static struct hid_driver xyz_driver = {
    .input_configured = xyz_input_configured,
    }

    Signed-off-by: Petri Gynther
    Signed-off-by: Dmitry Torokhov

    Petri Gynther
     

10 Nov, 2012

1 commit


09 Nov, 2012

1 commit

  • There is a demand from driver's writers to use managed devices framework
    for their drivers. Unfortunately up to this moment input devices did not
    provide support for managed devices and that lead to mixing two styles
    of resource management which usually introduced more bugs, such as
    manually unregistering input device but relying in devres to free
    interrupt handler which (unless device is properly shut off) can cause
    ISR to reference already freed memory.

    This change introduces devm_input_allocate_device() that will allocate
    managed instance of input device so that driver writers who prefer
    using devm_* framework do not have to mix 2 styles.

    Reviewed-by: Henrik Rydberg
    Reviewed-by: Tejun Heo
    Signed-off-by: Dmitry Torokhov

    Dmitry Torokhov
     

13 Oct, 2012

1 commit


09 Oct, 2012

1 commit

  • Extend the amount of character devices, such as eventX, mouseX and jsX,
    from a hard limit of 32 per input handler to about 1024 shared across
    all handlers.

    To be compatible with legacy installations input handlers will start
    creating char devices with minors in their legacy range, however once
    legacy range is exhausted they will start allocating minors from the
    dynamic range 256-1024.

    Reviewed-by: David Herrmann
    Signed-off-by: Dmitry Torokhov

    Dmitry Torokhov
     

20 Sep, 2012

2 commits

  • On heavy event loads, such as a multitouch driver, the irqsoff latency
    can be as high as 250 us. By accumulating a frame worth of data
    before passing it on, the latency can be dramatically reduced. As a
    side effect, the special EV_SYN handling can be removed, since the
    frame is now atomic.

    This patch adds the events() handler callback and uses it if it
    exists. The latency is improved by 50 us even without the callback.

    Cc: Daniel Kurtz
    Tested-by: Benjamin Tissoires
    Tested-by: Ping Cheng
    Tested-by: Sedat Dilek
    Acked-by: Dmitry Torokhov
    Signed-off-by: Henrik Rydberg

    Henrik Rydberg
     
  • Move all MT-related things to a separate place. This saves some
    bytes for non-mt input devices, and prepares for new MT features.

    Reviewed-and-tested-by: Benjamin Tissoires
    Tested-by: Ping Cheng
    Acked-by: Dmitry Torokhov
    Signed-off-by: Henrik Rydberg

    Henrik Rydberg
     

08 Jul, 2012

1 commit


05 Jul, 2012

1 commit

  • The newly released HID protocol for win8 multitouch devices is capable
    of transmitting more information about each touch. In particular, it
    includes details useful for touch alignment. This patch completes the
    MT protocol with the ABS_MT_TOOL_X/Y events, and documents how to map
    win8 devices.

    Cc: Stephane Chatty
    Cc: Benjamin Tissoires
    Cc: Peter Hutterer
    Acked-by: Chase Douglas
    Signed-off-by: Henrik Rydberg

    Henrik Rydberg
     

12 Jun, 2012

1 commit


10 Mar, 2012

1 commit


09 Feb, 2012

1 commit

  • This patch adds the ability to extract MT slot data via a new ioctl,
    EVIOCGMTSLOTS. The function returns an array of slot values for the
    specified ABS_MT event type.

    Example of user space usage:

    struct { unsigned code; int values[64]; } req;
    req.code = ABS_MT_POSITION_X;
    if (ioctl(fd, EVIOCGMTSLOTS(sizeof(req)), &req) < 0)
    return -1;
    for (i = 0; i < 64; i++)
    printf("slot %d: %d\n", i, req.values[i]);

    Reviewed-by: Chase Douglas
    Signed-off-by: Henrik Rydberg

    Henrik Rydberg
     

03 Feb, 2012

1 commit

  • As noted by Arve and others, since wall time can jump backwards, it is
    difficult to use for input because one cannot determine if one event
    occurred before another or for how long a key was pressed.

    However, the timestamp field is part of the kernel ABI, and cannot be
    changed without possibly breaking existing users.

    This patch adds a new IOCTL that allows a clockid to be set in the
    evdev_client struct that will specify which time base to use for event
    timestamps (ie: CLOCK_MONOTONIC instead of CLOCK_REALTIME).

    For now we only support CLOCK_MONOTONIC and CLOCK_REALTIME, but
    in the future we could support other clockids if appropriate.

    The default remains CLOCK_REALTIME, so we don't change the ABI.

    Signed-off-by: John Stultz
    Reviewed-by: Daniel Kurtz
    Signed-off-by: Dmitry Torokhov

    John Stultz
     

29 Oct, 2011

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (549 commits)
    ALSA: hda - Fix ADC input-amp handling for Cx20549 codec
    ALSA: hda - Keep EAPD turned on for old Conexant chips
    ALSA: hda/realtek - Fix missing volume controls with ALC260
    ASoC: wm8940: Properly set codec->dapm.bias_level
    ALSA: hda - Fix pin-config for ASUS W90V
    ALSA: hda - Fix surround/CLFE headphone and speaker pins order
    ALSA: hda - Fix typo
    ALSA: Update the sound git tree URL
    ALSA: HDA: Add new revision for ALC662
    ASoC: max98095: Convert codec->hw_write to snd_soc_write
    ASoC: keep pointer to resource so it can be freed
    ASoC: sgtl5000: Fix wrong mask in some snd_soc_update_bits calls
    ASoC: wm8996: Fix wrong mask for setting WM8996_AIF_CLOCKING_2
    ASoC: da7210: Add support for line out and DAC
    ASoC: da7210: Add support for DAPM
    ALSA: hda/realtek - Fix DAC assignments of multiple speakers
    ASoC: Use SGTL5000_LINREG_VDDD_MASK instead of hardcoded mask value
    ASoC: Set sgtl5000->ldo in ldo_regulator_register
    ASoC: wm8996: Use SND_SOC_DAPM_AIF_OUT for AIF2 Capture
    ASoC: wm8994: Use SND_SOC_DAPM_AIF_OUT for AIF3 Capture
    ...

    Linus Torvalds
     

13 Oct, 2011

1 commit

  • The problem here is that max_effects can wrap on 32 bits systems.
    We'd allocate a smaller amount of data than sizeof(struct ff_device).
    The call to kcalloc() on the next line would fail but it would write
    the NULL return outside of the memory we just allocated causing data
    corruption.

    The call path is that uinput_setup_device() get ->ff_effects_max from
    the user and sets the value in the ->private_data struct. From there
    it is:
    -> uinput_ioctl_handler()
    -> uinput_create_device()
    -> input_ff_create(dev, udev->ff_effects_max);

    I've also changed ff_effects_max so it's an unsigned int instead of
    a signed int as a cleanup.

    Signed-off-by: Dan Carpenter
    Signed-off-by: Dmitry Torokhov

    Dan Carpenter
     

05 Oct, 2011

1 commit


08 Sep, 2011

1 commit


24 Aug, 2011

1 commit

  • "4-finger scroll" is a gesture supported by some applications and
    operating systems.

    "Resting thumb" is when a clickpad user rests a finger (e.g., a
    thumb), in a "click zone" (typically the bottom of the touchpad) in
    anticipation of click+move=select gestures.

    Thus, "4-finger scroll + resting thumb" is a 5-finger gesture.
    To allow userspace to detect this gesture, we send BTN_TOOL_QUINTTAP.

    Signed-off-by: Daniel Kurtz
    Acked-by: Chase Douglas
    Acked-by: Henrik Rydberg
    Signed-off-by: Dmitry Torokhov

    Daniel Kurtz
     

06 Aug, 2011

1 commit


05 Jul, 2011

1 commit

  • Put parentheses around macro argument uses. This avoids pitfalls
    for the programmer, where the argument expansion does not give the
    expected result, for example:

    ioctl (fd, EVIOCGABS (have_mt ? ABS_MT_POSITION_X : ABS_X), &abs);

    Signed-off-by: Simon Budig
    Signed-off-by: Dmitry Torokhov

    Simon Budig
     

19 Apr, 2011

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
    Input: xen-kbdfront - fix mouse getting stuck after save/restore
    Input: estimate number of events per packet
    Input: evdev - indicate buffer overrun with SYN_DROPPED
    Input: document event types and codes and their intended use
    Input: add KEY_IMAGES specifically for AL Image Browser
    Input: twl4030_keypad - fix potential NULL dereference in twl4030_kp_probe()
    Input: h3600_ts - fix error handling at connect
    Input: twl4030_keypad - avoid potential NULL-pointer dereference

    Linus Torvalds
     

13 Apr, 2011

2 commits

  • Add a new EV_SYN code, SYN_DROPPED, to inform the client when input
    events have been dropped from the evdev input buffer due to a
    buffer overrun. The client should use this event as a hint to
    reset its state or ignore all following events until the next
    packet begins.

    Signed-off-by: Jeff Brown
    [dtor@mail.ru: Implement Henrik's suggestion and drop old events in
    case of overflow.]
    Signed-off-by: Dmitry Torokhov

    Jeff Brown
     
  • Many media center remotes have buttons intended for jumping straight to
    one type of media browser or another -- commonly, images/photos/pictures,
    audio/music, television, and movies. At present, remotes with an images
    or photos or pictures button use any number of different keycodes which
    sort of maybe fit. I've seen at least KEY_MEDIA, KEY_CAMERA,
    KEY_GRAPHICSEDITOR and KEY_PRESENTATION. None of those seem quite right.
    In my mind, KEY_MEDIA should be something more like a media center
    application launcher (and I'd like to standardize on that for things
    like the windows media center button on the mce remotes). KEY_CAMERA is
    used in a lot of webcams, and typically means "take a picture now".
    KEY_GRAPHICSEDITOR implies an editor, not a browser. KEY_PRESENTATION
    might be the closest fit here, if you think "photo slide show", but it
    may well be more intended for "run application in full-screen
    presentation mode" or to launch something like magicpoint, I dunno.
    And thus, I'd like to have a KEY_IMAGES, which matches the HID Usage AL
    Image Browser, the meaning of which I think is crystal-clear. I believe
    AL Audio Browser is already covered by KEY_AUDIO, and AL Movie Browser
    by KEY_VIDEO, so I'm also adding appropriate comments next to those
    keys.

    Signed-off-by: Jarod Wilson
    Signed-off-by: Dmitry Torokhov

    Jarod Wilson
     

28 Mar, 2011

1 commit

  • These keys are supposed to be handled by any software
    using the camera (like webKam or cheese...). They can
    also be used to actually move the camera when possible.

    Signed-off-by: Corentin Chary
    Signed-off-by: Matthew Garrett

    Corentin Chary
     

01 Feb, 2011

1 commit


14 Jan, 2011

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
    Input: add SW_ROTATE_LOCK switch type
    Input: fix force feedback capability query example
    Input: wacom_w8001 - add single-touch support
    Input: add Austria Microsystem AS5011 joystick driver
    Input: remove aaed2000 keyboard driver
    Input: i8042 - introduce 'notimeout' blacklist for Dell Vostro V13
    Input: cy8ctmg110_ts - Convert to dev_pm_ops
    Input: migor_ts - convert to dev_pm_ops
    Input: mcs5000_ts - convert to dev_pm_ops
    Input: eeti_ts - convert to dev_pm_ops
    Input: ad7879 - convert I2C to dev_pm_ops

    Linus Torvalds
     

12 Jan, 2011

2 commits


08 Jan, 2011

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (58 commits)
    Input: wacom_w8001 - support pen or touch only devices
    Input: wacom_w8001 - use __set_bit to set keybits
    Input: bu21013_ts - fix misuse of logical operation in place of bitop
    Input: i8042 - add Acer Aspire 5100 to the Dritek list
    Input: wacom - add support for digitizer in Lenovo W700
    Input: psmouse - disable the synaptics extension on OLPC machines
    Input: psmouse - fix up Synaptics comment
    Input: synaptics - ignore bogus mt packet
    Input: synaptics - add multi-finger and semi-mt support
    Input: synaptics - report clickpad property
    input: mt: Document interface updates
    Input: fix double equality sign in uevent
    Input: introduce device properties
    hid: egalax: Add support for Wetab (726b)
    Input: include MT library as source for kerneldoc
    MAINTAINERS: Update input-mt entry
    hid: egalax: Add support for Samsung NB30 netbook
    hid: egalax: Document the new devices in Kconfig
    hid: egalax: Add support for Wetab
    hid: egalax: Convert to MT slots
    ...

    Fixed up trivial conflict in drivers/input/keyboard/Kconfig

    Linus Torvalds
     

07 Jan, 2011

1 commit


29 Dec, 2010

1 commit

  • The patch fixes the rc-tbs-nec table after converting
    drivers/media/video/cx88 to ir-core
    (commit ba7e90c9f878e0ac3c0614a5446fe5c62ccc33ec).

    It is also adds two missing buttons (10- and 10+) with
    its definition (KEY_10CHANNELSUP and KEY_10CHANNELSDOWN).

    [mchehab@redhat.com: move keycode numbers to 0x1b8/0x1b9 as requested by the input Maintainer]
    Signed-off-by: Mariusz Białończyk
    Signed-off-by: Mauro Carvalho Chehab

    Mariusz Białończyk
     

28 Dec, 2010

1 commit


20 Dec, 2010

1 commit

  • Today, userspace sets up an input device based on the data it emits.
    This is not always enough; a tablet and a touchscreen may emit exactly
    the same data, for instance, but the former should be set up with a
    pointer whereas the latter does not need to. Recently, a new type of
    touchpad has emerged where the buttons are under the pad, which
    changes logic without changing the emitted data. This patch introduces
    a new ioctl, EVIOCGPROP, which enables user access to a set of device
    properties useful during setup. The properties are given as a bitmap
    in the same fashion as the event types, and are also made available
    via sysfs, uevent and /proc/bus/input/devices.

    Acked-by: Ping Cheng
    Acked-by: Chase Douglas
    Acked-by: Dmitry Torokhov
    Signed-off-by: Henrik Rydberg

    Henrik Rydberg
     

17 Dec, 2010

1 commit


16 Dec, 2010

2 commits

  • Touch devices capable of hovering, i.e., fingers detected a
    distance from the surface, are not supported by the current
    input MT protocol. This patch adds ABS_MT_DISTANCE, which may
    be used to indicate the distance between the contact and the
    surface.

    Signed-off-by: Henrik Rydberg

    Henrik Rydberg
     
  • The drivers using the type B protocol all report tracking information
    the same way. The contact id is semantically equivalent to
    ABS_MT_SLOT, and the handling of ABS_MT_TRACKING_ID only complicates
    the driver. The situation can be improved upon by providing a common
    pointer emulation code, thereby removing the need for the tracking id
    in the driver. This patch moves all tracking event handling over to
    the input core, simplifying both the existing drivers and the ones
    currently in preparation.

    Acked-by: Ping Cheng
    Acked-by: Jiri Kosina
    Signed-off-by: Henrik Rydberg

    Henrik Rydberg