Skip to content

Commit e704966

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Dmitry writes: "Input updates for v4.19-rc5 Just a few driver fixes" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: uinput - allow for max == min during input_absinfo validation Input: elantech - enable middle button of touchpad on ThinkPad P72 Input: atakbd - fix Atari CapsLock behaviour Input: atakbd - fix Atari keymap Input: egalax_ts - add system wakeup support Input: gpio-keys - fix a documentation index issue
2 parents 2f19e7a + 4fef125 commit e704966

File tree

5 files changed

+38
-48
lines changed

5 files changed

+38
-48
lines changed

Documentation/devicetree/bindings/input/gpio-keys.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Device-Tree bindings for input/gpio_keys.c keyboard driver
1+
Device-Tree bindings for input/keyboard/gpio_keys.c keyboard driver
22

33
Required properties:
44
- compatible = "gpio-keys";

drivers/input/keyboard/atakbd.c

Lines changed: 28 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ MODULE_LICENSE("GPL");
7575
*/
7676

7777

78-
static unsigned char atakbd_keycode[0x72] = { /* American layout */
79-
[0] = KEY_GRAVE,
78+
static unsigned char atakbd_keycode[0x73] = { /* American layout */
8079
[1] = KEY_ESC,
8180
[2] = KEY_1,
8281
[3] = KEY_2,
@@ -117,9 +116,9 @@ static unsigned char atakbd_keycode[0x72] = { /* American layout */
117116
[38] = KEY_L,
118117
[39] = KEY_SEMICOLON,
119118
[40] = KEY_APOSTROPHE,
120-
[41] = KEY_BACKSLASH, /* FIXME, '#' */
119+
[41] = KEY_GRAVE,
121120
[42] = KEY_LEFTSHIFT,
122-
[43] = KEY_GRAVE, /* FIXME: '~' */
121+
[43] = KEY_BACKSLASH,
123122
[44] = KEY_Z,
124123
[45] = KEY_X,
125124
[46] = KEY_C,
@@ -145,67 +144,50 @@ static unsigned char atakbd_keycode[0x72] = { /* American layout */
145144
[66] = KEY_F8,
146145
[67] = KEY_F9,
147146
[68] = KEY_F10,
148-
[69] = KEY_ESC,
149-
[70] = KEY_DELETE,
150-
[71] = KEY_KP7,
151-
[72] = KEY_KP8,
152-
[73] = KEY_KP9,
147+
[71] = KEY_HOME,
148+
[72] = KEY_UP,
153149
[74] = KEY_KPMINUS,
154-
[75] = KEY_KP4,
155-
[76] = KEY_KP5,
156-
[77] = KEY_KP6,
150+
[75] = KEY_LEFT,
151+
[77] = KEY_RIGHT,
157152
[78] = KEY_KPPLUS,
158-
[79] = KEY_KP1,
159-
[80] = KEY_KP2,
160-
[81] = KEY_KP3,
161-
[82] = KEY_KP0,
162-
[83] = KEY_KPDOT,
163-
[90] = KEY_KPLEFTPAREN,
164-
[91] = KEY_KPRIGHTPAREN,
165-
[92] = KEY_KPASTERISK, /* FIXME */
166-
[93] = KEY_KPASTERISK,
167-
[94] = KEY_KPPLUS,
168-
[95] = KEY_HELP,
153+
[80] = KEY_DOWN,
154+
[82] = KEY_INSERT,
155+
[83] = KEY_DELETE,
169156
[96] = KEY_102ND,
170-
[97] = KEY_KPASTERISK, /* FIXME */
171-
[98] = KEY_KPSLASH,
157+
[97] = KEY_UNDO,
158+
[98] = KEY_HELP,
172159
[99] = KEY_KPLEFTPAREN,
173160
[100] = KEY_KPRIGHTPAREN,
174161
[101] = KEY_KPSLASH,
175162
[102] = KEY_KPASTERISK,
176-
[103] = KEY_UP,
177-
[104] = KEY_KPASTERISK, /* FIXME */
178-
[105] = KEY_LEFT,
179-
[106] = KEY_RIGHT,
180-
[107] = KEY_KPASTERISK, /* FIXME */
181-
[108] = KEY_DOWN,
182-
[109] = KEY_KPASTERISK, /* FIXME */
183-
[110] = KEY_KPASTERISK, /* FIXME */
184-
[111] = KEY_KPASTERISK, /* FIXME */
185-
[112] = KEY_KPASTERISK, /* FIXME */
186-
[113] = KEY_KPASTERISK /* FIXME */
163+
[103] = KEY_KP7,
164+
[104] = KEY_KP8,
165+
[105] = KEY_KP9,
166+
[106] = KEY_KP4,
167+
[107] = KEY_KP5,
168+
[108] = KEY_KP6,
169+
[109] = KEY_KP1,
170+
[110] = KEY_KP2,
171+
[111] = KEY_KP3,
172+
[112] = KEY_KP0,
173+
[113] = KEY_KPDOT,
174+
[114] = KEY_KPENTER,
187175
};
188176

189177
static struct input_dev *atakbd_dev;
190178

191179
static void atakbd_interrupt(unsigned char scancode, char down)
192180
{
193181

194-
if (scancode < 0x72) { /* scancodes < 0xf2 are keys */
182+
if (scancode < 0x73) { /* scancodes < 0xf3 are keys */
195183

196184
// report raw events here?
197185

198186
scancode = atakbd_keycode[scancode];
199187

200-
if (scancode == KEY_CAPSLOCK) { /* CapsLock is a toggle switch key on Amiga */
201-
input_report_key(atakbd_dev, scancode, 1);
202-
input_report_key(atakbd_dev, scancode, 0);
203-
input_sync(atakbd_dev);
204-
} else {
205-
input_report_key(atakbd_dev, scancode, down);
206-
input_sync(atakbd_dev);
207-
}
208-
} else /* scancodes >= 0xf2 are mouse data, most likely */
188+
input_report_key(atakbd_dev, scancode, down);
189+
input_sync(atakbd_dev);
190+
} else /* scancodes >= 0xf3 are mouse data, most likely */
209191
printk(KERN_INFO "atakbd: unhandled scancode %x\n", scancode);
210192

211193
return;

drivers/input/misc/uinput.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ static int uinput_validate_absinfo(struct input_dev *dev, unsigned int code,
410410
min = abs->minimum;
411411
max = abs->maximum;
412412

413-
if ((min != 0 || max != 0) && max <= min) {
413+
if ((min != 0 || max != 0) && max < min) {
414414
printk(KERN_DEBUG
415415
"%s: invalid abs[%02x] min:%d max:%d\n",
416416
UINPUT_NAME, code, min, max);

drivers/input/mouse/elantech.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,6 +1178,8 @@ static const struct dmi_system_id elantech_dmi_has_middle_button[] = {
11781178
static const char * const middle_button_pnp_ids[] = {
11791179
"LEN2131", /* ThinkPad P52 w/ NFC */
11801180
"LEN2132", /* ThinkPad P52 */
1181+
"LEN2133", /* ThinkPad P72 w/ NFC */
1182+
"LEN2134", /* ThinkPad P72 */
11811183
NULL
11821184
};
11831185

drivers/input/touchscreen/egalax_ts.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,9 @@ static int __maybe_unused egalax_ts_suspend(struct device *dev)
241241
struct i2c_client *client = to_i2c_client(dev);
242242
int ret;
243243

244+
if (device_may_wakeup(dev))
245+
return enable_irq_wake(client->irq);
246+
244247
ret = i2c_master_send(client, suspend_cmd, MAX_I2C_DATA_LEN);
245248
return ret > 0 ? 0 : ret;
246249
}
@@ -249,6 +252,9 @@ static int __maybe_unused egalax_ts_resume(struct device *dev)
249252
{
250253
struct i2c_client *client = to_i2c_client(dev);
251254

255+
if (device_may_wakeup(dev))
256+
return disable_irq_wake(client->irq);
257+
252258
return egalax_wake_up_device(client);
253259
}
254260

0 commit comments

Comments
 (0)