Skip to content

Commit 2158091

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: - a new driver to ChipOne icn8505 based touchscreens - on certain systems with Elan touch controllers they will be switched away form PS/2 emulation and over to native SMbus mode - assorted driver fixups and improvements * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (24 commits) Input: elan_i2c - add ELAN0612 (Lenovo v330 14IKB) ACPI ID Input: goodix - add new ACPI id for GPD Win 2 touch screen Input: xpad - add GPD Win 2 Controller USB IDs Input: ti_am335x_tsc - prevent system suspend when TSC is in use Input: ti_am335x_tsc - ack pending IRQs at probe and before suspend Input: cros_ec_keyb - mark cros_ec_keyb driver as wake enabled device. Input: mk712 - update documentation web link Input: atmel_mxt_ts - fix reset-gpio for level based irqs Input: atmel_mxt_ts - require device properties present when probing Input: psmouse-smbus - allow to control psmouse_deactivate Input: elantech - detect new ICs and setup Host Notify for them Input: elantech - add support for SMBus devices Input: elantech - query the resolution in query_info Input: elantech - split device info into a separate structure Input: elan_i2c - add trackstick report Input: usbtouchscreen - add sysfs attribute for 3M MTouch firmware rev Input: ati_remote2 - fix typo 'can by' to 'can be' Input: replace hard coded string with __func__ in pr_err() Input: add support for ChipOne icn8505 based touchscreens Input: gamecon - avoid using __set_bit() for capabilities ...
2 parents 3e1a29b + e6e7e9c commit 2158091

26 files changed

+1325
-389
lines changed

Documentation/devicetree/bindings/input/elan_i2c.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Optional properties:
1414
- pinctrl-0: a phandle pointing to the pin settings for the device (see
1515
pinctrl binding [1]).
1616
- vcc-supply: a phandle for the regulator supplying 3.3V power.
17+
- elan,trackpoint: touchpad can support a trackpoint (boolean)
1718

1819
[0]: Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
1920
[1]: Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt

MAINTAINERS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3431,6 +3431,12 @@ S: Maintained
34313431
F: Documentation/devicetree/bindings/input/touchscreen/chipone_icn8318.txt
34323432
F: drivers/input/touchscreen/chipone_icn8318.c
34333433

3434+
CHIPONE ICN8505 I2C TOUCHSCREEN DRIVER
3435+
M: Hans de Goede <[email protected]>
3436+
3437+
S: Maintained
3438+
F: drivers/input/touchscreen/chipone_icn8505.c
3439+
34343440
CHROME HARDWARE PLATFORM SUPPORT
34353441
M: Benson Leung <[email protected]>
34363442
M: Olof Johansson <[email protected]>

drivers/input/input.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1943,8 +1943,7 @@ void input_set_capability(struct input_dev *dev, unsigned int type, unsigned int
19431943
break;
19441944

19451945
default:
1946-
pr_err("input_set_capability: unknown type %u (code %u)\n",
1947-
type, code);
1946+
pr_err("%s: unknown type %u (code %u)\n", __func__, type, code);
19481947
dump_stack();
19491948
return;
19501949
}

drivers/input/joystick/as5011.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,7 @@ static int as5011_probe(struct i2c_client *client,
269269
input_dev->id.bustype = BUS_I2C;
270270
input_dev->dev.parent = &client->dev;
271271

272-
__set_bit(EV_KEY, input_dev->evbit);
273-
__set_bit(EV_ABS, input_dev->evbit);
274-
__set_bit(BTN_JOYSTICK, input_dev->keybit);
272+
input_set_capability(input_dev, EV_KEY, BTN_JOYSTICK);
275273

276274
input_set_abs_params(input_dev, ABS_X,
277275
AS5011_MIN_AXIS, AS5011_MAX_AXIS, AS5011_FUZZ, AS5011_FLAT);

drivers/input/joystick/gamecon.c

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@ static int gc_setup_pad(struct gc *gc, int idx, int pad_type)
862862

863863
case GC_N64:
864864
for (i = 0; i < 10; i++)
865-
__set_bit(gc_n64_btn[i], input_dev->keybit);
865+
input_set_capability(input_dev, EV_KEY, gc_n64_btn[i]);
866866

867867
for (i = 0; i < 2; i++) {
868868
input_set_abs_params(input_dev, ABS_X + i, -127, 126, 0, 2);
@@ -879,42 +879,45 @@ static int gc_setup_pad(struct gc *gc, int idx, int pad_type)
879879
break;
880880

881881
case GC_SNESMOUSE:
882-
__set_bit(BTN_LEFT, input_dev->keybit);
883-
__set_bit(BTN_RIGHT, input_dev->keybit);
884-
__set_bit(REL_X, input_dev->relbit);
885-
__set_bit(REL_Y, input_dev->relbit);
882+
input_set_capability(input_dev, EV_KEY, BTN_LEFT);
883+
input_set_capability(input_dev, EV_KEY, BTN_RIGHT);
884+
input_set_capability(input_dev, EV_REL, REL_X);
885+
input_set_capability(input_dev, EV_REL, REL_Y);
886886
break;
887887

888888
case GC_SNES:
889889
for (i = 4; i < 8; i++)
890-
__set_bit(gc_snes_btn[i], input_dev->keybit);
890+
input_set_capability(input_dev, EV_KEY, gc_snes_btn[i]);
891891
/* fall through */
892892
case GC_NES:
893893
for (i = 0; i < 4; i++)
894-
__set_bit(gc_snes_btn[i], input_dev->keybit);
894+
input_set_capability(input_dev, EV_KEY, gc_snes_btn[i]);
895895
break;
896896

897897
case GC_MULTI2:
898-
__set_bit(BTN_THUMB, input_dev->keybit);
898+
input_set_capability(input_dev, EV_KEY, BTN_THUMB);
899899
/* fall through */
900900
case GC_MULTI:
901-
__set_bit(BTN_TRIGGER, input_dev->keybit);
901+
input_set_capability(input_dev, EV_KEY, BTN_TRIGGER);
902+
/* fall through */
902903
break;
903904

904905
case GC_PSX:
905906
for (i = 0; i < 6; i++)
906907
input_set_abs_params(input_dev,
907908
gc_psx_abs[i], 4, 252, 0, 2);
908909
for (i = 0; i < 12; i++)
909-
__set_bit(gc_psx_btn[i], input_dev->keybit);
910+
input_set_capability(input_dev, EV_KEY, gc_psx_btn[i]);
911+
break;
910912

911913
break;
912914

913915
case GC_DDR:
914916
for (i = 0; i < 4; i++)
915-
__set_bit(gc_psx_ddr_btn[i], input_dev->keybit);
917+
input_set_capability(input_dev, EV_KEY,
918+
gc_psx_ddr_btn[i]);
916919
for (i = 0; i < 12; i++)
917-
__set_bit(gc_psx_btn[i], input_dev->keybit);
920+
input_set_capability(input_dev, EV_KEY, gc_psx_btn[i]);
918921

919922
break;
920923
}

drivers/input/joystick/xpad.c

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,10 @@
8686

8787
#define XPAD_PKT_LEN 64
8888

89-
/* xbox d-pads should map to buttons, as is required for DDR pads
90-
but we map them to axes when possible to simplify things */
89+
/*
90+
* xbox d-pads should map to buttons, as is required for DDR pads
91+
* but we map them to axes when possible to simplify things
92+
*/
9193
#define MAP_DPAD_TO_BUTTONS (1 << 0)
9294
#define MAP_TRIGGERS_TO_BUTTONS (1 << 1)
9395
#define MAP_STICKS_TO_NULL (1 << 2)
@@ -123,6 +125,7 @@ static const struct xpad_device {
123125
u8 mapping;
124126
u8 xtype;
125127
} xpad_device[] = {
128+
{ 0x0079, 0x18d4, "GPD Win 2 Controller", 0, XTYPE_XBOX360 },
126129
{ 0x044f, 0x0f00, "Thrustmaster Wheel", 0, XTYPE_XBOX },
127130
{ 0x044f, 0x0f03, "Thrustmaster Wheel", 0, XTYPE_XBOX },
128131
{ 0x044f, 0x0f07, "Thrustmaster, Inc. Controller", 0, XTYPE_XBOX },
@@ -387,15 +390,15 @@ static const signed short xpad_abs_triggers[] = {
387390
* match against vendor id as well. Wired Xbox 360 devices have protocol 1,
388391
* wireless controllers have protocol 129.
389392
*/
390-
#define XPAD_XBOX360_VENDOR_PROTOCOL(vend,pr) \
393+
#define XPAD_XBOX360_VENDOR_PROTOCOL(vend, pr) \
391394
.match_flags = USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_INT_INFO, \
392395
.idVendor = (vend), \
393396
.bInterfaceClass = USB_CLASS_VENDOR_SPEC, \
394397
.bInterfaceSubClass = 93, \
395398
.bInterfaceProtocol = (pr)
396399
#define XPAD_XBOX360_VENDOR(vend) \
397-
{ XPAD_XBOX360_VENDOR_PROTOCOL(vend,1) }, \
398-
{ XPAD_XBOX360_VENDOR_PROTOCOL(vend,129) }
400+
{ XPAD_XBOX360_VENDOR_PROTOCOL((vend), 1) }, \
401+
{ XPAD_XBOX360_VENDOR_PROTOCOL((vend), 129) }
399402

400403
/* The Xbox One controller uses subclass 71 and protocol 208. */
401404
#define XPAD_XBOXONE_VENDOR_PROTOCOL(vend, pr) \
@@ -405,10 +408,11 @@ static const signed short xpad_abs_triggers[] = {
405408
.bInterfaceSubClass = 71, \
406409
.bInterfaceProtocol = (pr)
407410
#define XPAD_XBOXONE_VENDOR(vend) \
408-
{ XPAD_XBOXONE_VENDOR_PROTOCOL(vend, 208) }
411+
{ XPAD_XBOXONE_VENDOR_PROTOCOL((vend), 208) }
409412

410413
static const struct usb_device_id xpad_table[] = {
411414
{ USB_INTERFACE_INFO('X', 'B', 0) }, /* X-Box USB-IF not approved class */
415+
XPAD_XBOX360_VENDOR(0x0079), /* GPD Win 2 Controller */
412416
XPAD_XBOX360_VENDOR(0x044f), /* Thrustmaster X-Box 360 controllers */
413417
XPAD_XBOX360_VENDOR(0x045e), /* Microsoft X-Box 360 controllers */
414418
XPAD_XBOXONE_VENDOR(0x045e), /* Microsoft X-Box One controllers */
@@ -1573,7 +1577,6 @@ static void xpad_close(struct input_dev *dev)
15731577
static void xpad_set_up_abs(struct input_dev *input_dev, signed short abs)
15741578
{
15751579
struct usb_xpad *xpad = input_get_drvdata(input_dev);
1576-
set_bit(abs, input_dev->absbit);
15771580

15781581
switch (abs) {
15791582
case ABS_X:
@@ -1593,6 +1596,9 @@ static void xpad_set_up_abs(struct input_dev *input_dev, signed short abs)
15931596
case ABS_HAT0Y: /* the d-pad (only if dpad is mapped to axes */
15941597
input_set_abs_params(input_dev, abs, -1, 1, 0, 0);
15951598
break;
1599+
default:
1600+
input_set_abs_params(input_dev, abs, 0, 0, 0, 0);
1601+
break;
15961602
}
15971603
}
15981604

@@ -1633,32 +1639,30 @@ static int xpad_init_input(struct usb_xpad *xpad)
16331639
input_dev->close = xpad_close;
16341640
}
16351641

1636-
__set_bit(EV_KEY, input_dev->evbit);
1637-
16381642
if (!(xpad->mapping & MAP_STICKS_TO_NULL)) {
1639-
__set_bit(EV_ABS, input_dev->evbit);
16401643
/* set up axes */
16411644
for (i = 0; xpad_abs[i] >= 0; i++)
16421645
xpad_set_up_abs(input_dev, xpad_abs[i]);
16431646
}
16441647

16451648
/* set up standard buttons */
16461649
for (i = 0; xpad_common_btn[i] >= 0; i++)
1647-
__set_bit(xpad_common_btn[i], input_dev->keybit);
1650+
input_set_capability(input_dev, EV_KEY, xpad_common_btn[i]);
16481651

16491652
/* set up model-specific ones */
16501653
if (xpad->xtype == XTYPE_XBOX360 || xpad->xtype == XTYPE_XBOX360W ||
16511654
xpad->xtype == XTYPE_XBOXONE) {
16521655
for (i = 0; xpad360_btn[i] >= 0; i++)
1653-
__set_bit(xpad360_btn[i], input_dev->keybit);
1656+
input_set_capability(input_dev, EV_KEY, xpad360_btn[i]);
16541657
} else {
16551658
for (i = 0; xpad_btn[i] >= 0; i++)
1656-
__set_bit(xpad_btn[i], input_dev->keybit);
1659+
input_set_capability(input_dev, EV_KEY, xpad_btn[i]);
16571660
}
16581661

16591662
if (xpad->mapping & MAP_DPAD_TO_BUTTONS) {
16601663
for (i = 0; xpad_btn_pad[i] >= 0; i++)
1661-
__set_bit(xpad_btn_pad[i], input_dev->keybit);
1664+
input_set_capability(input_dev, EV_KEY,
1665+
xpad_btn_pad[i]);
16621666
}
16631667

16641668
/*
@@ -1675,7 +1679,8 @@ static int xpad_init_input(struct usb_xpad *xpad)
16751679

16761680
if (xpad->mapping & MAP_TRIGGERS_TO_BUTTONS) {
16771681
for (i = 0; xpad_btn_triggers[i] >= 0; i++)
1678-
__set_bit(xpad_btn_triggers[i], input_dev->keybit);
1682+
input_set_capability(input_dev, EV_KEY,
1683+
xpad_btn_triggers[i]);
16791684
} else {
16801685
for (i = 0; xpad_abs_triggers[i] >= 0; i++)
16811686
xpad_set_up_abs(input_dev, xpad_abs_triggers[i]);

drivers/input/keyboard/cros_ec_keyb.c

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -244,37 +244,45 @@ static int cros_ec_keyb_work(struct notifier_block *nb,
244244

245245
switch (ckdev->ec->event_data.event_type) {
246246
case EC_MKBP_EVENT_KEY_MATRIX:
247-
/*
248-
* If EC is not the wake source, discard key state changes
249-
* during suspend.
250-
*/
251-
if (queued_during_suspend)
252-
return NOTIFY_OK;
247+
if (device_may_wakeup(ckdev->dev)) {
248+
pm_wakeup_event(ckdev->dev, 0);
249+
} else {
250+
/*
251+
* If keyboard is not wake enabled, discard key state
252+
* changes during suspend. Switches will be re-checked
253+
* in cros_ec_keyb_resume() to be sure nothing is lost.
254+
*/
255+
if (queued_during_suspend)
256+
return NOTIFY_OK;
257+
}
253258

254259
if (ckdev->ec->event_size != ckdev->cols) {
255260
dev_err(ckdev->dev,
256261
"Discarded incomplete key matrix event.\n");
257262
return NOTIFY_OK;
258263
}
264+
259265
cros_ec_keyb_process(ckdev,
260266
ckdev->ec->event_data.data.key_matrix,
261267
ckdev->ec->event_size);
262268
break;
263269

264270
case EC_MKBP_EVENT_SYSRQ:
271+
if (device_may_wakeup(ckdev->dev))
272+
pm_wakeup_event(ckdev->dev, 0);
273+
else if (queued_during_suspend)
274+
return NOTIFY_OK;
275+
265276
val = get_unaligned_le32(&ckdev->ec->event_data.data.sysrq);
266277
dev_dbg(ckdev->dev, "sysrq code from EC: %#x\n", val);
267278
handle_sysrq(val);
268279
break;
269280

270281
case EC_MKBP_EVENT_BUTTON:
271282
case EC_MKBP_EVENT_SWITCH:
272-
/*
273-
* If EC is not the wake source, discard key state
274-
* changes during suspend. Switches will be re-checked in
275-
* cros_ec_keyb_resume() to be sure nothing is lost.
276-
*/
277-
if (queued_during_suspend)
283+
if (device_may_wakeup(ckdev->dev))
284+
pm_wakeup_event(ckdev->dev, 0);
285+
else if (queued_during_suspend)
278286
return NOTIFY_OK;
279287

280288
if (ckdev->ec->event_data.event_type == EC_MKBP_EVENT_BUTTON) {
@@ -639,6 +647,7 @@ static int cros_ec_keyb_probe(struct platform_device *pdev)
639647
return err;
640648
}
641649

650+
device_init_wakeup(ckdev->dev, true);
642651
return 0;
643652
}
644653

drivers/input/misc/ati_remote2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ MODULE_LICENSE("GPL");
2222
/*
2323
* ATI Remote Wonder II Channel Configuration
2424
*
25-
* The remote control can by assigned one of sixteen "channels" in order to facilitate
25+
* The remote control can be assigned one of sixteen "channels" in order to facilitate
2626
* the use of multiple remote controls within range of each other.
2727
* A remote's "channel" may be altered by pressing and holding the "PC" button for
2828
* approximately 3 seconds, after which the button will slowly flash the count of the

drivers/input/mouse/Kconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,18 @@ config MOUSE_PS2_ELANTECH
133133

134134
If unsure, say N.
135135

136+
config MOUSE_PS2_ELANTECH_SMBUS
137+
bool "Elantech PS/2 SMbus companion" if EXPERT
138+
default y
139+
depends on MOUSE_PS2 && MOUSE_PS2_ELANTECH
140+
depends on I2C=y || I2C=MOUSE_PS2
141+
select MOUSE_PS2_SMBUS
142+
help
143+
Say Y here if you have a Elantech touchpad connected to
144+
to an SMBus, but enumerated through PS/2.
145+
146+
If unsure, say Y.
147+
136148
config MOUSE_PS2_SENTELIC
137149
bool "Sentelic Finger Sensing Pad PS/2 protocol extension"
138150
depends on MOUSE_PS2

0 commit comments

Comments
 (0)