diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-09-28 21:04:50 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-09-28 21:04:50 -0400 |
commit | e704966c45e48d0220d1ee5e463034ae493a95b2 (patch) | |
tree | f97c5d85a6889dbbc3ec70420d37e109a40f9b26 /drivers/input | |
parent | 2f19e7a7e63a04f4bbaf327d9d0e69ac800b2b8f (diff) | |
parent | 4fef1250eafddc5182cd5c3c354a6971bcf7520d (diff) |
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
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/keyboard/atakbd.c | 74 | ||||
-rw-r--r-- | drivers/input/misc/uinput.c | 2 | ||||
-rw-r--r-- | drivers/input/mouse/elantech.c | 2 | ||||
-rw-r--r-- | drivers/input/touchscreen/egalax_ts.c | 6 |
4 files changed, 37 insertions, 47 deletions
diff --git a/drivers/input/keyboard/atakbd.c b/drivers/input/keyboard/atakbd.c index 6f62da2909ec..6caee807cafa 100644 --- a/drivers/input/keyboard/atakbd.c +++ b/drivers/input/keyboard/atakbd.c | |||
@@ -75,8 +75,7 @@ MODULE_LICENSE("GPL"); | |||
75 | */ | 75 | */ |
76 | 76 | ||
77 | 77 | ||
78 | static unsigned char atakbd_keycode[0x72] = { /* American layout */ | 78 | static unsigned char atakbd_keycode[0x73] = { /* American layout */ |
79 | [0] = KEY_GRAVE, | ||
80 | [1] = KEY_ESC, | 79 | [1] = KEY_ESC, |
81 | [2] = KEY_1, | 80 | [2] = KEY_1, |
82 | [3] = KEY_2, | 81 | [3] = KEY_2, |
@@ -117,9 +116,9 @@ static unsigned char atakbd_keycode[0x72] = { /* American layout */ | |||
117 | [38] = KEY_L, | 116 | [38] = KEY_L, |
118 | [39] = KEY_SEMICOLON, | 117 | [39] = KEY_SEMICOLON, |
119 | [40] = KEY_APOSTROPHE, | 118 | [40] = KEY_APOSTROPHE, |
120 | [41] = KEY_BACKSLASH, /* FIXME, '#' */ | 119 | [41] = KEY_GRAVE, |
121 | [42] = KEY_LEFTSHIFT, | 120 | [42] = KEY_LEFTSHIFT, |
122 | [43] = KEY_GRAVE, /* FIXME: '~' */ | 121 | [43] = KEY_BACKSLASH, |
123 | [44] = KEY_Z, | 122 | [44] = KEY_Z, |
124 | [45] = KEY_X, | 123 | [45] = KEY_X, |
125 | [46] = KEY_C, | 124 | [46] = KEY_C, |
@@ -145,45 +144,34 @@ static unsigned char atakbd_keycode[0x72] = { /* American layout */ | |||
145 | [66] = KEY_F8, | 144 | [66] = KEY_F8, |
146 | [67] = KEY_F9, | 145 | [67] = KEY_F9, |
147 | [68] = KEY_F10, | 146 | [68] = KEY_F10, |
148 | [69] = KEY_ESC, | 147 | [71] = KEY_HOME, |
149 | [70] = KEY_DELETE, | 148 | [72] = KEY_UP, |
150 | [71] = KEY_KP7, | ||
151 | [72] = KEY_KP8, | ||
152 | [73] = KEY_KP9, | ||
153 | [74] = KEY_KPMINUS, | 149 | [74] = KEY_KPMINUS, |
154 | [75] = KEY_KP4, | 150 | [75] = KEY_LEFT, |
155 | [76] = KEY_KP5, | 151 | [77] = KEY_RIGHT, |
156 | [77] = KEY_KP6, | ||
157 | [78] = KEY_KPPLUS, | 152 | [78] = KEY_KPPLUS, |
158 | [79] = KEY_KP1, | 153 | [80] = KEY_DOWN, |
159 | [80] = KEY_KP2, | 154 | [82] = KEY_INSERT, |
160 | [81] = KEY_KP3, | 155 | [83] = KEY_DELETE, |
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, | ||
169 | [96] = KEY_102ND, | 156 | [96] = KEY_102ND, |
170 | [97] = KEY_KPASTERISK, /* FIXME */ | 157 | [97] = KEY_UNDO, |
171 | [98] = KEY_KPSLASH, | 158 | [98] = KEY_HELP, |
172 | [99] = KEY_KPLEFTPAREN, | 159 | [99] = KEY_KPLEFTPAREN, |
173 | [100] = KEY_KPRIGHTPAREN, | 160 | [100] = KEY_KPRIGHTPAREN, |
174 | [101] = KEY_KPSLASH, | 161 | [101] = KEY_KPSLASH, |
175 | [102] = KEY_KPASTERISK, | 162 | [102] = KEY_KPASTERISK, |
176 | [103] = KEY_UP, | 163 | [103] = KEY_KP7, |
177 | [104] = KEY_KPASTERISK, /* FIXME */ | 164 | [104] = KEY_KP8, |
178 | [105] = KEY_LEFT, | 165 | [105] = KEY_KP9, |
179 | [106] = KEY_RIGHT, | 166 | [106] = KEY_KP4, |
180 | [107] = KEY_KPASTERISK, /* FIXME */ | 167 | [107] = KEY_KP5, |
181 | [108] = KEY_DOWN, | 168 | [108] = KEY_KP6, |
182 | [109] = KEY_KPASTERISK, /* FIXME */ | 169 | [109] = KEY_KP1, |
183 | [110] = KEY_KPASTERISK, /* FIXME */ | 170 | [110] = KEY_KP2, |
184 | [111] = KEY_KPASTERISK, /* FIXME */ | 171 | [111] = KEY_KP3, |
185 | [112] = KEY_KPASTERISK, /* FIXME */ | 172 | [112] = KEY_KP0, |
186 | [113] = KEY_KPASTERISK /* FIXME */ | 173 | [113] = KEY_KPDOT, |
174 | [114] = KEY_KPENTER, | ||
187 | }; | 175 | }; |
188 | 176 | ||
189 | static struct input_dev *atakbd_dev; | 177 | static struct input_dev *atakbd_dev; |
@@ -191,21 +179,15 @@ static struct input_dev *atakbd_dev; | |||
191 | static void atakbd_interrupt(unsigned char scancode, char down) | 179 | static void atakbd_interrupt(unsigned char scancode, char down) |
192 | { | 180 | { |
193 | 181 | ||
194 | if (scancode < 0x72) { /* scancodes < 0xf2 are keys */ | 182 | if (scancode < 0x73) { /* scancodes < 0xf3 are keys */ |
195 | 183 | ||
196 | // report raw events here? | 184 | // report raw events here? |
197 | 185 | ||
198 | scancode = atakbd_keycode[scancode]; | 186 | scancode = atakbd_keycode[scancode]; |
199 | 187 | ||
200 | if (scancode == KEY_CAPSLOCK) { /* CapsLock is a toggle switch key on Amiga */ | 188 | input_report_key(atakbd_dev, scancode, down); |
201 | input_report_key(atakbd_dev, scancode, 1); | 189 | input_sync(atakbd_dev); |
202 | input_report_key(atakbd_dev, scancode, 0); | 190 | } else /* scancodes >= 0xf3 are mouse data, most likely */ |
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 */ | ||
209 | printk(KERN_INFO "atakbd: unhandled scancode %x\n", scancode); | 191 | printk(KERN_INFO "atakbd: unhandled scancode %x\n", scancode); |
210 | 192 | ||
211 | return; | 193 | return; |
diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c index 96a887f33698..eb14ddf69346 100644 --- a/drivers/input/misc/uinput.c +++ b/drivers/input/misc/uinput.c | |||
@@ -410,7 +410,7 @@ static int uinput_validate_absinfo(struct input_dev *dev, unsigned int code, | |||
410 | min = abs->minimum; | 410 | min = abs->minimum; |
411 | max = abs->maximum; | 411 | max = abs->maximum; |
412 | 412 | ||
413 | if ((min != 0 || max != 0) && max <= min) { | 413 | if ((min != 0 || max != 0) && max < min) { |
414 | printk(KERN_DEBUG | 414 | printk(KERN_DEBUG |
415 | "%s: invalid abs[%02x] min:%d max:%d\n", | 415 | "%s: invalid abs[%02x] min:%d max:%d\n", |
416 | UINPUT_NAME, code, min, max); | 416 | UINPUT_NAME, code, min, max); |
diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c index 44f57cf6675b..2d95e8d93cc7 100644 --- a/drivers/input/mouse/elantech.c +++ b/drivers/input/mouse/elantech.c | |||
@@ -1178,6 +1178,8 @@ static const struct dmi_system_id elantech_dmi_has_middle_button[] = { | |||
1178 | static const char * const middle_button_pnp_ids[] = { | 1178 | static const char * const middle_button_pnp_ids[] = { |
1179 | "LEN2131", /* ThinkPad P52 w/ NFC */ | 1179 | "LEN2131", /* ThinkPad P52 w/ NFC */ |
1180 | "LEN2132", /* ThinkPad P52 */ | 1180 | "LEN2132", /* ThinkPad P52 */ |
1181 | "LEN2133", /* ThinkPad P72 w/ NFC */ | ||
1182 | "LEN2134", /* ThinkPad P72 */ | ||
1181 | NULL | 1183 | NULL |
1182 | }; | 1184 | }; |
1183 | 1185 | ||
diff --git a/drivers/input/touchscreen/egalax_ts.c b/drivers/input/touchscreen/egalax_ts.c index 80e69bb8283e..83ac8c128192 100644 --- a/drivers/input/touchscreen/egalax_ts.c +++ b/drivers/input/touchscreen/egalax_ts.c | |||
@@ -241,6 +241,9 @@ static int __maybe_unused egalax_ts_suspend(struct device *dev) | |||
241 | struct i2c_client *client = to_i2c_client(dev); | 241 | struct i2c_client *client = to_i2c_client(dev); |
242 | int ret; | 242 | int ret; |
243 | 243 | ||
244 | if (device_may_wakeup(dev)) | ||
245 | return enable_irq_wake(client->irq); | ||
246 | |||
244 | ret = i2c_master_send(client, suspend_cmd, MAX_I2C_DATA_LEN); | 247 | ret = i2c_master_send(client, suspend_cmd, MAX_I2C_DATA_LEN); |
245 | return ret > 0 ? 0 : ret; | 248 | return ret > 0 ? 0 : ret; |
246 | } | 249 | } |
@@ -249,6 +252,9 @@ static int __maybe_unused egalax_ts_resume(struct device *dev) | |||
249 | { | 252 | { |
250 | struct i2c_client *client = to_i2c_client(dev); | 253 | struct i2c_client *client = to_i2c_client(dev); |
251 | 254 | ||
255 | if (device_may_wakeup(dev)) | ||
256 | return disable_irq_wake(client->irq); | ||
257 | |||
252 | return egalax_wake_up_device(client); | 258 | return egalax_wake_up_device(client); |
253 | } | 259 | } |
254 | 260 | ||