Commit Graph

3121 Commits

Author SHA1 Message Date
Linus Torvalds e8403b493f Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
Pull HID updates from Jiri Kosina:

 - 3rd generation Wacom Intuos BT device support from Aaron Armstrong
   Skomra

 - support for NSG-MR5U and NSG-MR7U devices from Todd Kelner

 - multitouch Razer Blade Stealth support from Benjamin Tissoires

 - Elantech touchpad support from Alexandrov Stansilav

 - a few other scattered-around fixes and cleanups to drivers and
   generic code

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (31 commits)
  HID: google: Enable PM Full On mode when adjusting backlight
  HID: google: add google hammer HID driver
  HID: core: reset the quirks before calling probe again
  HID: multitouch: do not set HID_QUIRK_NO_INIT_REPORTS
  HID: core: remove the need for HID_QUIRK_NO_EMPTY_INPUT
  HID: use BIT() macro for quirks too
  HID: use BIT macro instead of plain integers for flags
  HID: multitouch: remove dead zones of Razer Blade Stealth
  HID: multitouch: export a quirk for the button handling of touchpads
  HID: usbhid: extend the polling interval configuration to keyboards
  HID: ntrig: document sysfs interface
  HID: wacom: wacom_wac_collection() is local to wacom_wac.c
  HID: wacom: generic: add the "Report Valid" usage
  HID: wacom: generic: Support multiple tools per report
  HID: wacom: Add support for 3rd generation Intuos BT
  HID: core: rewrite the hid-generic automatic unbind
  HID: sony: Add touchpad support for NSG-MR5U and NSG-MR7U remotes
  HID: hid-multitouch: Use true and false for boolean values
  HID: hid-ntrig: use true and false for boolean values
  HID: logitech-hidpp: document sysfs interface
  ...
2018-04-05 11:53:34 -07:00
Jiri Kosina 9931753b6c Merge branch 'for-4.17/wacom' into for-linus
Pull support for 3rd generation Intuos BT device
2018-04-05 13:28:59 +02:00
Jiri Kosina e2d39e0f95 Merge branch 'for-4.17/upstream' into for-linus
Pull a few small generic code cleanups.
2018-04-05 13:28:46 +02:00
Jiri Kosina 108ff0e801 Merge branch 'for-4.17/sony' into for-linus
Pull support for NSG-MR5U and NSG-MR7U devices.
2018-04-05 13:28:34 +02:00
Jiri Kosina af73686e7b Merge branch 'for-4.17/multitouch' into for-linus
Pull Razer Blade Stealth support improvement and a few generic cleanups
2018-04-05 13:27:22 +02:00
Jiri Kosina f73fee743b Merge branch 'for-4.17/hid-i2c' into for-linus
Small hid-i2c acpi cleanup.
2018-04-05 13:18:26 +02:00
Jiri Kosina 7a8c1c4e71 Merge branch 'for-4.17/hid-elan' into for-linus
Pull new hid-elan driver, currently providing support for touchpad
found in certain HP Pavilion x2 laptops.
2018-04-05 13:17:23 +02:00
Jiri Kosina d463fd44c4 Merge branch 'for-4.17/google-hammer' into for-linus
Support for Google Hammer device.
2018-04-05 13:16:52 +02:00
Jiri Kosina a9ef00aec7 Merge branch 'for-4.17/elecom' into for-linus
Support for new elecom device.
2018-04-05 13:16:37 +02:00
Haridhar Kalvala 7d3d88401f HID: google: Enable PM Full On mode when adjusting backlight
hammer LED backlight brightness is not getting set when USB
device is in suspend state.

This patch fixes the issue by requesting USB HID device to be
in FULLON mode, so that sending hardware output report and
hardware raw request won't fail to set brightness, and set
device back to NORMAL mode once this call returns.

Signed-off-by: Haridhar Kalvala <haridhar.kalvala@intel.com>
Reviewed-by: Dmitry Torokhov <dtor@chromium.org>
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-03-28 16:12:58 +02:00
Wei-Ning Huang bc774b8c11 HID: google: add google hammer HID driver
Add Google hammer HID driver. This driver allow us to control hammer
keyboard backlight and support future features.

Signed-off-by: Wei-Ning Huang <wnhuang@google.com>
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-03-27 14:46:54 +02:00
Benjamin Tissoires 2904e68ff2 HID: core: reset the quirks before calling probe again
Given that now the quirk handling is done in hid-quirk.c, we can actually
reset the quirks before calling .probe(), so that the drivers do not need
to keep track of initial quirks.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-03-23 15:46:09 +01:00
Benjamin Tissoires adaabbf48f HID: multitouch: do not set HID_QUIRK_NO_INIT_REPORTS
It is set by default now, so there is no point setting it in the driver

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-03-23 15:46:09 +01:00
Benjamin Tissoires 39335d1cbb HID: core: remove the need for HID_QUIRK_NO_EMPTY_INPUT
There is no real point of registering an empty input node.
This should be default, but given some drivers need the blank input
node to set it up during input_configured, we need to postpone
the check for hidinput_has_been_populated().

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-03-23 15:44:57 +01:00
Benjamin Tissoires 843e475f94 HID: multitouch: remove dead zones of Razer Blade Stealth
The Razer Blade Stealth detects palms too aggressively and this creates
a dead zone around the touchpad. Users like being able to use their
entire touchpad, so we should probably not filter out the "palm" events
from the device and report them as regular touches, leaving the palm
detection up to the upper stack

Link: https://bugs.freedesktop.org/show_bug.cgi?id=105409

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-03-23 15:44:57 +01:00
Benjamin Tissoires d9c57a7090 HID: multitouch: export a quirk for the button handling of touchpads
Instead of using the class name, we better have a specific quirk for it
so other classes can make use of it.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-03-23 15:44:57 +01:00
Filip Alac 2ddc8e2d2b HID: usbhid: extend the polling interval configuration to keyboards
For mouse and joystick devices user can change the polling interval
via usbhid.mousepoll and usbhid.jspoll.
Implement the same thing for keyboards, so user can
reduce(or increase) input latency this way.

This has been tested with a Cooler Master Devastator with
kbpoll=32, resulting in delay between events of 32 ms(values were taken
from evtest).

Signed-off-by: Filip Alac <filipalac@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-03-23 14:48:37 +01:00
Jiri Kosina 7ba8fc0904 HID: wacom: wacom_wac_collection() is local to wacom_wac.c
... and therefore should be static.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-03-07 15:34:51 +01:00
Aaron Armstrong Skomra b1f466a90c HID: wacom: generic: add the "Report Valid" usage
Wacom Bluetooth reports contain multiple pen frames per report.
Each frame contains a flag indicating if the frame is valid.
Future Wacom devices with this type of report may contain HID
descriptors, add support for this usage to the generic codepath
of the Wacom driver.

Signed-off-by: Aaron Armstrong Skomra <skomra@gmail.com>
Reviewed-by: Ping Cheng <ping.cheng@wacom.com>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-03-07 15:21:44 +01:00
Aaron Armstrong Skomra f8b6a74719 HID: wacom: generic: Support multiple tools per report
Some Wacom devices contain contain Pen and Pad usages in
the same report. Future devices of this type may utilize
HID Descriptors.

The generic code path of the Wacom driver previously
assumed pen, touch, and pad reports were delivered in
separate reports. This patch adds support for processing
each collection of a report separately, in order to support
reports with multiple tools.

Signed-off-by: Aaron Armstrong Skomra <skomra@gmail.com>
Reviewed-by: Ping Cheng <ping.cheng@wacom.com>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-03-07 15:21:44 +01:00
Aaron Armstrong Skomra 87046b6c99 HID: wacom: Add support for 3rd generation Intuos BT
Use the code path that predates generic device support.

Signed-off-by: Aaron Armstrong Skomra <skomra@gmail.com>
Reviewed-by: Ping Cheng <ping.cheng@wacom.com>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-03-07 15:21:44 +01:00
Benjamin Tissoires c17a7476e4 HID: core: rewrite the hid-generic automatic unbind
We actually can have the unbind/rebind logic in hid-core.c, leaving
only the match function in hid-generic.

This makes hid-generic simpler and the whole logic simpler too.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-03-06 16:00:51 +01:00
Todd Kelner b7289cb1cf HID: sony: Add touchpad support for NSG-MR5U and NSG-MR7U remotes
Sony's NSG-MR5U and NSG-MR7U remote controls have a full keyboard and a
touchpad.  The keyboard is already supported by the existing Linux
kernel and drivers but the touchpad is not recognized.  This patch adds
the coded needed to bring full functionality to the touchpad.

Note that these remotes use the vendor code for SMK even though they are
Sony branded.

Known limitations
- The built-in accelerometers are not supported by these changes
- When the Drag (Fn) key is used as a mouse button, the button is
automatically released when the key begins repeating.  There are two
  workarounds for this 1) Use the button behind the touchpad instead of
  the Drag (Fn) key or 2) Disable the key repeat functionality or
  increase the key repeat delay.

Signed-off-by: Todd Kelner <tsopdump@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-03-06 15:22:06 +01:00
Gustavo A. R. Silva 001fab49dd HID: hid-multitouch: Use true and false for boolean values
Assign true or false to boolean variables instead of an integer value.

This issue was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-03-06 15:19:13 +01:00
Gustavo A. R. Silva 04230f4602 HID: hid-ntrig: use true and false for boolean values
Assign true or false to boolean variables instead of an integer value.

This issue was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-03-06 15:19:13 +01:00
Tomasz Kramkowski fbb77e88f0 HID: elecom: add support for EX-G M-XT4DRBK trackball
This patch enables the 6th button on the ELECOM EX-G M-XT4DRBK
trackball mouse.

This is a left handed EX-G variant which only comes in a wireless (D)
model. It has a total of 6 buttons but one of these is not available
because of how the HID descriptor is configured.

Signed-off-by: Tomasz Kramkowski <tk@the-tk.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-03-06 15:15:47 +01:00
Tomasz Kramkowski 79837eded6 HID: elecom: refer to trackballs by model name instead of series
This patch changes all references to ELECOM trackballs using their
series name to refer to them by their model name.

ELECOM provides multiple series of mice such as EX-G, HUGE, and DEFT.
Although it has not caused conflicts in the driver, there can be more
than one iteration of mice in each series. For example, there are 7
variants of EX-G trackballs but only three (M-XT3URBK, M-XT3DRBK, and
M-XT4DRBK) need a driver to work correctly.

There are also 4 DEFT series trackballs but two of them have the same
VID:PID as the other two. I picked the earlier model for the naming of
the PID macros.

Signed-off-by: Tomasz Kramkowski <tk@the-tk.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-03-06 15:15:47 +01:00
Aaron Bottegal b9b7a86fc1 HID: corsair: Add K70 Vengeance and K70 RAPIDFIRE to
K70 Vengeance sends garbage keypresses when changing  backlight brightness.
This hooks to the existing corsair driver, which filters out those
invalid keypresses on similar devices in the input mapping code.

V2: Fix spelling.

Signed-off-by: Aaron Bottegal <aaronbottegal@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-02-16 13:38:16 +01:00
Xiongfeng Wang 336fd4f5f2 HID: uhid: use strlcpy() instead of strncpy()
gcc-8 reports

drivers/hid/uhid.c: In function 'uhid_dev_create2':
./include/linux/string.h:245:9: warning: '__builtin_strncpy' output may
be truncated copying 127 bytes from a string of length 127
[-Wstringop-truncation]

The compiler require that the input param 'len' of strncpy() should be
greater than the length of the src string, so that '\0' is copied as
well. We can just use strlcpy() to avoid this warning.

Signed-off-by: Xiongfeng Wang <xiongfeng.wang@linaro.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-02-16 13:36:50 +01:00
Colin Ian King b9ec700929 HID: asus: make array 'buf' static const
Don't populate the const read-only array 'buf' on the stack but instead
make it static. Makes the object code smaller by 26 bytes:

Before:
   text	   data	    bss	    dec	    hex	filename
  14378	   2384	     64	  16826	   41ba	linux/drivers/hid/hid-asus.o

After:
   text	   data	    bss	    dec	    hex	filename
  14296	   2440	     64	  16800	   41a0	linux/drivers/hid/hid-asus.o

(gcc version 7.2.0 x86_64)

[jkosina@suse.cz: change commit message slightly]
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-02-16 13:34:28 +01:00
Aaron Ma 3064a03b94 HID: Fix hid_report_len usage
Follow the change of return type u32 of hid_report_len,
fix all the types of variables those get the return value of
hid_report_len to u32, and all other code already uses u32.

Cc: stable@vger.kernel.org
Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-02-16 13:30:56 +01:00
Aaron Ma 6de0b13cc0 HID: core: Fix size as type u32
When size is negative, calling memset will make segment fault.
Declare the size as type u32 to keep memset safe.

size in struct hid_report is unsigned, fix return type of
hid_report_len to u32.

Cc: stable@vger.kernel.org
Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-02-16 13:30:56 +01:00
Aaron Ma ac75a04104 HID: i2c-hid: fix size check and type usage
When convert char array with signed int, if the inbuf[x] is negative then
upper bits will be set to 1. Fix this by using u8 instead of char.

ret_size has to be at least 3, hid_input_report use it after minus 2 bytes.

Cc: stable@vger.kernel.org
Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-02-16 13:30:56 +01:00
Guus Sliepen bbca80b279 HID: corsair: Add support for the GLAIVE RGB gaming mouse
This mouse sold by Corsair as the GLAIVE RGB gaming mouse has the same
problem with its HID reports as the Scimitar PRO RGB, so reuse the
same fix for the GLAIVE RGB.

Signed-off-by: Guus Sliepen <guus@sliepen.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-02-16 13:28:20 +01:00
Alexandrov Stansilav 9a6a4193d6 HID: Add driver for USB ELAN Touchpad
This is driver for usb touchpad found on HP Pavilion x2 10-p0xx laptop. On this
device keyboard and touchpad connected as a single usb device with two
interfaces: keyboard, which exposes ordinary keys and second interface is
touchpad which also contains FlightMode button and audio mute led (which
physically placed on keyboard for some reason).

Initially, this touchpad works in mouse emulation mode, this driver will switch
it to touchpad mode, which can track 5 fingers and can report coordinates for
two of them.

Signed-off-by: Alexandrov Stansilav <neko@nya.ai>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-02-16 13:25:04 +01:00
Andy Shevchenko 8afede123b HID: i2c-hid: Use ACPI_COMPANION() directly
Instead of doing additional checks and functional calls,
just get ACPI companion device directly.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-02-16 13:19:12 +01:00
Karsten Koop 52ad2bd891 usb: ldusb: add PIDs for new CASSY devices supported by this driver
This patch adds support for new CASSY devices to the ldusb driver. The
PIDs are also added to the ignore list in hid-quirks.

Signed-off-by: Karsten Koop <kkoop@ld-didactic.de>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-15 18:44:03 +01:00
Linus Torvalds a9a08845e9 vfs: do bulk POLL* -> EPOLL* replacement
This is the mindless scripted replacement of kernel use of POLL*
variables as described by Al, done by this script:

    for V in IN OUT PRI ERR RDNORM RDBAND WRNORM WRBAND HUP RDHUP NVAL MSG; do
        L=`git grep -l -w POLL$V | grep -v '^t' | grep -v /um/ | grep -v '^sa' | grep -v '/poll.h$'|grep -v '^D'`
        for f in $L; do sed -i "-es/^\([^\"]*\)\(\<POLL$V\>\)/\\1E\\2/" $f; done
    done

with de-mangling cleanups yet to come.

NOTE! On almost all architectures, the EPOLL* constants have the same
values as the POLL* constants do.  But they keyword here is "almost".
For various bad reasons they aren't the same, and epoll() doesn't
actually work quite correctly in some cases due to this on Sparc et al.

The next patch from Al will sort out the final differences, and we
should be all done.

Scripted-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-02-11 14:34:03 -08:00
Linus Torvalds 183b6366cf Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
Pull HID updates from Jiri Kosina:

 - remove hid_have_special_driver[] entry hard requirement for any newly
   supported VID/PID by a specific non-core hid driver, and general
   related cleanup of HID matching core, from Benjamin Tissoires

 - support for new Wacom devices and a few small fixups for already
   supported ones in Wacom driver, from Aaron Armstrong Skomra and Jason
   Gerecke

 - sysfs interface fix for roccat driver from Dan Carpenter

 - support for new Asus HW (T100TAF, T100HA, T200TA) from Hans de Goede

 - improved support for Jabra devices, from Niels Skou Olsen

 - other assorted small fixes and new device IDs

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (30 commits)
  HID: quirks: Fix keyboard + touchpad on Toshiba Click Mini not working
  HID: roccat: prevent an out of bounds read in kovaplus_profile_activated()
  HID: asus: Fix special function keys on T200TA
  HID: asus: Add touchpad max x/y and resolution info for the T200TA
  HID: wacom: Add support for One by Wacom (CTL-472 / CTL-672)
  HID: wacom: Fix reporting of touch toggle (WACOM_HID_WD_MUTE_DEVICE) events
  HID: intel-ish-hid: Enable Cannon Lake and Coffee Lake laptop/desktop
  HID: elecom: rewrite report fixup for EX-G and future mice
  HID: sony: Report DS4 version info through sysfs
  HID: sony: Print reversed MAC address via %pMR
  HID: wacom: EKR: ensure devres groups at higher indexes are released
  HID: rmi: Support the Fujitsu R726 Pad dock using hid-rmi
  HID: add quirk for another PIXART OEM mouse used by HP
  HID: quirks: make array hid_quirks static
  HID: hid-multitouch: support fine-grain orientation reporting
  HID: asus: Add product-id for the T100TAF and T100HA keyboard docks
  HID: elo: clear BTN_LEFT mapping
  HID: multitouch: Combine all left-button events in a frame
  HID: multitouch: Only look at non touch fields in first packet of a frame
  HID: multitouch: Properly deal with Win8 PTP reports with 0 touches
  ...
2018-01-31 13:00:01 -08:00
Jiri Kosina c86aa0129c Merge branches 'for-4.16/upstream' and 'for-4.15/upstream-fixes' into for-linus
Pull assorted small fixes queued for merge window.
2018-01-31 16:23:58 +01:00
Jiri Kosina e56236b0b2 Merge branch 'for-4.16/i2c-hid' into for-linus 2018-01-31 16:23:47 +01:00
Jiri Kosina 740c84eec7 Merge branch 'for-4.16/wacom' into for-linus
Pull Wacom device driver updates. These don't have to go on top of the
hid_have_special_driver[] revamp, as the whole group is assumed to
have a special driver based on VID.
2018-01-31 16:23:05 +01:00
Jiri Kosina a44f3ec625 Merge branch 'for-4.16/elo' into for-linus
Pull hid-elo device detection fix
2018-01-31 16:22:06 +01:00
Jiri Kosina 790844941a Merge branches 'for-4.16/hid-quirks-cleanup/asus', 'for-4.16/hid-quirks-cleanup/elecom', 'for-4.16/hid-quirks-cleanup/ish', 'for-4.16/hid-quirks-cleanup/multitouch', 'for-4.16/hid-quirks-cleanup/pixart', 'for-4.16/hid-quirks-cleanup/rmi', 'for-4.16/hid-quirks-cleanup/sony' and 'for-4.16/hid-quirks-cleanup/toshiba' into for-linus
Pull assorted device driver fixes (ASUS, Elecom, Intel-ISH, Multitouch, PixArt, RMI,
Sony and Toshiba) based on top the hid-quirks revamp.
2018-01-31 16:15:58 +01:00
Jiri Kosina a7acb31d6c Merge branch 'for-4.16/hid-quirks-cleanup/_base' into for-linus
This series from Benjamin Tissoires finally removes one of the big PITAs
in the hid-core, which is the absolute need of having added all the new
device IDs into the horrid hid_have_special_driver[]
2018-01-31 16:12:23 +01:00
Linus Torvalds 168fe32a07 Merge branch 'misc.poll' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull poll annotations from Al Viro:
 "This introduces a __bitwise type for POLL### bitmap, and propagates
  the annotations through the tree. Most of that stuff is as simple as
  'make ->poll() instances return __poll_t and do the same to local
  variables used to hold the future return value'.

  Some of the obvious brainos found in process are fixed (e.g. POLLIN
  misspelled as POLL_IN). At that point the amount of sparse warnings is
  low and most of them are for genuine bugs - e.g. ->poll() instance
  deciding to return -EINVAL instead of a bitmap. I hadn't touched those
  in this series - it's large enough as it is.

  Another problem it has caught was eventpoll() ABI mess; select.c and
  eventpoll.c assumed that corresponding POLL### and EPOLL### were
  equal. That's true for some, but not all of them - EPOLL### are
  arch-independent, but POLL### are not.

  The last commit in this series separates userland POLL### values from
  the (now arch-independent) kernel-side ones, converting between them
  in the few places where they are copied to/from userland. AFAICS, this
  is the least disruptive fix preserving poll(2) ABI and making epoll()
  work on all architectures.

  As it is, it's simply broken on sparc - try to give it EPOLLWRNORM and
  it will trigger only on what would've triggered EPOLLWRBAND on other
  architectures. EPOLLWRBAND and EPOLLRDHUP, OTOH, are never triggered
  at all on sparc. With this patch they should work consistently on all
  architectures"

* 'misc.poll' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (37 commits)
  make kernel-side POLL... arch-independent
  eventpoll: no need to mask the result of epi_item_poll() again
  eventpoll: constify struct epoll_event pointers
  debugging printk in sg_poll() uses %x to print POLL... bitmap
  annotate poll(2) guts
  9p: untangle ->poll() mess
  ->si_band gets POLL... bitmap stored into a user-visible long field
  ring_buffer_poll_wait() return value used as return value of ->poll()
  the rest of drivers/*: annotate ->poll() instances
  media: annotate ->poll() instances
  fs: annotate ->poll() instances
  ipc, kernel, mm: annotate ->poll() instances
  net: annotate ->poll() instances
  apparmor: annotate ->poll() instances
  tomoyo: annotate ->poll() instances
  sound: annotate ->poll() instances
  acpi: annotate ->poll() instances
  crypto: annotate ->poll() instances
  block: annotate ->poll() instances
  x86: annotate ->poll() instances
  ...
2018-01-30 17:58:07 -08:00
Hans de Goede edfc3722cf HID: quirks: Fix keyboard + touchpad on Toshiba Click Mini not working
The Toshiba Click Mini uses an i2c attached keyboard/touchpad combo
(single i2c_hid device for both) which has a vid:pid of 04F3:0401,
which is also used by a bunch of Elan touchpads which are handled by the
drivers/input/mouse/elan_i2c driver, but that driver deals with pure
touchpads and does not work for a combo device such as the one on the
Toshiba Click Mini.

The combo on the Mini has an ACPI id of ELAN0800, which is not claimed
by the elan_i2c driver, so check for that and if it is found do not ignore
the device. This fixes the keyboard/touchpad combo on the Mini not working
(although with the touchpad in mouse emulation mode).

Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-01-23 15:48:01 +01:00
Dan Carpenter 7ad81482ca HID: roccat: prevent an out of bounds read in kovaplus_profile_activated()
We get the "new_profile_index" value from the mouse device when we're
handling raw events.  Smatch taints it as untrusted data and complains
that we need a bounds check.  This seems like a reasonable warning
otherwise there is a small read beyond the end of the array.

Fixes: 0e70f97f25 ("HID: roccat: Add support for Kova[+] mouse")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Silvan Jegen <s.jegen@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-01-23 15:46:58 +01:00
Hans de Goede 33edee4f3c HID: asus: Fix special function keys on T200TA
Just like on the T100TA the T200TA HID descriptors for the 0xff32
Asus vendor usage page need a small fixup. But on the T200TA the HID
descriptors are larger because they have descrriptors for one more
(unused) HID report appended.

Extend the T100TA descriptor fixup to also check for the T200TA's
descriptors size.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-01-23 15:44:59 +01:00
Hans de Goede dbd3ef28e0 HID: asus: Add touchpad max x/y and resolution info for the T200TA
The Asus T200TA uses the same USB device-id for its keyboard dock as the
T100TA, but the touchpad has a different size and corresponding different
max x/y values.

Add a separate asus_touchpad_info struct for the T200TA and select this
based on the DMI product-name (as we are already doing for the T100HA),
so that we report the correct info to userspace.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-01-23 15:44:58 +01:00