diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-02-04 13:57:42 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-02-04 13:57:42 -0500 |
| commit | 31c150a11c867da233a7b5e13b45bcbd3a796bde (patch) | |
| tree | 58202fc8e93833f3ea3e52f9cb0093e61265d73d | |
| parent | 4554c135a0a017f4cd96f7c0612cb7ca78c68d08 (diff) | |
| parent | 82b982c9a697e7be0745523a53334fe38a4582c8 (diff) | |
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
| -rw-r--r-- | Documentation/input/event-codes.txt | 72 | ||||
| -rw-r--r-- | drivers/input/evdev.c | 2 | ||||
| -rw-r--r-- | drivers/input/keyboard/twl4030_keypad.c | 4 | ||||
| -rw-r--r-- | drivers/input/serio/i8042-x86ia64io.h | 7 | ||||
| -rw-r--r-- | drivers/input/serio/serio_raw.c | 15 | ||||
| -rw-r--r-- | include/linux/gpio_keys.h | 2 |
6 files changed, 84 insertions, 18 deletions
diff --git a/Documentation/input/event-codes.txt b/Documentation/input/event-codes.txt index 23fcb05175be..53305bd08182 100644 --- a/Documentation/input/event-codes.txt +++ b/Documentation/input/event-codes.txt | |||
| @@ -17,11 +17,11 @@ reports supported by a device are also provided by sysfs in | |||
| 17 | class/input/event*/device/capabilities/, and the properties of a device are | 17 | class/input/event*/device/capabilities/, and the properties of a device are |
| 18 | provided in class/input/event*/device/properties. | 18 | provided in class/input/event*/device/properties. |
| 19 | 19 | ||
| 20 | Types: | 20 | Event types: |
| 21 | ========== | 21 | =========== |
| 22 | Types are groupings of codes under a logical input construct. Each type has a | 22 | Event types are groupings of codes under a logical input construct. Each |
| 23 | set of applicable codes to be used in generating events. See the Codes section | 23 | type has a set of applicable codes to be used in generating events. See the |
| 24 | for details on valid codes for each type. | 24 | Codes section for details on valid codes for each type. |
| 25 | 25 | ||
| 26 | * EV_SYN: | 26 | * EV_SYN: |
| 27 | - Used as markers to separate events. Events may be separated in time or in | 27 | - Used as markers to separate events. Events may be separated in time or in |
| @@ -63,9 +63,9 @@ for details on valid codes for each type. | |||
| 63 | * EV_FF_STATUS: | 63 | * EV_FF_STATUS: |
| 64 | - Used to receive force feedback device status. | 64 | - Used to receive force feedback device status. |
| 65 | 65 | ||
| 66 | Codes: | 66 | Event codes: |
| 67 | ========== | 67 | =========== |
| 68 | Codes define the precise type of event. | 68 | Event codes define the precise type of event. |
| 69 | 69 | ||
| 70 | EV_SYN: | 70 | EV_SYN: |
| 71 | ---------- | 71 | ---------- |
| @@ -220,6 +220,56 @@ EV_PWR: | |||
| 220 | EV_PWR events are a special type of event used specifically for power | 220 | EV_PWR events are a special type of event used specifically for power |
| 221 | mangement. Its usage is not well defined. To be addressed later. | 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 | Guidelines: | 273 | Guidelines: |
| 224 | ========== | 274 | ========== |
| 225 | The guidelines below ensure proper single-touch and multi-finger functionality. | 275 | The guidelines below ensure proper single-touch and multi-finger functionality. |
| @@ -240,6 +290,8 @@ used to report when a touch is active on the screen. | |||
| 240 | BTN_{MOUSE,LEFT,MIDDLE,RIGHT} must not be reported as the result of touch | 290 | BTN_{MOUSE,LEFT,MIDDLE,RIGHT} must not be reported as the result of touch |
| 241 | contact. BTN_TOOL_<name> events should be reported where possible. | 291 | contact. BTN_TOOL_<name> events should be reported where possible. |
| 242 | 292 | ||
| 293 | For new hardware, INPUT_PROP_DIRECT should be set. | ||
| 294 | |||
| 243 | Trackpads: | 295 | Trackpads: |
| 244 | ---------- | 296 | ---------- |
| 245 | Legacy trackpads that only provide relative position information must report | 297 | Legacy trackpads that only provide relative position information must report |
| @@ -250,6 +302,8 @@ location of the touch. BTN_TOUCH should be used to report when a touch is active | |||
| 250 | on the trackpad. Where multi-finger support is available, BTN_TOOL_<name> should | 302 | on the trackpad. Where multi-finger support is available, BTN_TOOL_<name> should |
| 251 | be used to report the number of touches active on the trackpad. | 303 | be used to report the number of touches active on the trackpad. |
| 252 | 304 | ||
| 305 | For new hardware, INPUT_PROP_POINTER should be set. | ||
| 306 | |||
| 253 | Tablets: | 307 | Tablets: |
| 254 | ---------- | 308 | ---------- |
| 255 | BTN_TOOL_<name> events must be reported when a stylus or other tool is active on | 309 | BTN_TOOL_<name> events must be reported when a stylus or other tool is active on |
| @@ -260,3 +314,5 @@ button may be used for buttons on the tablet except BTN_{MOUSE,LEFT}. | |||
| 260 | BTN_{0,1,2,etc} are good generic codes for unlabeled buttons. Do not use | 314 | BTN_{0,1,2,etc} are good generic codes for unlabeled buttons. Do not use |
| 261 | meaningful buttons, like BTN_FORWARD, unless the button is labeled for that | 315 | meaningful buttons, like BTN_FORWARD, unless the button is labeled for that |
| 262 | purpose on the device. | 316 | purpose on the device. |
| 317 | |||
| 318 | For new hardware, both INPUT_PROP_DIRECT and INPUT_PROP_POINTER should be set. | ||
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index 76457d50bc34..afc166fcc3d9 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c | |||
| @@ -386,7 +386,7 @@ static ssize_t evdev_read(struct file *file, char __user *buffer, | |||
| 386 | struct evdev_client *client = file->private_data; | 386 | struct evdev_client *client = file->private_data; |
| 387 | struct evdev *evdev = client->evdev; | 387 | struct evdev *evdev = client->evdev; |
| 388 | struct input_event event; | 388 | struct input_event event; |
| 389 | int retval; | 389 | int retval = 0; |
| 390 | 390 | ||
| 391 | if (count < input_event_size()) | 391 | if (count < input_event_size()) |
| 392 | return -EINVAL; | 392 | return -EINVAL; |
diff --git a/drivers/input/keyboard/twl4030_keypad.c b/drivers/input/keyboard/twl4030_keypad.c index a588578037eb..67bec14e8b96 100644 --- a/drivers/input/keyboard/twl4030_keypad.c +++ b/drivers/input/keyboard/twl4030_keypad.c | |||
| @@ -34,7 +34,6 @@ | |||
| 34 | #include <linux/i2c/twl.h> | 34 | #include <linux/i2c/twl.h> |
| 35 | #include <linux/slab.h> | 35 | #include <linux/slab.h> |
| 36 | 36 | ||
| 37 | |||
| 38 | /* | 37 | /* |
| 39 | * The TWL4030 family chips include a keypad controller that supports | 38 | * The TWL4030 family chips include a keypad controller that supports |
| 40 | * up to an 8x8 switch matrix. The controller can issue system wakeup | 39 | * up to an 8x8 switch matrix. The controller can issue system wakeup |
| @@ -302,7 +301,7 @@ static int __devinit twl4030_kp_program(struct twl4030_keypad *kp) | |||
| 302 | if (twl4030_kpwrite_u8(kp, i, KEYP_DEB) < 0) | 301 | if (twl4030_kpwrite_u8(kp, i, KEYP_DEB) < 0) |
| 303 | return -EIO; | 302 | return -EIO; |
| 304 | 303 | ||
| 305 | /* Set timeout period to 100 ms */ | 304 | /* Set timeout period to 200 ms */ |
| 306 | i = KEYP_PERIOD_US(200000, PTV_PRESCALER); | 305 | i = KEYP_PERIOD_US(200000, PTV_PRESCALER); |
| 307 | if (twl4030_kpwrite_u8(kp, (i & 0xFF), KEYP_TIMEOUT_L) < 0) | 306 | if (twl4030_kpwrite_u8(kp, (i & 0xFF), KEYP_TIMEOUT_L) < 0) |
| 308 | return -EIO; | 307 | return -EIO; |
| @@ -466,4 +465,3 @@ MODULE_AUTHOR("Texas Instruments"); | |||
| 466 | MODULE_DESCRIPTION("TWL4030 Keypad Driver"); | 465 | MODULE_DESCRIPTION("TWL4030 Keypad Driver"); |
| 467 | MODULE_LICENSE("GPL"); | 466 | MODULE_LICENSE("GPL"); |
| 468 | MODULE_ALIAS("platform:twl4030_keypad"); | 467 | MODULE_ALIAS("platform:twl4030_keypad"); |
| 469 | |||
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h index b4cfc6c8be89..5ec774d6c82b 100644 --- a/drivers/input/serio/i8042-x86ia64io.h +++ b/drivers/input/serio/i8042-x86ia64io.h | |||
| @@ -512,6 +512,13 @@ static const struct dmi_system_id __initconst i8042_dmi_reset_table[] = { | |||
| 512 | DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1720"), | 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 | ||
diff --git a/drivers/input/serio/serio_raw.c b/drivers/input/serio/serio_raw.c index 8250299fd64f..4494233d331a 100644 --- a/drivers/input/serio/serio_raw.c +++ b/drivers/input/serio/serio_raw.c | |||
| @@ -164,7 +164,8 @@ static ssize_t serio_raw_read(struct file *file, char __user *buffer, | |||
| 164 | struct serio_raw_client *client = file->private_data; | 164 | struct serio_raw_client *client = file->private_data; |
| 165 | struct serio_raw *serio_raw = client->serio_raw; | 165 | struct serio_raw *serio_raw = client->serio_raw; |
| 166 | char uninitialized_var(c); | 166 | char uninitialized_var(c); |
| 167 | ssize_t retval = 0; | 167 | ssize_t read = 0; |
| 168 | int retval; | ||
| 168 | 169 | ||
| 169 | if (serio_raw->dead) | 170 | if (serio_raw->dead) |
| 170 | return -ENODEV; | 171 | return -ENODEV; |
| @@ -180,13 +181,15 @@ static ssize_t serio_raw_read(struct file *file, char __user *buffer, | |||
| 180 | if (serio_raw->dead) | 181 | if (serio_raw->dead) |
| 181 | return -ENODEV; | 182 | return -ENODEV; |
| 182 | 183 | ||
| 183 | while (retval < count && serio_raw_fetch_byte(serio_raw, &c)) { | 184 | while (read < count && serio_raw_fetch_byte(serio_raw, &c)) { |
| 184 | if (put_user(c, buffer++)) | 185 | if (put_user(c, buffer++)) { |
| 185 | return -EFAULT; | 186 | retval = -EFAULT; |
| 186 | retval++; | 187 | break; |
| 188 | } | ||
| 189 | read++; | ||
| 187 | } | 190 | } |
| 188 | 191 | ||
| 189 | return retval; | 192 | return read ?: retval; |
| 190 | } | 193 | } |
| 191 | 194 | ||
| 192 | static ssize_t serio_raw_write(struct file *file, const char __user *buffer, | 195 | static ssize_t serio_raw_write(struct file *file, const char __user *buffer, |
diff --git a/include/linux/gpio_keys.h b/include/linux/gpio_keys.h index b5ca4b2c08ec..004ff33ab38e 100644 --- a/include/linux/gpio_keys.h +++ b/include/linux/gpio_keys.h | |||
| @@ -1,6 +1,8 @@ | |||
| 1 | #ifndef _GPIO_KEYS_H | 1 | #ifndef _GPIO_KEYS_H |
| 2 | #define _GPIO_KEYS_H | 2 | #define _GPIO_KEYS_H |
| 3 | 3 | ||
| 4 | struct device; | ||
| 5 | |||
| 4 | struct gpio_keys_button { | 6 | struct gpio_keys_button { |
| 5 | /* Configuration parameters */ | 7 | /* Configuration parameters */ |
| 6 | unsigned int code; /* input event code (KEY_*, SW_*) */ | 8 | unsigned int code; /* input event code (KEY_*, SW_*) */ |
