Skip to content
Permalink
Browse files

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
  ...
  • Loading branch information...
torvalds committed Jul 13, 2019
2 parents a2d79c7 + 5974737 commit 073c916bc00571d8662b89a294eba265481b6fbb
@@ -13,9 +13,20 @@ Optional properties:
pinctrl binding [1]).
- vcc-supply: a phandle for the regulator supplying 3.3V power.
- elan,trackpoint: touchpad can support a trackpoint (boolean)
- elan,clickpad: touchpad is a clickpad (the entire surface is a button)
- elan,middle-button: touchpad has a physical middle button
- elan,x_traces: number of antennas on the x axis
- elan,y_traces: number of antennas on the y axis
- some generic touchscreen properties [2]:
* touchscreen-size-x
* touchscreen-size-y
* touchscreen-x-mm
* touchscreen-y-mm


[0]: Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
[1]: Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt
[2]: Documentation/devicetree/bindings/input/touchscreen/touchscreen.txt

Example:
&i2c1 {
@@ -16,6 +16,7 @@
#include <linux/export.h>
#include <linux/slab.h>
#include <linux/mutex.h>
#include <linux/input/elan-i2c-ids.h>

#include "hid-ids.h"

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

bool hid_ignore(struct hid_device *hdev)
{
int i;

if (hdev->quirks & HID_QUIRK_NO_IGNORE)
return false;
if (hdev->quirks & HID_QUIRK_IGNORE)
@@ -980,18 +983,15 @@ bool hid_ignore(struct hid_device *hdev)
break;
case USB_VENDOR_ID_ELAN:
/*
* Many Elan devices have a product id of 0x0401 and are handled
* by the elan_i2c input driver. But the ACPI HID ELAN0800 dev
* is not (and cannot be) handled by that driver ->
* Ignore all 0x0401 devs except for the ELAN0800 dev.
* Blacklist of everything that gets handled by the elan_i2c
* input driver. This avoids disabling valid touchpads and
* other ELAN devices.
*/
if (hdev->product == 0x0401 &&
strncmp(hdev->name, "ELAN0800", 8) != 0)
return true;
/* Same with product id 0x0400 */
if (hdev->product == 0x0400 &&
strncmp(hdev->name, "QTEC0001", 8) != 0)
return true;
if ((hdev->product == 0x0401 || hdev->product == 0x0400))
for (i = 0; strlen(elan_acpi_id[i].id); ++i)
if (!strncmp(hdev->name, elan_acpi_id[i].id,
strlen(elan_acpi_id[i].id)))
return true;
break;
}

@@ -808,6 +808,7 @@ static bool joydev_dev_is_blacklisted(struct input_dev *dev)
static bool joydev_dev_is_absolute_mouse(struct input_dev *dev)
{
DECLARE_BITMAP(jd_scratch, KEY_CNT);
bool ev_match = false;

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

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

bitmap_zero(jd_scratch, EV_CNT);
/* VMware VMMouse, HP ILO2 */
__set_bit(EV_ABS, jd_scratch);
__set_bit(EV_KEY, jd_scratch);
__set_bit(EV_SYN, jd_scratch);
if (!bitmap_equal(jd_scratch, dev->evbit, EV_CNT))
if (bitmap_equal(jd_scratch, dev->evbit, EV_CNT))
ev_match = true;

/* HP ILO2, AMI BMC firmware */
__set_bit(EV_MSC, jd_scratch);
if (bitmap_equal(jd_scratch, dev->evbit, EV_CNT))
ev_match = true;

/* VMware Virtual USB Mouse, QEMU USB Tablet, ATEN BMC firmware */
__set_bit(EV_REL, jd_scratch);
if (bitmap_equal(jd_scratch, dev->evbit, EV_CNT))
ev_match = true;

if (!ev_match)
return false;

bitmap_zero(jd_scratch, ABS_CNT);
@@ -14,15 +14,15 @@ config JOYSTICK_IFORCE
module will be called iforce.

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

config JOYSTICK_IFORCE_232
bool "I-Force Serial joysticks and wheels"
depends on JOYSTICK_IFORCE && (JOYSTICK_IFORCE=m || SERIO=y) && SERIO
tristate "I-Force Serial joysticks and wheels"
depends on JOYSTICK_IFORCE && SERIO
help
Say Y here if you have an I-Force joystick or steering wheel
connected to your serial (COM) port.
@@ -5,8 +5,7 @@
# By Johann Deneux <johann.deneux@gmail.com>
#

obj-$(CONFIG_JOYSTICK_IFORCE) += iforce.o

obj-$(CONFIG_JOYSTICK_IFORCE) += iforce.o
iforce-y := iforce-ff.o iforce-main.o iforce-packets.o
iforce-$(CONFIG_JOYSTICK_IFORCE_232) += iforce-serio.o
iforce-$(CONFIG_JOYSTICK_IFORCE_USB) += iforce-usb.o
obj-$(CONFIG_JOYSTICK_IFORCE_232) += iforce-serio.o
obj-$(CONFIG_JOYSTICK_IFORCE_USB) += iforce-usb.o
@@ -372,12 +372,12 @@ int iforce_upload_periodic(struct iforce *iforce, struct ff_effect *effect, stru
}

switch (effect->u.periodic.waveform) {
case FF_SQUARE: wave_code = 0x20; break;
case FF_TRIANGLE: wave_code = 0x21; break;
case FF_SINE: wave_code = 0x22; break;
case FF_SAW_UP: wave_code = 0x23; break;
case FF_SAW_DOWN: wave_code = 0x24; break;
default: wave_code = 0x20; break;
case FF_SQUARE: wave_code = 0x20; break;
case FF_TRIANGLE: wave_code = 0x21; break;
case FF_SINE: wave_code = 0x22; break;
case FF_SAW_UP: wave_code = 0x23; break;
case FF_SAW_DOWN: wave_code = 0x24; break;
default: wave_code = 0x20; break;
}

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

switch (effect->type) {
case FF_SPRING: type = 0x40; break;
case FF_DAMPER: type = 0x41; break;
default: return -1;
case FF_SPRING: type = 0x40; break;
case FF_DAMPER: type = 0x41; break;
default: return -1;
}

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

0 comments on commit 073c916

Please sign in to comment.
You can’t perform that action at this time.