Skip to content

Commit 073c916

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input updates from Dmitry Torokhov: - an update to Elan touchpad SMBus driver to fetch device parameters (size, resolution) while it is still in PS/2 mode, before switching over to SMBus, as in that mode some devices return garbage dimensions - update to iforce joystick driver - miscellaneous driver fixes * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (48 commits) Input: gpio_keys_polled - allow specifying name of input device Input: edt-ft5x06 - simplify event reporting code Input: max77650-onkey - add MODULE_ALIAS() Input: atmel_mxt_ts - fix leak in mxt_update_cfg() Input: synaptics - enable SMBUS on T480 thinkpad trackpad Input: atmel_mxt_ts - fix -Wunused-const-variable Input: joydev - extend absolute mouse detection HID: quirks: Refactor ELAN 400 and 401 handling Input: elan_i2c - export the device id whitelist Input: edt-ft5x06 - use get_unaligned_be16() Input: iforce - add the Saitek R440 Force Wheel Input: iforce - use unaligned accessors, where appropriate Input: iforce - drop couple of temps from transport code Input: iforce - drop bus type from iforce structure Input: iforce - use DMA-safe buffores for USB transfers Input: iforce - allow callers supply data buffer when fetching device IDs Input: iforce - only call iforce_process_packet() if initialized Input: iforce - signal command completion from transport code Input: iforce - do not combine arguments for iforce_process_packet() Input: iforce - factor out hat handling when parsing packets ...
2 parents a2d79c7 + 5974737 commit 073c916

28 files changed

Lines changed: 872 additions & 711 deletions

‎Documentation/devicetree/bindings/input/elan_i2c.txt‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,20 @@ Optional properties:
1313
pinctrl binding [1]).
1414
- vcc-supply: a phandle for the regulator supplying 3.3V power.
1515
- elan,trackpoint: touchpad can support a trackpoint (boolean)
16+
- elan,clickpad: touchpad is a clickpad (the entire surface is a button)
17+
- elan,middle-button: touchpad has a physical middle button
18+
- elan,x_traces: number of antennas on the x axis
19+
- elan,y_traces: number of antennas on the y axis
20+
- some generic touchscreen properties [2]:
21+
* touchscreen-size-x
22+
* touchscreen-size-y
23+
* touchscreen-x-mm
24+
* touchscreen-y-mm
25+
1626

1727
[0]: Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
1828
[1]: Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt
29+
[2]: Documentation/devicetree/bindings/input/touchscreen/touchscreen.txt
1930

2031
Example:
2132
&i2c1 {

‎drivers/hid/hid-quirks.c‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <linux/export.h>
1717
#include <linux/slab.h>
1818
#include <linux/mutex.h>
19+
#include <linux/input/elan-i2c-ids.h>
1920

2021
#include "hid-ids.h"
2122

@@ -916,6 +917,8 @@ static const struct hid_device_id hid_mouse_ignore_list[] = {
916917

917918
bool hid_ignore(struct hid_device *hdev)
918919
{
920+
int i;
921+
919922
if (hdev->quirks & HID_QUIRK_NO_IGNORE)
920923
return false;
921924
if (hdev->quirks & HID_QUIRK_IGNORE)
@@ -980,18 +983,15 @@ bool hid_ignore(struct hid_device *hdev)
980983
break;
981984
case USB_VENDOR_ID_ELAN:
982985
/*
983-
* Many Elan devices have a product id of 0x0401 and are handled
984-
* by the elan_i2c input driver. But the ACPI HID ELAN0800 dev
985-
* is not (and cannot be) handled by that driver ->
986-
* Ignore all 0x0401 devs except for the ELAN0800 dev.
986+
* Blacklist of everything that gets handled by the elan_i2c
987+
* input driver. This avoids disabling valid touchpads and
988+
* other ELAN devices.
987989
*/
988-
if (hdev->product == 0x0401 &&
989-
strncmp(hdev->name, "ELAN0800", 8) != 0)
990-
return true;
991-
/* Same with product id 0x0400 */
992-
if (hdev->product == 0x0400 &&
993-
strncmp(hdev->name, "QTEC0001", 8) != 0)
994-
return true;
990+
if ((hdev->product == 0x0401 || hdev->product == 0x0400))
991+
for (i = 0; strlen(elan_acpi_id[i].id); ++i)
992+
if (!strncmp(hdev->name, elan_acpi_id[i].id,
993+
strlen(elan_acpi_id[i].id)))
994+
return true;
995995
break;
996996
}
997997

‎drivers/input/joydev.c‎

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -808,6 +808,7 @@ static bool joydev_dev_is_blacklisted(struct input_dev *dev)
808808
static bool joydev_dev_is_absolute_mouse(struct input_dev *dev)
809809
{
810810
DECLARE_BITMAP(jd_scratch, KEY_CNT);
811+
bool ev_match = false;
811812

812813
BUILD_BUG_ON(ABS_CNT > KEY_CNT || EV_CNT > KEY_CNT);
813814

@@ -826,17 +827,36 @@ static bool joydev_dev_is_absolute_mouse(struct input_dev *dev)
826827
* considered to be an absolute mouse if the following is
827828
* true:
828829
*
829-
* 1) Event types are exactly EV_ABS, EV_KEY and EV_SYN.
830+
* 1) Event types are exactly
831+
* EV_ABS, EV_KEY and EV_SYN
832+
* or
833+
* EV_ABS, EV_KEY, EV_SYN and EV_MSC
834+
* or
835+
* EV_ABS, EV_KEY, EV_SYN, EV_MSC and EV_REL.
830836
* 2) Absolute events are exactly ABS_X and ABS_Y.
831837
* 3) Keys are exactly BTN_LEFT, BTN_RIGHT and BTN_MIDDLE.
832838
* 4) Device is not on "Amiga" bus.
833839
*/
834840

835841
bitmap_zero(jd_scratch, EV_CNT);
842+
/* VMware VMMouse, HP ILO2 */
836843
__set_bit(EV_ABS, jd_scratch);
837844
__set_bit(EV_KEY, jd_scratch);
838845
__set_bit(EV_SYN, jd_scratch);
839-
if (!bitmap_equal(jd_scratch, dev->evbit, EV_CNT))
846+
if (bitmap_equal(jd_scratch, dev->evbit, EV_CNT))
847+
ev_match = true;
848+
849+
/* HP ILO2, AMI BMC firmware */
850+
__set_bit(EV_MSC, jd_scratch);
851+
if (bitmap_equal(jd_scratch, dev->evbit, EV_CNT))
852+
ev_match = true;
853+
854+
/* VMware Virtual USB Mouse, QEMU USB Tablet, ATEN BMC firmware */
855+
__set_bit(EV_REL, jd_scratch);
856+
if (bitmap_equal(jd_scratch, dev->evbit, EV_CNT))
857+
ev_match = true;
858+
859+
if (!ev_match)
840860
return false;
841861

842862
bitmap_zero(jd_scratch, ABS_CNT);

‎drivers/input/joystick/iforce/Kconfig‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ config JOYSTICK_IFORCE
1414
module will be called iforce.
1515

1616
config JOYSTICK_IFORCE_USB
17-
bool "I-Force USB joysticks and wheels"
18-
depends on JOYSTICK_IFORCE && (JOYSTICK_IFORCE=m || USB=y) && USB
17+
tristate "I-Force USB joysticks and wheels"
18+
depends on JOYSTICK_IFORCE && USB
1919
help
2020
Say Y here if you have an I-Force joystick or steering wheel
2121
connected to your USB port.
2222

2323
config JOYSTICK_IFORCE_232
24-
bool "I-Force Serial joysticks and wheels"
25-
depends on JOYSTICK_IFORCE && (JOYSTICK_IFORCE=m || SERIO=y) && SERIO
24+
tristate "I-Force Serial joysticks and wheels"
25+
depends on JOYSTICK_IFORCE && SERIO
2626
help
2727
Say Y here if you have an I-Force joystick or steering wheel
2828
connected to your serial (COM) port.

‎drivers/input/joystick/iforce/Makefile‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
# By Johann Deneux <johann.deneux@gmail.com>
66
#
77

8-
obj-$(CONFIG_JOYSTICK_IFORCE) += iforce.o
9-
8+
obj-$(CONFIG_JOYSTICK_IFORCE) += iforce.o
109
iforce-y := iforce-ff.o iforce-main.o iforce-packets.o
11-
iforce-$(CONFIG_JOYSTICK_IFORCE_232) += iforce-serio.o
12-
iforce-$(CONFIG_JOYSTICK_IFORCE_USB) += iforce-usb.o
10+
obj-$(CONFIG_JOYSTICK_IFORCE_232) += iforce-serio.o
11+
obj-$(CONFIG_JOYSTICK_IFORCE_USB) += iforce-usb.o

‎drivers/input/joystick/iforce/iforce-ff.c‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -372,12 +372,12 @@ int iforce_upload_periodic(struct iforce *iforce, struct ff_effect *effect, stru
372372
}
373373

374374
switch (effect->u.periodic.waveform) {
375-
case FF_SQUARE: wave_code = 0x20; break;
376-
case FF_TRIANGLE: wave_code = 0x21; break;
377-
case FF_SINE: wave_code = 0x22; break;
378-
case FF_SAW_UP: wave_code = 0x23; break;
379-
case FF_SAW_DOWN: wave_code = 0x24; break;
380-
default: wave_code = 0x20; break;
375+
case FF_SQUARE: wave_code = 0x20; break;
376+
case FF_TRIANGLE: wave_code = 0x21; break;
377+
case FF_SINE: wave_code = 0x22; break;
378+
case FF_SAW_UP: wave_code = 0x23; break;
379+
case FF_SAW_DOWN: wave_code = 0x24; break;
380+
default: wave_code = 0x20; break;
381381
}
382382

383383
if (!old || need_core(old, effect)) {
@@ -476,9 +476,9 @@ int iforce_upload_condition(struct iforce *iforce, struct ff_effect *effect, str
476476
int core_err = 0;
477477

478478
switch (effect->type) {
479-
case FF_SPRING: type = 0x40; break;
480-
case FF_DAMPER: type = 0x41; break;
481-
default: return -1;
479+
case FF_SPRING: type = 0x40; break;
480+
case FF_DAMPER: type = 0x41; break;
481+
default: return -1;
482482
}
483483

484484
if (!old || need_condition_modifier(iforce, old, effect)) {

0 commit comments

Comments
 (0)