Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
Input: i8042 - add Lenovo Ideapad U455 to 'reset' blacklist
Input: serio_raw - return proper result when serio_raw_read fails
Input: document device properties
Input: twl4030_keypad - fix comment (trivial)
Input: gpio_keys - fix struct device declared inside parameter list
Input: evdev - fix variable initialisation

+84 -18
+64 -8
Documentation/input/event-codes.txt
··· 17 17 class/input/event*/device/capabilities/, and the properties of a device are 18 18 provided in class/input/event*/device/properties. 19 19 20 - Types: 21 - ========== 22 - Types are groupings of codes under a logical input construct. Each type has a 23 - set of applicable codes to be used in generating events. See the Codes section 24 - for details on valid codes for each type. 20 + Event types: 21 + =========== 22 + Event types are groupings of codes under a logical input construct. Each 23 + type has a set of applicable codes to be used in generating events. See the 24 + Codes section for details on valid codes for each type. 25 25 26 26 * EV_SYN: 27 27 - Used as markers to separate events. Events may be separated in time or in ··· 63 63 * EV_FF_STATUS: 64 64 - Used to receive force feedback device status. 65 65 66 - Codes: 67 - ========== 68 - Codes define the precise type of event. 66 + Event codes: 67 + =========== 68 + Event codes define the precise type of event. 69 69 70 70 EV_SYN: 71 71 ---------- ··· 220 220 EV_PWR events are a special type of event used specifically for power 221 221 mangement. Its usage is not well defined. To be addressed later. 222 222 223 + Device properties: 224 + ================= 225 + Normally, userspace sets up an input device based on the data it emits, 226 + i.e., the event types. In the case of two devices emitting the same event 227 + types, additional information can be provided in the form of device 228 + properties. 229 + 230 + INPUT_PROP_DIRECT + INPUT_PROP_POINTER: 231 + -------------------------------------- 232 + The INPUT_PROP_DIRECT property indicates that device coordinates should be 233 + directly mapped to screen coordinates (not taking into account trivial 234 + transformations, such as scaling, flipping and rotating). Non-direct input 235 + devices require non-trivial transformation, such as absolute to relative 236 + transformation for touchpads. Typical direct input devices: touchscreens, 237 + drawing tablets; non-direct devices: touchpads, mice. 238 + 239 + The INPUT_PROP_POINTER property indicates that the device is not transposed 240 + on the screen and thus requires use of an on-screen pointer to trace user's 241 + movements. Typical pointer devices: touchpads, tablets, mice; non-pointer 242 + device: touchscreen. 243 + 244 + If neither INPUT_PROP_DIRECT or INPUT_PROP_POINTER are set, the property is 245 + considered undefined and the device type should be deduced in the 246 + traditional way, using emitted event types. 247 + 248 + INPUT_PROP_BUTTONPAD: 249 + -------------------- 250 + For touchpads where the button is placed beneath the surface, such that 251 + pressing down on the pad causes a button click, this property should be 252 + set. Common in clickpad notebooks and macbooks from 2009 and onwards. 253 + 254 + Originally, the buttonpad property was coded into the bcm5974 driver 255 + version field under the name integrated button. For backwards 256 + compatibility, both methods need to be checked in userspace. 257 + 258 + INPUT_PROP_SEMI_MT: 259 + ------------------ 260 + Some touchpads, most common between 2008 and 2011, can detect the presence 261 + of multiple contacts without resolving the individual positions; only the 262 + number of contacts and a rectangular shape is known. For such 263 + touchpads, the semi-mt property should be set. 264 + 265 + Depending on the device, the rectangle may enclose all touches, like a 266 + bounding box, or just some of them, for instance the two most recent 267 + touches. The diversity makes the rectangle of limited use, but some 268 + gestures can normally be extracted from it. 269 + 270 + If INPUT_PROP_SEMI_MT is not set, the device is assumed to be a true MT 271 + device. 272 + 223 273 Guidelines: 224 274 ========== 225 275 The guidelines below ensure proper single-touch and multi-finger functionality. ··· 290 240 BTN_{MOUSE,LEFT,MIDDLE,RIGHT} must not be reported as the result of touch 291 241 contact. BTN_TOOL_<name> events should be reported where possible. 292 242 243 + For new hardware, INPUT_PROP_DIRECT should be set. 244 + 293 245 Trackpads: 294 246 ---------- 295 247 Legacy trackpads that only provide relative position information must report ··· 301 249 location of the touch. BTN_TOUCH should be used to report when a touch is active 302 250 on the trackpad. Where multi-finger support is available, BTN_TOOL_<name> should 303 251 be used to report the number of touches active on the trackpad. 252 + 253 + For new hardware, INPUT_PROP_POINTER should be set. 304 254 305 255 Tablets: 306 256 ---------- ··· 314 260 BTN_{0,1,2,etc} are good generic codes for unlabeled buttons. Do not use 315 261 meaningful buttons, like BTN_FORWARD, unless the button is labeled for that 316 262 purpose on the device. 263 + 264 + For new hardware, both INPUT_PROP_DIRECT and INPUT_PROP_POINTER should be set.
+1 -1
drivers/input/evdev.c
··· 386 386 struct evdev_client *client = file->private_data; 387 387 struct evdev *evdev = client->evdev; 388 388 struct input_event event; 389 - int retval; 389 + int retval = 0; 390 390 391 391 if (count < input_event_size()) 392 392 return -EINVAL;
+1 -3
drivers/input/keyboard/twl4030_keypad.c
··· 34 34 #include <linux/i2c/twl.h> 35 35 #include <linux/slab.h> 36 36 37 - 38 37 /* 39 38 * The TWL4030 family chips include a keypad controller that supports 40 39 * up to an 8x8 switch matrix. The controller can issue system wakeup ··· 301 302 if (twl4030_kpwrite_u8(kp, i, KEYP_DEB) < 0) 302 303 return -EIO; 303 304 304 - /* Set timeout period to 100 ms */ 305 + /* Set timeout period to 200 ms */ 305 306 i = KEYP_PERIOD_US(200000, PTV_PRESCALER); 306 307 if (twl4030_kpwrite_u8(kp, (i & 0xFF), KEYP_TIMEOUT_L) < 0) 307 308 return -EIO; ··· 465 466 MODULE_DESCRIPTION("TWL4030 Keypad Driver"); 466 467 MODULE_LICENSE("GPL"); 467 468 MODULE_ALIAS("platform:twl4030_keypad"); 468 -
+7
drivers/input/serio/i8042-x86ia64io.h
··· 512 512 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1720"), 513 513 }, 514 514 }, 515 + { 516 + /* Lenovo Ideapad U455 */ 517 + .matches = { 518 + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 519 + DMI_MATCH(DMI_PRODUCT_NAME, "20046"), 520 + }, 521 + }, 515 522 { } 516 523 }; 517 524
+9 -6
drivers/input/serio/serio_raw.c
··· 164 164 struct serio_raw_client *client = file->private_data; 165 165 struct serio_raw *serio_raw = client->serio_raw; 166 166 char uninitialized_var(c); 167 - ssize_t retval = 0; 167 + ssize_t read = 0; 168 + int retval; 168 169 169 170 if (serio_raw->dead) 170 171 return -ENODEV; ··· 181 180 if (serio_raw->dead) 182 181 return -ENODEV; 183 182 184 - while (retval < count && serio_raw_fetch_byte(serio_raw, &c)) { 185 - if (put_user(c, buffer++)) 186 - return -EFAULT; 187 - retval++; 183 + while (read < count && serio_raw_fetch_byte(serio_raw, &c)) { 184 + if (put_user(c, buffer++)) { 185 + retval = -EFAULT; 186 + break; 187 + } 188 + read++; 188 189 } 189 190 190 - return retval; 191 + return read ?: retval; 191 192 } 192 193 193 194 static ssize_t serio_raw_write(struct file *file, const char __user *buffer,
+2
include/linux/gpio_keys.h
··· 1 1 #ifndef _GPIO_KEYS_H 2 2 #define _GPIO_KEYS_H 3 3 4 + struct device; 5 + 4 6 struct gpio_keys_button { 5 7 /* Configuration parameters */ 6 8 unsigned int code; /* input event code (KEY_*, SW_*) */