diff options
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/input/input.c | 87 | ||||
| -rw-r--r-- | drivers/input/keyboard/adp5588-keys.c | 74 | ||||
| -rw-r--r-- | drivers/input/keyboard/atkbd.c | 12 | ||||
| -rw-r--r-- | drivers/input/misc/pcf8574_keypad.c | 23 | ||||
| -rw-r--r-- | drivers/input/serio/i8042-x86ia64io.h | 11 | ||||
| -rw-r--r-- | drivers/input/tablet/acecad.c | 3 | ||||
| -rw-r--r-- | drivers/serial/kgdboc.c | 59 |
7 files changed, 179 insertions, 90 deletions
diff --git a/drivers/input/input.c b/drivers/input/input.c index d092ef9291da..7f26ca6ecf75 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c | |||
| @@ -74,6 +74,7 @@ static int input_defuzz_abs_event(int value, int old_val, int fuzz) | |||
| 74 | * dev->event_lock held and interrupts disabled. | 74 | * dev->event_lock held and interrupts disabled. |
| 75 | */ | 75 | */ |
| 76 | static void input_pass_event(struct input_dev *dev, | 76 | static void input_pass_event(struct input_dev *dev, |
| 77 | struct input_handler *src_handler, | ||
| 77 | unsigned int type, unsigned int code, int value) | 78 | unsigned int type, unsigned int code, int value) |
| 78 | { | 79 | { |
| 79 | struct input_handler *handler; | 80 | struct input_handler *handler; |
| @@ -92,6 +93,15 @@ static void input_pass_event(struct input_dev *dev, | |||
| 92 | continue; | 93 | continue; |
| 93 | 94 | ||
| 94 | handler = handle->handler; | 95 | handler = handle->handler; |
| 96 | |||
| 97 | /* | ||
| 98 | * If this is the handler that injected this | ||
| 99 | * particular event we want to skip it to avoid | ||
| 100 | * filters firing again and again. | ||
| 101 | */ | ||
| 102 | if (handler == src_handler) | ||
| 103 | continue; | ||
| 104 | |||
| 95 | if (!handler->filter) { | 105 | if (!handler->filter) { |
| 96 | if (filtered) | 106 | if (filtered) |
| 97 | break; | 107 | break; |
| @@ -121,7 +131,7 @@ static void input_repeat_key(unsigned long data) | |||
| 121 | if (test_bit(dev->repeat_key, dev->key) && | 131 | if (test_bit(dev->repeat_key, dev->key) && |
| 122 | is_event_supported(dev->repeat_key, dev->keybit, KEY_MAX)) { | 132 | is_event_supported(dev->repeat_key, dev->keybit, KEY_MAX)) { |
| 123 | 133 | ||
| 124 | input_pass_event(dev, EV_KEY, dev->repeat_key, 2); | 134 | input_pass_event(dev, NULL, EV_KEY, dev->repeat_key, 2); |
| 125 | 135 | ||
| 126 | if (dev->sync) { | 136 | if (dev->sync) { |
| 127 | /* | 137 | /* |
| @@ -130,7 +140,7 @@ static void input_repeat_key(unsigned long data) | |||
| 130 | * Otherwise assume that the driver will send | 140 | * Otherwise assume that the driver will send |
| 131 | * SYN_REPORT once it's done. | 141 | * SYN_REPORT once it's done. |
| 132 | */ | 142 | */ |
| 133 | input_pass_event(dev, EV_SYN, SYN_REPORT, 1); | 143 | input_pass_event(dev, NULL, EV_SYN, SYN_REPORT, 1); |
| 134 | } | 144 | } |
| 135 | 145 | ||
| 136 | if (dev->rep[REP_PERIOD]) | 146 | if (dev->rep[REP_PERIOD]) |
| @@ -163,6 +173,7 @@ static void input_stop_autorepeat(struct input_dev *dev) | |||
| 163 | #define INPUT_PASS_TO_ALL (INPUT_PASS_TO_HANDLERS | INPUT_PASS_TO_DEVICE) | 173 | #define INPUT_PASS_TO_ALL (INPUT_PASS_TO_HANDLERS | INPUT_PASS_TO_DEVICE) |
| 164 | 174 | ||
| 165 | static int input_handle_abs_event(struct input_dev *dev, | 175 | static int input_handle_abs_event(struct input_dev *dev, |
| 176 | struct input_handler *src_handler, | ||
| 166 | unsigned int code, int *pval) | 177 | unsigned int code, int *pval) |
| 167 | { | 178 | { |
| 168 | bool is_mt_event; | 179 | bool is_mt_event; |
| @@ -206,13 +217,15 @@ static int input_handle_abs_event(struct input_dev *dev, | |||
| 206 | /* Flush pending "slot" event */ | 217 | /* Flush pending "slot" event */ |
| 207 | if (is_mt_event && dev->slot != input_abs_get_val(dev, ABS_MT_SLOT)) { | 218 | if (is_mt_event && dev->slot != input_abs_get_val(dev, ABS_MT_SLOT)) { |
| 208 | input_abs_set_val(dev, ABS_MT_SLOT, dev->slot); | 219 | input_abs_set_val(dev, ABS_MT_SLOT, dev->slot); |
| 209 | input_pass_event(dev, EV_ABS, ABS_MT_SLOT, dev->slot); | 220 | input_pass_event(dev, src_handler, |
| 221 | EV_ABS, ABS_MT_SLOT, dev->slot); | ||
| 210 | } | 222 | } |
| 211 | 223 | ||
| 212 | return INPUT_PASS_TO_HANDLERS; | 224 | return INPUT_PASS_TO_HANDLERS; |
| 213 | } | 225 | } |
| 214 | 226 | ||
| 215 | static void input_handle_event(struct input_dev *dev, | 227 | static void input_handle_event(struct input_dev *dev, |
| 228 | struct input_handler *src_handler, | ||
| 216 | unsigned int type, unsigned int code, int value) | 229 | unsigned int type, unsigned int code, int value) |
| 217 | { | 230 | { |
| 218 | int disposition = INPUT_IGNORE_EVENT; | 231 | int disposition = INPUT_IGNORE_EVENT; |
| @@ -265,7 +278,8 @@ static void input_handle_event(struct input_dev *dev, | |||
| 265 | 278 | ||
| 266 | case EV_ABS: | 279 | case EV_ABS: |
| 267 | if (is_event_supported(code, dev->absbit, ABS_MAX)) | 280 | if (is_event_supported(code, dev->absbit, ABS_MAX)) |
| 268 | disposition = input_handle_abs_event(dev, code, &value); | 281 | disposition = input_handle_abs_event(dev, src_handler, |
| 282 | code, &value); | ||
| 269 | 283 | ||
| 270 | break; | 284 | break; |
| 271 | 285 | ||
| @@ -323,7 +337,7 @@ static void input_handle_event(struct input_dev *dev, | |||
| 323 | dev->event(dev, type, code, value); | 337 | dev->event(dev, type, code, value); |
| 324 | 338 | ||
| 325 | if (disposition & INPUT_PASS_TO_HANDLERS) | 339 | if (disposition & INPUT_PASS_TO_HANDLERS) |
| 326 | input_pass_event(dev, type, code, value); | 340 | input_pass_event(dev, src_handler, type, code, value); |
| 327 | } | 341 | } |
| 328 | 342 | ||
| 329 | /** | 343 | /** |
| @@ -352,7 +366,7 @@ void input_event(struct input_dev *dev, | |||
| 352 | 366 | ||
| 353 | spin_lock_irqsave(&dev->event_lock, flags); | 367 | spin_lock_irqsave(&dev->event_lock, flags); |
| 354 | add_input_randomness(type, code, value); | 368 | add_input_randomness(type, code, value); |
| 355 | input_handle_event(dev, type, code, value); | 369 | input_handle_event(dev, NULL, type, code, value); |
| 356 | spin_unlock_irqrestore(&dev->event_lock, flags); | 370 | spin_unlock_irqrestore(&dev->event_lock, flags); |
| 357 | } | 371 | } |
| 358 | } | 372 | } |
| @@ -382,7 +396,8 @@ void input_inject_event(struct input_handle *handle, | |||
| 382 | rcu_read_lock(); | 396 | rcu_read_lock(); |
| 383 | grab = rcu_dereference(dev->grab); | 397 | grab = rcu_dereference(dev->grab); |
| 384 | if (!grab || grab == handle) | 398 | if (!grab || grab == handle) |
| 385 | input_handle_event(dev, type, code, value); | 399 | input_handle_event(dev, handle->handler, |
| 400 | type, code, value); | ||
| 386 | rcu_read_unlock(); | 401 | rcu_read_unlock(); |
| 387 | 402 | ||
| 388 | spin_unlock_irqrestore(&dev->event_lock, flags); | 403 | spin_unlock_irqrestore(&dev->event_lock, flags); |
| @@ -595,10 +610,10 @@ static void input_dev_release_keys(struct input_dev *dev) | |||
| 595 | for (code = 0; code <= KEY_MAX; code++) { | 610 | for (code = 0; code <= KEY_MAX; code++) { |
| 596 | if (is_event_supported(code, dev->keybit, KEY_MAX) && | 611 | if (is_event_supported(code, dev->keybit, KEY_MAX) && |
| 597 | __test_and_clear_bit(code, dev->key)) { | 612 | __test_and_clear_bit(code, dev->key)) { |
| 598 | input_pass_event(dev, EV_KEY, code, 0); | 613 | input_pass_event(dev, NULL, EV_KEY, code, 0); |
| 599 | } | 614 | } |
| 600 | } | 615 | } |
| 601 | input_pass_event(dev, EV_SYN, SYN_REPORT, 1); | 616 | input_pass_event(dev, NULL, EV_SYN, SYN_REPORT, 1); |
| 602 | } | 617 | } |
| 603 | } | 618 | } |
| 604 | 619 | ||
| @@ -873,9 +888,9 @@ int input_set_keycode(struct input_dev *dev, | |||
| 873 | !is_event_supported(old_keycode, dev->keybit, KEY_MAX) && | 888 | !is_event_supported(old_keycode, dev->keybit, KEY_MAX) && |
| 874 | __test_and_clear_bit(old_keycode, dev->key)) { | 889 | __test_and_clear_bit(old_keycode, dev->key)) { |
| 875 | 890 | ||
| 876 | input_pass_event(dev, EV_KEY, old_keycode, 0); | 891 | input_pass_event(dev, NULL, EV_KEY, old_keycode, 0); |
| 877 | if (dev->sync) | 892 | if (dev->sync) |
| 878 | input_pass_event(dev, EV_SYN, SYN_REPORT, 1); | 893 | input_pass_event(dev, NULL, EV_SYN, SYN_REPORT, 1); |
| 879 | } | 894 | } |
| 880 | 895 | ||
| 881 | out: | 896 | out: |
| @@ -1565,8 +1580,7 @@ static int input_dev_uevent(struct device *device, struct kobj_uevent_env *env) | |||
| 1565 | } \ | 1580 | } \ |
| 1566 | } while (0) | 1581 | } while (0) |
| 1567 | 1582 | ||
| 1568 | #ifdef CONFIG_PM | 1583 | static void input_dev_toggle(struct input_dev *dev, bool activate) |
| 1569 | static void input_dev_reset(struct input_dev *dev, bool activate) | ||
| 1570 | { | 1584 | { |
| 1571 | if (!dev->event) | 1585 | if (!dev->event) |
| 1572 | return; | 1586 | return; |
| @@ -1580,12 +1594,44 @@ static void input_dev_reset(struct input_dev *dev, bool activate) | |||
| 1580 | } | 1594 | } |
| 1581 | } | 1595 | } |
| 1582 | 1596 | ||
| 1597 | /** | ||
| 1598 | * input_reset_device() - reset/restore the state of input device | ||
| 1599 | * @dev: input device whose state needs to be reset | ||
| 1600 | * | ||
| 1601 | * This function tries to reset the state of an opened input device and | ||
| 1602 | * bring internal state and state if the hardware in sync with each other. | ||
| 1603 | * We mark all keys as released, restore LED state, repeat rate, etc. | ||
| 1604 | */ | ||
| 1605 | void input_reset_device(struct input_dev *dev) | ||
| 1606 | { | ||
| 1607 | mutex_lock(&dev->mutex); | ||
| 1608 | |||
| 1609 | if (dev->users) { | ||
| 1610 | input_dev_toggle(dev, true); | ||
| 1611 | |||
| 1612 | /* | ||
| 1613 | * Keys that have been pressed at suspend time are unlikely | ||
| 1614 | * to be still pressed when we resume. | ||
| 1615 | */ | ||
| 1616 | spin_lock_irq(&dev->event_lock); | ||
| 1617 | input_dev_release_keys(dev); | ||
| 1618 | spin_unlock_irq(&dev->event_lock); | ||
| 1619 | } | ||
| 1620 | |||
| 1621 | mutex_unlock(&dev->mutex); | ||
| 1622 | } | ||
| 1623 | EXPORT_SYMBOL(input_reset_device); | ||
| 1624 | |||
| 1625 | #ifdef CONFIG_PM | ||
| 1583 | static int input_dev_suspend(struct device *dev) | 1626 | static int input_dev_suspend(struct device *dev) |
| 1584 | { | 1627 | { |
| 1585 | struct input_dev *input_dev = to_input_dev(dev); | 1628 | struct input_dev *input_dev = to_input_dev(dev); |
| 1586 | 1629 | ||
| 1587 | mutex_lock(&input_dev->mutex); | 1630 | mutex_lock(&input_dev->mutex); |
| 1588 | input_dev_reset(input_dev, false); | 1631 | |
| 1632 | if (input_dev->users) | ||
| 1633 | input_dev_toggle(input_dev, false); | ||
| 1634 | |||
| 1589 | mutex_unlock(&input_dev->mutex); | 1635 | mutex_unlock(&input_dev->mutex); |
| 1590 | 1636 | ||
| 1591 | return 0; | 1637 | return 0; |
| @@ -1595,18 +1641,7 @@ static int input_dev_resume(struct device *dev) | |||
| 1595 | { | 1641 | { |
| 1596 | struct input_dev *input_dev = to_input_dev(dev); | 1642 | struct input_dev *input_dev = to_input_dev(dev); |
| 1597 | 1643 | ||
| 1598 | mutex_lock(&input_dev->mutex); | 1644 | input_reset_device(input_dev); |
| 1599 | input_dev_reset(input_dev, true); | ||
| 1600 | |||
| 1601 | /* | ||
| 1602 | * Keys that have been pressed at suspend time are unlikely | ||
| 1603 | * to be still pressed when we resume. | ||
| 1604 | */ | ||
| 1605 | spin_lock_irq(&input_dev->event_lock); | ||
| 1606 | input_dev_release_keys(input_dev); | ||
| 1607 | spin_unlock_irq(&input_dev->event_lock); | ||
| 1608 | |||
| 1609 | mutex_unlock(&input_dev->mutex); | ||
| 1610 | 1645 | ||
| 1611 | return 0; | 1646 | return 0; |
| 1612 | } | 1647 | } |
diff --git a/drivers/input/keyboard/adp5588-keys.c b/drivers/input/keyboard/adp5588-keys.c index b92d1cd5cba1..af45d275f686 100644 --- a/drivers/input/keyboard/adp5588-keys.c +++ b/drivers/input/keyboard/adp5588-keys.c | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | * I2C QWERTY Keypad and IO Expander | 4 | * I2C QWERTY Keypad and IO Expander |
| 5 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ | 5 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ |
| 6 | * | 6 | * |
| 7 | * Copyright (C) 2008-2009 Analog Devices Inc. | 7 | * Copyright (C) 2008-2010 Analog Devices Inc. |
| 8 | * Licensed under the GPL-2 or later. | 8 | * Licensed under the GPL-2 or later. |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| @@ -24,29 +24,6 @@ | |||
| 24 | 24 | ||
| 25 | #include <linux/i2c/adp5588.h> | 25 | #include <linux/i2c/adp5588.h> |
| 26 | 26 | ||
| 27 | /* Configuration Register1 */ | ||
| 28 | #define AUTO_INC (1 << 7) | ||
| 29 | #define GPIEM_CFG (1 << 6) | ||
| 30 | #define OVR_FLOW_M (1 << 5) | ||
| 31 | #define INT_CFG (1 << 4) | ||
| 32 | #define OVR_FLOW_IEN (1 << 3) | ||
| 33 | #define K_LCK_IM (1 << 2) | ||
| 34 | #define GPI_IEN (1 << 1) | ||
| 35 | #define KE_IEN (1 << 0) | ||
| 36 | |||
| 37 | /* Interrupt Status Register */ | ||
| 38 | #define CMP2_INT (1 << 5) | ||
| 39 | #define CMP1_INT (1 << 4) | ||
| 40 | #define OVR_FLOW_INT (1 << 3) | ||
| 41 | #define K_LCK_INT (1 << 2) | ||
| 42 | #define GPI_INT (1 << 1) | ||
| 43 | #define KE_INT (1 << 0) | ||
| 44 | |||
| 45 | /* Key Lock and Event Counter Register */ | ||
| 46 | #define K_LCK_EN (1 << 6) | ||
| 47 | #define LCK21 0x30 | ||
| 48 | #define KEC 0xF | ||
| 49 | |||
| 50 | /* Key Event Register xy */ | 27 | /* Key Event Register xy */ |
| 51 | #define KEY_EV_PRESSED (1 << 7) | 28 | #define KEY_EV_PRESSED (1 << 7) |
| 52 | #define KEY_EV_MASK (0x7F) | 29 | #define KEY_EV_MASK (0x7F) |
| @@ -55,10 +32,6 @@ | |||
| 55 | 32 | ||
| 56 | #define KEYP_MAX_EVENT 10 | 33 | #define KEYP_MAX_EVENT 10 |
| 57 | 34 | ||
| 58 | #define MAXGPIO 18 | ||
| 59 | #define ADP_BANK(offs) ((offs) >> 3) | ||
| 60 | #define ADP_BIT(offs) (1u << ((offs) & 0x7)) | ||
| 61 | |||
| 62 | /* | 35 | /* |
| 63 | * Early pre 4.0 Silicon required to delay readout by at least 25ms, | 36 | * Early pre 4.0 Silicon required to delay readout by at least 25ms, |
| 64 | * since the Event Counter Register updated 25ms after the interrupt | 37 | * since the Event Counter Register updated 25ms after the interrupt |
| @@ -75,7 +48,7 @@ struct adp5588_kpad { | |||
| 75 | const struct adp5588_gpi_map *gpimap; | 48 | const struct adp5588_gpi_map *gpimap; |
| 76 | unsigned short gpimapsize; | 49 | unsigned short gpimapsize; |
| 77 | #ifdef CONFIG_GPIOLIB | 50 | #ifdef CONFIG_GPIOLIB |
| 78 | unsigned char gpiomap[MAXGPIO]; | 51 | unsigned char gpiomap[ADP5588_MAXGPIO]; |
| 79 | bool export_gpio; | 52 | bool export_gpio; |
| 80 | struct gpio_chip gc; | 53 | struct gpio_chip gc; |
| 81 | struct mutex gpio_lock; /* Protect cached dir, dat_out */ | 54 | struct mutex gpio_lock; /* Protect cached dir, dat_out */ |
| @@ -103,8 +76,8 @@ static int adp5588_write(struct i2c_client *client, u8 reg, u8 val) | |||
| 103 | static int adp5588_gpio_get_value(struct gpio_chip *chip, unsigned off) | 76 | static int adp5588_gpio_get_value(struct gpio_chip *chip, unsigned off) |
| 104 | { | 77 | { |
| 105 | struct adp5588_kpad *kpad = container_of(chip, struct adp5588_kpad, gc); | 78 | struct adp5588_kpad *kpad = container_of(chip, struct adp5588_kpad, gc); |
| 106 | unsigned int bank = ADP_BANK(kpad->gpiomap[off]); | 79 | unsigned int bank = ADP5588_BANK(kpad->gpiomap[off]); |
| 107 | unsigned int bit = ADP_BIT(kpad->gpiomap[off]); | 80 | unsigned int bit = ADP5588_BIT(kpad->gpiomap[off]); |
| 108 | 81 | ||
| 109 | return !!(adp5588_read(kpad->client, GPIO_DAT_STAT1 + bank) & bit); | 82 | return !!(adp5588_read(kpad->client, GPIO_DAT_STAT1 + bank) & bit); |
| 110 | } | 83 | } |
| @@ -113,8 +86,8 @@ static void adp5588_gpio_set_value(struct gpio_chip *chip, | |||
| 113 | unsigned off, int val) | 86 | unsigned off, int val) |
| 114 | { | 87 | { |
| 115 | struct adp5588_kpad *kpad = container_of(chip, struct adp5588_kpad, gc); | 88 | struct adp5588_kpad *kpad = container_of(chip, struct adp5588_kpad, gc); |
| 116 | unsigned int bank = ADP_BANK(kpad->gpiomap[off]); | 89 | unsigned int bank = ADP5588_BANK(kpad->gpiomap[off]); |
| 117 | unsigned int bit = ADP_BIT(kpad->gpiomap[off]); | 90 | unsigned int bit = ADP5588_BIT(kpad->gpiomap[off]); |
| 118 | 91 | ||
| 119 | mutex_lock(&kpad->gpio_lock); | 92 | mutex_lock(&kpad->gpio_lock); |
| 120 | 93 | ||
| @@ -132,8 +105,8 @@ static void adp5588_gpio_set_value(struct gpio_chip *chip, | |||
| 132 | static int adp5588_gpio_direction_input(struct gpio_chip *chip, unsigned off) | 105 | static int adp5588_gpio_direction_input(struct gpio_chip *chip, unsigned off) |
| 133 | { | 106 | { |
| 134 | struct adp5588_kpad *kpad = container_of(chip, struct adp5588_kpad, gc); | 107 | struct adp5588_kpad *kpad = container_of(chip, struct adp5588_kpad, gc); |
| 135 | unsigned int bank = ADP_BANK(kpad->gpiomap[off]); | 108 | unsigned int bank = ADP5588_BANK(kpad->gpiomap[off]); |
| 136 | unsigned int bit = ADP_BIT(kpad->gpiomap[off]); | 109 | unsigned int bit = ADP5588_BIT(kpad->gpiomap[off]); |
| 137 | int ret; | 110 | int ret; |
| 138 | 111 | ||
| 139 | mutex_lock(&kpad->gpio_lock); | 112 | mutex_lock(&kpad->gpio_lock); |
| @@ -150,8 +123,8 @@ static int adp5588_gpio_direction_output(struct gpio_chip *chip, | |||
| 150 | unsigned off, int val) | 123 | unsigned off, int val) |
| 151 | { | 124 | { |
| 152 | struct adp5588_kpad *kpad = container_of(chip, struct adp5588_kpad, gc); | 125 | struct adp5588_kpad *kpad = container_of(chip, struct adp5588_kpad, gc); |
| 153 | unsigned int bank = ADP_BANK(kpad->gpiomap[off]); | 126 | unsigned int bank = ADP5588_BANK(kpad->gpiomap[off]); |
| 154 | unsigned int bit = ADP_BIT(kpad->gpiomap[off]); | 127 | unsigned int bit = ADP5588_BIT(kpad->gpiomap[off]); |
| 155 | int ret; | 128 | int ret; |
| 156 | 129 | ||
| 157 | mutex_lock(&kpad->gpio_lock); | 130 | mutex_lock(&kpad->gpio_lock); |
| @@ -176,7 +149,7 @@ static int adp5588_gpio_direction_output(struct gpio_chip *chip, | |||
| 176 | static int __devinit adp5588_build_gpiomap(struct adp5588_kpad *kpad, | 149 | static int __devinit adp5588_build_gpiomap(struct adp5588_kpad *kpad, |
| 177 | const struct adp5588_kpad_platform_data *pdata) | 150 | const struct adp5588_kpad_platform_data *pdata) |
| 178 | { | 151 | { |
| 179 | bool pin_used[MAXGPIO]; | 152 | bool pin_used[ADP5588_MAXGPIO]; |
| 180 | int n_unused = 0; | 153 | int n_unused = 0; |
| 181 | int i; | 154 | int i; |
| 182 | 155 | ||
| @@ -191,7 +164,7 @@ static int __devinit adp5588_build_gpiomap(struct adp5588_kpad *kpad, | |||
| 191 | for (i = 0; i < kpad->gpimapsize; i++) | 164 | for (i = 0; i < kpad->gpimapsize; i++) |
| 192 | pin_used[kpad->gpimap[i].pin - GPI_PIN_BASE] = true; | 165 | pin_used[kpad->gpimap[i].pin - GPI_PIN_BASE] = true; |
| 193 | 166 | ||
| 194 | for (i = 0; i < MAXGPIO; i++) | 167 | for (i = 0; i < ADP5588_MAXGPIO; i++) |
| 195 | if (!pin_used[i]) | 168 | if (!pin_used[i]) |
| 196 | kpad->gpiomap[n_unused++] = i; | 169 | kpad->gpiomap[n_unused++] = i; |
| 197 | 170 | ||
| @@ -234,7 +207,7 @@ static int __devinit adp5588_gpio_add(struct adp5588_kpad *kpad) | |||
| 234 | return error; | 207 | return error; |
| 235 | } | 208 | } |
| 236 | 209 | ||
| 237 | for (i = 0; i <= ADP_BANK(MAXGPIO); i++) { | 210 | for (i = 0; i <= ADP5588_BANK(ADP5588_MAXGPIO); i++) { |
| 238 | kpad->dat_out[i] = adp5588_read(kpad->client, | 211 | kpad->dat_out[i] = adp5588_read(kpad->client, |
| 239 | GPIO_DAT_OUT1 + i); | 212 | GPIO_DAT_OUT1 + i); |
| 240 | kpad->dir[i] = adp5588_read(kpad->client, GPIO_DIR1 + i); | 213 | kpad->dir[i] = adp5588_read(kpad->client, GPIO_DIR1 + i); |
| @@ -318,11 +291,11 @@ static void adp5588_work(struct work_struct *work) | |||
| 318 | 291 | ||
| 319 | status = adp5588_read(client, INT_STAT); | 292 | status = adp5588_read(client, INT_STAT); |
| 320 | 293 | ||
| 321 | if (status & OVR_FLOW_INT) /* Unlikely and should never happen */ | 294 | if (status & ADP5588_OVR_FLOW_INT) /* Unlikely and should never happen */ |
| 322 | dev_err(&client->dev, "Event Overflow Error\n"); | 295 | dev_err(&client->dev, "Event Overflow Error\n"); |
| 323 | 296 | ||
| 324 | if (status & KE_INT) { | 297 | if (status & ADP5588_KE_INT) { |
| 325 | ev_cnt = adp5588_read(client, KEY_LCK_EC_STAT) & KEC; | 298 | ev_cnt = adp5588_read(client, KEY_LCK_EC_STAT) & ADP5588_KEC; |
| 326 | if (ev_cnt) { | 299 | if (ev_cnt) { |
| 327 | adp5588_report_events(kpad, ev_cnt); | 300 | adp5588_report_events(kpad, ev_cnt); |
| 328 | input_sync(kpad->input); | 301 | input_sync(kpad->input); |
| @@ -360,7 +333,7 @@ static int __devinit adp5588_setup(struct i2c_client *client) | |||
| 360 | if (pdata->en_keylock) { | 333 | if (pdata->en_keylock) { |
| 361 | ret |= adp5588_write(client, UNLOCK1, pdata->unlock_key1); | 334 | ret |= adp5588_write(client, UNLOCK1, pdata->unlock_key1); |
| 362 | ret |= adp5588_write(client, UNLOCK2, pdata->unlock_key2); | 335 | ret |= adp5588_write(client, UNLOCK2, pdata->unlock_key2); |
| 363 | ret |= adp5588_write(client, KEY_LCK_EC_STAT, K_LCK_EN); | 336 | ret |= adp5588_write(client, KEY_LCK_EC_STAT, ADP5588_K_LCK_EN); |
| 364 | } | 337 | } |
| 365 | 338 | ||
| 366 | for (i = 0; i < KEYP_MAX_EVENT; i++) | 339 | for (i = 0; i < KEYP_MAX_EVENT; i++) |
| @@ -384,7 +357,7 @@ static int __devinit adp5588_setup(struct i2c_client *client) | |||
| 384 | } | 357 | } |
| 385 | 358 | ||
| 386 | if (gpio_data) { | 359 | if (gpio_data) { |
| 387 | for (i = 0; i <= ADP_BANK(MAXGPIO); i++) { | 360 | for (i = 0; i <= ADP5588_BANK(ADP5588_MAXGPIO); i++) { |
| 388 | int pull_mask = gpio_data->pullup_dis_mask; | 361 | int pull_mask = gpio_data->pullup_dis_mask; |
| 389 | 362 | ||
| 390 | ret |= adp5588_write(client, GPIO_PULL1 + i, | 363 | ret |= adp5588_write(client, GPIO_PULL1 + i, |
| @@ -392,11 +365,14 @@ static int __devinit adp5588_setup(struct i2c_client *client) | |||
| 392 | } | 365 | } |
| 393 | } | 366 | } |
| 394 | 367 | ||
| 395 | ret |= adp5588_write(client, INT_STAT, CMP2_INT | CMP1_INT | | 368 | ret |= adp5588_write(client, INT_STAT, |
| 396 | OVR_FLOW_INT | K_LCK_INT | | 369 | ADP5588_CMP2_INT | ADP5588_CMP1_INT | |
| 397 | GPI_INT | KE_INT); /* Status is W1C */ | 370 | ADP5588_OVR_FLOW_INT | ADP5588_K_LCK_INT | |
| 371 | ADP5588_GPI_INT | ADP5588_KE_INT); /* Status is W1C */ | ||
| 398 | 372 | ||
| 399 | ret |= adp5588_write(client, CFG, INT_CFG | OVR_FLOW_IEN | KE_IEN); | 373 | ret |= adp5588_write(client, CFG, ADP5588_INT_CFG | |
| 374 | ADP5588_OVR_FLOW_IEN | | ||
| 375 | ADP5588_KE_IEN); | ||
| 400 | 376 | ||
| 401 | if (ret < 0) { | 377 | if (ret < 0) { |
| 402 | dev_err(&client->dev, "Write Error\n"); | 378 | dev_err(&client->dev, "Write Error\n"); |
diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c index d358ef8623f4..11478eb2c27d 100644 --- a/drivers/input/keyboard/atkbd.c +++ b/drivers/input/keyboard/atkbd.c | |||
| @@ -63,6 +63,10 @@ static bool atkbd_extra; | |||
| 63 | module_param_named(extra, atkbd_extra, bool, 0); | 63 | module_param_named(extra, atkbd_extra, bool, 0); |
| 64 | MODULE_PARM_DESC(extra, "Enable extra LEDs and keys on IBM RapidAcces, EzKey and similar keyboards"); | 64 | MODULE_PARM_DESC(extra, "Enable extra LEDs and keys on IBM RapidAcces, EzKey and similar keyboards"); |
| 65 | 65 | ||
| 66 | static bool atkbd_terminal; | ||
| 67 | module_param_named(terminal, atkbd_terminal, bool, 0); | ||
| 68 | MODULE_PARM_DESC(terminal, "Enable break codes on an IBM Terminal keyboard connected via AT/PS2"); | ||
| 69 | |||
| 66 | /* | 70 | /* |
| 67 | * Scancode to keycode tables. These are just the default setting, and | 71 | * Scancode to keycode tables. These are just the default setting, and |
| 68 | * are loadable via a userland utility. | 72 | * are loadable via a userland utility. |
| @@ -136,7 +140,8 @@ static const unsigned short atkbd_unxlate_table[128] = { | |||
| 136 | #define ATKBD_CMD_ENABLE 0x00f4 | 140 | #define ATKBD_CMD_ENABLE 0x00f4 |
| 137 | #define ATKBD_CMD_RESET_DIS 0x00f5 /* Reset to defaults and disable */ | 141 | #define ATKBD_CMD_RESET_DIS 0x00f5 /* Reset to defaults and disable */ |
| 138 | #define ATKBD_CMD_RESET_DEF 0x00f6 /* Reset to defaults */ | 142 | #define ATKBD_CMD_RESET_DEF 0x00f6 /* Reset to defaults */ |
| 139 | #define ATKBD_CMD_SETALL_MBR 0x00fa | 143 | #define ATKBD_CMD_SETALL_MB 0x00f8 /* Set all keys to give break codes */ |
| 144 | #define ATKBD_CMD_SETALL_MBR 0x00fa /* ... and repeat */ | ||
| 140 | #define ATKBD_CMD_RESET_BAT 0x02ff | 145 | #define ATKBD_CMD_RESET_BAT 0x02ff |
| 141 | #define ATKBD_CMD_RESEND 0x00fe | 146 | #define ATKBD_CMD_RESEND 0x00fe |
| 142 | #define ATKBD_CMD_EX_ENABLE 0x10ea | 147 | #define ATKBD_CMD_EX_ENABLE 0x10ea |
| @@ -764,6 +769,11 @@ static int atkbd_select_set(struct atkbd *atkbd, int target_set, int allow_extra | |||
| 764 | } | 769 | } |
| 765 | } | 770 | } |
| 766 | 771 | ||
| 772 | if (atkbd_terminal) { | ||
| 773 | ps2_command(ps2dev, param, ATKBD_CMD_SETALL_MB); | ||
| 774 | return 3; | ||
| 775 | } | ||
| 776 | |||
| 767 | if (target_set != 3) | 777 | if (target_set != 3) |
| 768 | return 2; | 778 | return 2; |
| 769 | 779 | ||
diff --git a/drivers/input/misc/pcf8574_keypad.c b/drivers/input/misc/pcf8574_keypad.c index 4b42ffc0532a..d1583aea1721 100644 --- a/drivers/input/misc/pcf8574_keypad.c +++ b/drivers/input/misc/pcf8574_keypad.c | |||
| @@ -127,14 +127,6 @@ static int __devinit pcf8574_kp_probe(struct i2c_client *client, const struct i2 | |||
| 127 | idev->id.product = 0x0001; | 127 | idev->id.product = 0x0001; |
| 128 | idev->id.version = 0x0100; | 128 | idev->id.version = 0x0100; |
| 129 | 129 | ||
| 130 | input_set_drvdata(idev, lp); | ||
| 131 | |||
| 132 | ret = input_register_device(idev); | ||
| 133 | if (ret) { | ||
| 134 | dev_err(&client->dev, "input_register_device() failed\n"); | ||
| 135 | goto fail_register; | ||
| 136 | } | ||
| 137 | |||
| 138 | lp->laststate = read_state(lp); | 130 | lp->laststate = read_state(lp); |
| 139 | 131 | ||
| 140 | ret = request_threaded_irq(client->irq, NULL, pcf8574_kp_irq_handler, | 132 | ret = request_threaded_irq(client->irq, NULL, pcf8574_kp_irq_handler, |
| @@ -142,16 +134,21 @@ static int __devinit pcf8574_kp_probe(struct i2c_client *client, const struct i2 | |||
| 142 | DRV_NAME, lp); | 134 | DRV_NAME, lp); |
| 143 | if (ret) { | 135 | if (ret) { |
| 144 | dev_err(&client->dev, "IRQ %d is not free\n", client->irq); | 136 | dev_err(&client->dev, "IRQ %d is not free\n", client->irq); |
| 145 | goto fail_irq; | 137 | goto fail_free_device; |
| 138 | } | ||
| 139 | |||
| 140 | ret = input_register_device(idev); | ||
| 141 | if (ret) { | ||
| 142 | dev_err(&client->dev, "input_register_device() failed\n"); | ||
| 143 | goto fail_free_irq; | ||
| 146 | } | 144 | } |
| 147 | 145 | ||
| 148 | i2c_set_clientdata(client, lp); | 146 | i2c_set_clientdata(client, lp); |
| 149 | return 0; | 147 | return 0; |
| 150 | 148 | ||
| 151 | fail_irq: | 149 | fail_free_irq: |
| 152 | input_unregister_device(idev); | 150 | free_irq(client->irq, lp); |
| 153 | fail_register: | 151 | fail_free_device: |
| 154 | input_set_drvdata(idev, NULL); | ||
| 155 | input_free_device(idev); | 152 | input_free_device(idev); |
| 156 | fail_allocate: | 153 | fail_allocate: |
| 157 | kfree(lp); | 154 | kfree(lp); |
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h index ed7ad7416b24..a5475b577086 100644 --- a/drivers/input/serio/i8042-x86ia64io.h +++ b/drivers/input/serio/i8042-x86ia64io.h | |||
| @@ -351,6 +351,17 @@ static const struct dmi_system_id __initconst i8042_dmi_nomux_table[] = { | |||
| 351 | }, | 351 | }, |
| 352 | }, | 352 | }, |
| 353 | { | 353 | { |
| 354 | /* | ||
| 355 | * Most (all?) VAIOs do not have external PS/2 ports nor | ||
| 356 | * they implement active multiplexing properly, and | ||
| 357 | * MUX discovery usually messes up keyboard/touchpad. | ||
| 358 | */ | ||
| 359 | .matches = { | ||
| 360 | DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), | ||
| 361 | DMI_MATCH(DMI_BOARD_NAME, "VAIO"), | ||
| 362 | }, | ||
| 363 | }, | ||
| 364 | { | ||
| 354 | /* Amoi M636/A737 */ | 365 | /* Amoi M636/A737 */ |
| 355 | .matches = { | 366 | .matches = { |
| 356 | DMI_MATCH(DMI_SYS_VENDOR, "Amoi Electronics CO.,LTD."), | 367 | DMI_MATCH(DMI_SYS_VENDOR, "Amoi Electronics CO.,LTD."), |
diff --git a/drivers/input/tablet/acecad.c b/drivers/input/tablet/acecad.c index aea9a9399a36..d94f7e9aa997 100644 --- a/drivers/input/tablet/acecad.c +++ b/drivers/input/tablet/acecad.c | |||
| @@ -229,12 +229,13 @@ static int usb_acecad_probe(struct usb_interface *intf, const struct usb_device_ | |||
| 229 | 229 | ||
| 230 | err = input_register_device(acecad->input); | 230 | err = input_register_device(acecad->input); |
| 231 | if (err) | 231 | if (err) |
| 232 | goto fail2; | 232 | goto fail3; |
| 233 | 233 | ||
| 234 | usb_set_intfdata(intf, acecad); | 234 | usb_set_intfdata(intf, acecad); |
| 235 | 235 | ||
| 236 | return 0; | 236 | return 0; |
| 237 | 237 | ||
| 238 | fail3: usb_free_urb(acecad->irq); | ||
| 238 | fail2: usb_free_coherent(dev, 8, acecad->data, acecad->data_dma); | 239 | fail2: usb_free_coherent(dev, 8, acecad->data, acecad->data_dma); |
| 239 | fail1: input_free_device(input_dev); | 240 | fail1: input_free_device(input_dev); |
| 240 | kfree(acecad); | 241 | kfree(acecad); |
diff --git a/drivers/serial/kgdboc.c b/drivers/serial/kgdboc.c index d4b711c9a416..3374618300af 100644 --- a/drivers/serial/kgdboc.c +++ b/drivers/serial/kgdboc.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <linux/tty.h> | 18 | #include <linux/tty.h> |
| 19 | #include <linux/console.h> | 19 | #include <linux/console.h> |
| 20 | #include <linux/vt_kern.h> | 20 | #include <linux/vt_kern.h> |
| 21 | #include <linux/input.h> | ||
| 21 | 22 | ||
| 22 | #define MAX_CONFIG_LEN 40 | 23 | #define MAX_CONFIG_LEN 40 |
| 23 | 24 | ||
| @@ -37,6 +38,61 @@ static struct tty_driver *kgdb_tty_driver; | |||
| 37 | static int kgdb_tty_line; | 38 | static int kgdb_tty_line; |
| 38 | 39 | ||
| 39 | #ifdef CONFIG_KDB_KEYBOARD | 40 | #ifdef CONFIG_KDB_KEYBOARD |
| 41 | static int kgdboc_reset_connect(struct input_handler *handler, | ||
| 42 | struct input_dev *dev, | ||
| 43 | const struct input_device_id *id) | ||
| 44 | { | ||
| 45 | input_reset_device(dev); | ||
| 46 | |||
| 47 | /* Retrun an error - we do not want to bind, just to reset */ | ||
| 48 | return -ENODEV; | ||
| 49 | } | ||
| 50 | |||
| 51 | static void kgdboc_reset_disconnect(struct input_handle *handle) | ||
| 52 | { | ||
| 53 | /* We do not expect anyone to actually bind to us */ | ||
| 54 | BUG(); | ||
| 55 | } | ||
| 56 | |||
| 57 | static const struct input_device_id kgdboc_reset_ids[] = { | ||
| 58 | { | ||
| 59 | .flags = INPUT_DEVICE_ID_MATCH_EVBIT, | ||
| 60 | .evbit = { BIT_MASK(EV_KEY) }, | ||
| 61 | }, | ||
| 62 | { } | ||
| 63 | }; | ||
| 64 | |||
| 65 | static struct input_handler kgdboc_reset_handler = { | ||
| 66 | .connect = kgdboc_reset_connect, | ||
| 67 | .disconnect = kgdboc_reset_disconnect, | ||
| 68 | .name = "kgdboc_reset", | ||
| 69 | .id_table = kgdboc_reset_ids, | ||
| 70 | }; | ||
| 71 | |||
| 72 | static DEFINE_MUTEX(kgdboc_reset_mutex); | ||
| 73 | |||
| 74 | static void kgdboc_restore_input_helper(struct work_struct *dummy) | ||
| 75 | { | ||
| 76 | /* | ||
| 77 | * We need to take a mutex to prevent several instances of | ||
| 78 | * this work running on different CPUs so they don't try | ||
| 79 | * to register again already registered handler. | ||
| 80 | */ | ||
| 81 | mutex_lock(&kgdboc_reset_mutex); | ||
| 82 | |||
| 83 | if (input_register_handler(&kgdboc_reset_handler) == 0) | ||
| 84 | input_unregister_handler(&kgdboc_reset_handler); | ||
| 85 | |||
| 86 | mutex_unlock(&kgdboc_reset_mutex); | ||
| 87 | } | ||
| 88 | |||
| 89 | static DECLARE_WORK(kgdboc_restore_input_work, kgdboc_restore_input_helper); | ||
| 90 | |||
| 91 | static void kgdboc_restore_input(void) | ||
| 92 | { | ||
| 93 | schedule_work(&kgdboc_restore_input_work); | ||
| 94 | } | ||
| 95 | |||
| 40 | static int kgdboc_register_kbd(char **cptr) | 96 | static int kgdboc_register_kbd(char **cptr) |
| 41 | { | 97 | { |
| 42 | if (strncmp(*cptr, "kbd", 3) == 0) { | 98 | if (strncmp(*cptr, "kbd", 3) == 0) { |
| @@ -64,10 +120,12 @@ static void kgdboc_unregister_kbd(void) | |||
| 64 | i--; | 120 | i--; |
| 65 | } | 121 | } |
| 66 | } | 122 | } |
| 123 | flush_work_sync(&kgdboc_restore_input_work); | ||
| 67 | } | 124 | } |
| 68 | #else /* ! CONFIG_KDB_KEYBOARD */ | 125 | #else /* ! CONFIG_KDB_KEYBOARD */ |
| 69 | #define kgdboc_register_kbd(x) 0 | 126 | #define kgdboc_register_kbd(x) 0 |
| 70 | #define kgdboc_unregister_kbd() | 127 | #define kgdboc_unregister_kbd() |
| 128 | #define kgdboc_restore_input() | ||
| 71 | #endif /* ! CONFIG_KDB_KEYBOARD */ | 129 | #endif /* ! CONFIG_KDB_KEYBOARD */ |
| 72 | 130 | ||
| 73 | static int kgdboc_option_setup(char *opt) | 131 | static int kgdboc_option_setup(char *opt) |
| @@ -231,6 +289,7 @@ static void kgdboc_post_exp_handler(void) | |||
| 231 | dbg_restore_graphics = 0; | 289 | dbg_restore_graphics = 0; |
| 232 | con_debug_leave(); | 290 | con_debug_leave(); |
| 233 | } | 291 | } |
| 292 | kgdboc_restore_input(); | ||
| 234 | } | 293 | } |
| 235 | 294 | ||
| 236 | static struct kgdb_io kgdboc_io_ops = { | 295 | static struct kgdb_io kgdboc_io_ops = { |
