diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-27 12:24:56 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-27 12:24:56 -0400 |
| commit | 70a3eff5768350c0313a9ae70a15da113171d0ab (patch) | |
| tree | 9c2558f92e567bcb35c79f59bc7ebc9cf6fdc9d3 /drivers/input/keyboard | |
| parent | 9ed3689bdceb0064ee6faf0e76f6467122794970 (diff) | |
| parent | aa7eb8e78d8ecd6cd0475d86ea8385ff9cb47ece (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: (53 commits)
Input: synaptics - fix reporting of min coordinates
Input: tegra-kbc - enable key autorepeat
Input: kxtj9 - fix locking typo in kxtj9_set_poll()
Input: kxtj9 - fix bug in probe()
Input: intel-mid-touch - remove pointless checking for variable 'found'
Input: hp_sdc - staticize hp_sdc_kicker()
Input: pmic8xxx-keypad - fix a leak of the IRQ during init failure
Input: cy8ctmg110_ts - set reset_pin and irq_pin from platform data
Input: cy8ctmg110_ts - constify i2c_device_id table
Input: cy8ctmg110_ts - fix checking return value of i2c_master_send
Input: lifebook - make dmi callback functions return 1
Input: atkbd - make dmi callback functions return 1
Input: gpio_keys - switch to using SIMPLE_DEV_PM_OPS
Input: gpio_keys - add support for device-tree platform data
Input: aiptek - remove double define
Input: synaptics - set minimum coordinates as reported by firmware
Input: synaptics - process button bits in AGM packets
Input: synaptics - rename set_slot to be more descriptive
Input: synaptics - fuzz position for touchpad with reduced filtering
Input: synaptics - set resolution for MT_POSITION_X/Y axes
...
Diffstat (limited to 'drivers/input/keyboard')
| -rw-r--r-- | drivers/input/keyboard/adp5588-keys.c | 1 | ||||
| -rw-r--r-- | drivers/input/keyboard/adp5589-keys.c | 1 | ||||
| -rw-r--r-- | drivers/input/keyboard/atkbd.c | 4 | ||||
| -rw-r--r-- | drivers/input/keyboard/gpio_keys.c | 166 | ||||
| -rw-r--r-- | drivers/input/keyboard/lm8323.c | 23 | ||||
| -rw-r--r-- | drivers/input/keyboard/mpr121_touchkey.c | 16 | ||||
| -rw-r--r-- | drivers/input/keyboard/pmic8xxx-keypad.c | 8 | ||||
| -rw-r--r-- | drivers/input/keyboard/qt1070.c | 2 | ||||
| -rw-r--r-- | drivers/input/keyboard/sh_keysc.c | 2 | ||||
| -rw-r--r-- | drivers/input/keyboard/tegra-kbc.c | 2 | ||||
| -rw-r--r-- | drivers/input/keyboard/tnetv107x-keypad.c | 2 |
11 files changed, 164 insertions, 63 deletions
diff --git a/drivers/input/keyboard/adp5588-keys.c b/drivers/input/keyboard/adp5588-keys.c index af45d275f686..7b404e5443ed 100644 --- a/drivers/input/keyboard/adp5588-keys.c +++ b/drivers/input/keyboard/adp5588-keys.c | |||
| @@ -9,7 +9,6 @@ | |||
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | #include <linux/module.h> | 11 | #include <linux/module.h> |
| 12 | #include <linux/version.h> | ||
| 13 | #include <linux/init.h> | 12 | #include <linux/init.h> |
| 14 | #include <linux/interrupt.h> | 13 | #include <linux/interrupt.h> |
| 15 | #include <linux/irq.h> | 14 | #include <linux/irq.h> |
diff --git a/drivers/input/keyboard/adp5589-keys.c b/drivers/input/keyboard/adp5589-keys.c index 631598663aab..c7708263051b 100644 --- a/drivers/input/keyboard/adp5589-keys.c +++ b/drivers/input/keyboard/adp5589-keys.c | |||
| @@ -8,7 +8,6 @@ | |||
| 8 | */ | 8 | */ |
| 9 | 9 | ||
| 10 | #include <linux/module.h> | 10 | #include <linux/module.h> |
| 11 | #include <linux/version.h> | ||
| 12 | #include <linux/init.h> | 11 | #include <linux/init.h> |
| 13 | #include <linux/interrupt.h> | 12 | #include <linux/interrupt.h> |
| 14 | #include <linux/irq.h> | 13 | #include <linux/irq.h> |
diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c index 11478eb2c27d..19cfc0cf558c 100644 --- a/drivers/input/keyboard/atkbd.c +++ b/drivers/input/keyboard/atkbd.c | |||
| @@ -1578,14 +1578,14 @@ static int __init atkbd_setup_forced_release(const struct dmi_system_id *id) | |||
| 1578 | atkbd_platform_fixup = atkbd_apply_forced_release_keylist; | 1578 | atkbd_platform_fixup = atkbd_apply_forced_release_keylist; |
| 1579 | atkbd_platform_fixup_data = id->driver_data; | 1579 | atkbd_platform_fixup_data = id->driver_data; |
| 1580 | 1580 | ||
| 1581 | return 0; | 1581 | return 1; |
| 1582 | } | 1582 | } |
| 1583 | 1583 | ||
| 1584 | static int __init atkbd_setup_scancode_fixup(const struct dmi_system_id *id) | 1584 | static int __init atkbd_setup_scancode_fixup(const struct dmi_system_id *id) |
| 1585 | { | 1585 | { |
| 1586 | atkbd_platform_scancode_fixup = id->driver_data; | 1586 | atkbd_platform_scancode_fixup = id->driver_data; |
| 1587 | 1587 | ||
| 1588 | return 0; | 1588 | return 1; |
| 1589 | } | 1589 | } |
| 1590 | 1590 | ||
| 1591 | static const struct dmi_system_id atkbd_dmi_quirk_table[] __initconst = { | 1591 | static const struct dmi_system_id atkbd_dmi_quirk_table[] __initconst = { |
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index 6e6145b9a4c1..ce281d152275 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | * Driver for keys on GPIO lines capable of generating interrupts. | 2 | * Driver for keys on GPIO lines capable of generating interrupts. |
| 3 | * | 3 | * |
| 4 | * Copyright 2005 Phil Blundell | 4 | * Copyright 2005 Phil Blundell |
| 5 | * Copyright 2010, 2011 David Jander <david@protonic.nl> | ||
| 5 | * | 6 | * |
| 6 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License version 2 as | 8 | * it under the terms of the GNU General Public License version 2 as |
| @@ -25,6 +26,8 @@ | |||
| 25 | #include <linux/gpio_keys.h> | 26 | #include <linux/gpio_keys.h> |
| 26 | #include <linux/workqueue.h> | 27 | #include <linux/workqueue.h> |
| 27 | #include <linux/gpio.h> | 28 | #include <linux/gpio.h> |
| 29 | #include <linux/of_platform.h> | ||
| 30 | #include <linux/of_gpio.h> | ||
| 28 | 31 | ||
| 29 | struct gpio_button_data { | 32 | struct gpio_button_data { |
| 30 | struct gpio_keys_button *button; | 33 | struct gpio_keys_button *button; |
| @@ -415,7 +418,7 @@ static int __devinit gpio_keys_setup_key(struct platform_device *pdev, | |||
| 415 | if (!button->can_disable) | 418 | if (!button->can_disable) |
| 416 | irqflags |= IRQF_SHARED; | 419 | irqflags |= IRQF_SHARED; |
| 417 | 420 | ||
| 418 | error = request_any_context_irq(irq, gpio_keys_isr, irqflags, desc, bdata); | 421 | error = request_threaded_irq(irq, NULL, gpio_keys_isr, irqflags, desc, bdata); |
| 419 | if (error < 0) { | 422 | if (error < 0) { |
| 420 | dev_err(dev, "Unable to claim irq %d; error %d\n", | 423 | dev_err(dev, "Unable to claim irq %d; error %d\n", |
| 421 | irq, error); | 424 | irq, error); |
| @@ -445,15 +448,120 @@ static void gpio_keys_close(struct input_dev *input) | |||
| 445 | ddata->disable(input->dev.parent); | 448 | ddata->disable(input->dev.parent); |
| 446 | } | 449 | } |
| 447 | 450 | ||
| 451 | /* | ||
| 452 | * Handlers for alternative sources of platform_data | ||
| 453 | */ | ||
| 454 | #ifdef CONFIG_OF | ||
| 455 | /* | ||
| 456 | * Translate OpenFirmware node properties into platform_data | ||
| 457 | */ | ||
| 458 | static int gpio_keys_get_devtree_pdata(struct device *dev, | ||
| 459 | struct gpio_keys_platform_data *pdata) | ||
| 460 | { | ||
| 461 | struct device_node *node, *pp; | ||
| 462 | int i; | ||
| 463 | struct gpio_keys_button *buttons; | ||
| 464 | const u32 *reg; | ||
| 465 | int len; | ||
| 466 | |||
| 467 | node = dev->of_node; | ||
| 468 | if (node == NULL) | ||
| 469 | return -ENODEV; | ||
| 470 | |||
| 471 | memset(pdata, 0, sizeof *pdata); | ||
| 472 | |||
| 473 | pdata->rep = !!of_get_property(node, "autorepeat", &len); | ||
| 474 | |||
| 475 | /* First count the subnodes */ | ||
| 476 | pdata->nbuttons = 0; | ||
| 477 | pp = NULL; | ||
| 478 | while ((pp = of_get_next_child(node, pp))) | ||
| 479 | pdata->nbuttons++; | ||
| 480 | |||
| 481 | if (pdata->nbuttons == 0) | ||
| 482 | return -ENODEV; | ||
| 483 | |||
| 484 | buttons = kzalloc(pdata->nbuttons * (sizeof *buttons), GFP_KERNEL); | ||
| 485 | if (!buttons) | ||
| 486 | return -ENODEV; | ||
| 487 | |||
| 488 | pp = NULL; | ||
| 489 | i = 0; | ||
| 490 | while ((pp = of_get_next_child(node, pp))) { | ||
| 491 | enum of_gpio_flags flags; | ||
| 492 | |||
| 493 | if (!of_find_property(pp, "gpios", NULL)) { | ||
| 494 | pdata->nbuttons--; | ||
| 495 | dev_warn(dev, "Found button without gpios\n"); | ||
| 496 | continue; | ||
| 497 | } | ||
| 498 | buttons[i].gpio = of_get_gpio_flags(pp, 0, &flags); | ||
| 499 | buttons[i].active_low = flags & OF_GPIO_ACTIVE_LOW; | ||
| 500 | |||
| 501 | reg = of_get_property(pp, "linux,code", &len); | ||
| 502 | if (!reg) { | ||
| 503 | dev_err(dev, "Button without keycode: 0x%x\n", buttons[i].gpio); | ||
| 504 | goto out_fail; | ||
| 505 | } | ||
| 506 | buttons[i].code = be32_to_cpup(reg); | ||
| 507 | |||
| 508 | buttons[i].desc = of_get_property(pp, "label", &len); | ||
| 509 | |||
| 510 | reg = of_get_property(pp, "linux,input-type", &len); | ||
| 511 | buttons[i].type = reg ? be32_to_cpup(reg) : EV_KEY; | ||
| 512 | |||
| 513 | buttons[i].wakeup = !!of_get_property(pp, "gpio-key,wakeup", NULL); | ||
| 514 | |||
| 515 | reg = of_get_property(pp, "debounce-interval", &len); | ||
| 516 | buttons[i].debounce_interval = reg ? be32_to_cpup(reg) : 5; | ||
| 517 | |||
| 518 | i++; | ||
| 519 | } | ||
| 520 | |||
| 521 | pdata->buttons = buttons; | ||
| 522 | |||
| 523 | return 0; | ||
| 524 | |||
| 525 | out_fail: | ||
| 526 | kfree(buttons); | ||
| 527 | return -ENODEV; | ||
| 528 | } | ||
| 529 | |||
| 530 | static struct of_device_id gpio_keys_of_match[] = { | ||
| 531 | { .compatible = "gpio-keys", }, | ||
| 532 | { }, | ||
| 533 | }; | ||
| 534 | MODULE_DEVICE_TABLE(of, gpio_keys_of_match); | ||
| 535 | |||
| 536 | #else | ||
| 537 | |||
| 538 | static int gpio_keys_get_devtree_pdata(struct device *dev, | ||
| 539 | struct gpio_keys_platform_data *altp) | ||
| 540 | { | ||
| 541 | return -ENODEV; | ||
| 542 | } | ||
| 543 | |||
| 544 | #define gpio_keys_of_match NULL | ||
| 545 | |||
| 546 | #endif | ||
| 547 | |||
| 448 | static int __devinit gpio_keys_probe(struct platform_device *pdev) | 548 | static int __devinit gpio_keys_probe(struct platform_device *pdev) |
| 449 | { | 549 | { |
| 450 | struct gpio_keys_platform_data *pdata = pdev->dev.platform_data; | 550 | struct gpio_keys_platform_data *pdata = pdev->dev.platform_data; |
| 451 | struct gpio_keys_drvdata *ddata; | 551 | struct gpio_keys_drvdata *ddata; |
| 452 | struct device *dev = &pdev->dev; | 552 | struct device *dev = &pdev->dev; |
| 553 | struct gpio_keys_platform_data alt_pdata; | ||
| 453 | struct input_dev *input; | 554 | struct input_dev *input; |
| 454 | int i, error; | 555 | int i, error; |
| 455 | int wakeup = 0; | 556 | int wakeup = 0; |
| 456 | 557 | ||
| 558 | if (!pdata) { | ||
| 559 | error = gpio_keys_get_devtree_pdata(dev, &alt_pdata); | ||
| 560 | if (error) | ||
| 561 | return error; | ||
| 562 | pdata = &alt_pdata; | ||
| 563 | } | ||
| 564 | |||
| 457 | ddata = kzalloc(sizeof(struct gpio_keys_drvdata) + | 565 | ddata = kzalloc(sizeof(struct gpio_keys_drvdata) + |
| 458 | pdata->nbuttons * sizeof(struct gpio_button_data), | 566 | pdata->nbuttons * sizeof(struct gpio_button_data), |
| 459 | GFP_KERNEL); | 567 | GFP_KERNEL); |
| @@ -544,13 +652,15 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev) | |||
| 544 | fail1: | 652 | fail1: |
| 545 | input_free_device(input); | 653 | input_free_device(input); |
| 546 | kfree(ddata); | 654 | kfree(ddata); |
| 655 | /* If we have no platform_data, we allocated buttons dynamically. */ | ||
| 656 | if (!pdev->dev.platform_data) | ||
| 657 | kfree(pdata->buttons); | ||
| 547 | 658 | ||
| 548 | return error; | 659 | return error; |
| 549 | } | 660 | } |
| 550 | 661 | ||
| 551 | static int __devexit gpio_keys_remove(struct platform_device *pdev) | 662 | static int __devexit gpio_keys_remove(struct platform_device *pdev) |
| 552 | { | 663 | { |
| 553 | struct gpio_keys_platform_data *pdata = pdev->dev.platform_data; | ||
| 554 | struct gpio_keys_drvdata *ddata = platform_get_drvdata(pdev); | 664 | struct gpio_keys_drvdata *ddata = platform_get_drvdata(pdev); |
| 555 | struct input_dev *input = ddata->input; | 665 | struct input_dev *input = ddata->input; |
| 556 | int i; | 666 | int i; |
| @@ -559,31 +669,39 @@ static int __devexit gpio_keys_remove(struct platform_device *pdev) | |||
| 559 | 669 | ||
| 560 | device_init_wakeup(&pdev->dev, 0); | 670 | device_init_wakeup(&pdev->dev, 0); |
| 561 | 671 | ||
| 562 | for (i = 0; i < pdata->nbuttons; i++) { | 672 | for (i = 0; i < ddata->n_buttons; i++) { |
| 563 | int irq = gpio_to_irq(pdata->buttons[i].gpio); | 673 | int irq = gpio_to_irq(ddata->data[i].button->gpio); |
| 564 | free_irq(irq, &ddata->data[i]); | 674 | free_irq(irq, &ddata->data[i]); |
| 565 | if (ddata->data[i].timer_debounce) | 675 | if (ddata->data[i].timer_debounce) |
| 566 | del_timer_sync(&ddata->data[i].timer); | 676 | del_timer_sync(&ddata->data[i].timer); |
| 567 | cancel_work_sync(&ddata->data[i].work); | 677 | cancel_work_sync(&ddata->data[i].work); |
| 568 | gpio_free(pdata->buttons[i].gpio); | 678 | gpio_free(ddata->data[i].button->gpio); |
| 569 | } | 679 | } |
| 570 | 680 | ||
| 571 | input_unregister_device(input); | 681 | input_unregister_device(input); |
| 572 | 682 | ||
| 683 | /* | ||
| 684 | * If we had no platform_data, we allocated buttons dynamically, and | ||
| 685 | * must free them here. ddata->data[0].button is the pointer to the | ||
| 686 | * beginning of the allocated array. | ||
| 687 | */ | ||
| 688 | if (!pdev->dev.platform_data) | ||
| 689 | kfree(ddata->data[0].button); | ||
| 690 | |||
| 691 | kfree(ddata); | ||
| 692 | |||
| 573 | return 0; | 693 | return 0; |
| 574 | } | 694 | } |
| 575 | 695 | ||
| 576 | 696 | #ifdef CONFIG_PM_SLEEP | |
| 577 | #ifdef CONFIG_PM | ||
| 578 | static int gpio_keys_suspend(struct device *dev) | 697 | static int gpio_keys_suspend(struct device *dev) |
| 579 | { | 698 | { |
| 580 | struct platform_device *pdev = to_platform_device(dev); | 699 | struct gpio_keys_drvdata *ddata = dev_get_drvdata(dev); |
| 581 | struct gpio_keys_platform_data *pdata = pdev->dev.platform_data; | ||
| 582 | int i; | 700 | int i; |
| 583 | 701 | ||
| 584 | if (device_may_wakeup(&pdev->dev)) { | 702 | if (device_may_wakeup(dev)) { |
| 585 | for (i = 0; i < pdata->nbuttons; i++) { | 703 | for (i = 0; i < ddata->n_buttons; i++) { |
| 586 | struct gpio_keys_button *button = &pdata->buttons[i]; | 704 | struct gpio_keys_button *button = ddata->data[i].button; |
| 587 | if (button->wakeup) { | 705 | if (button->wakeup) { |
| 588 | int irq = gpio_to_irq(button->gpio); | 706 | int irq = gpio_to_irq(button->gpio); |
| 589 | enable_irq_wake(irq); | 707 | enable_irq_wake(irq); |
| @@ -596,15 +714,13 @@ static int gpio_keys_suspend(struct device *dev) | |||
| 596 | 714 | ||
| 597 | static int gpio_keys_resume(struct device *dev) | 715 | static int gpio_keys_resume(struct device *dev) |
| 598 | { | 716 | { |
| 599 | struct platform_device *pdev = to_platform_device(dev); | 717 | struct gpio_keys_drvdata *ddata = dev_get_drvdata(dev); |
| 600 | struct gpio_keys_drvdata *ddata = platform_get_drvdata(pdev); | ||
| 601 | struct gpio_keys_platform_data *pdata = pdev->dev.platform_data; | ||
| 602 | int i; | 718 | int i; |
| 603 | 719 | ||
| 604 | for (i = 0; i < pdata->nbuttons; i++) { | 720 | for (i = 0; i < ddata->n_buttons; i++) { |
| 605 | 721 | ||
| 606 | struct gpio_keys_button *button = &pdata->buttons[i]; | 722 | struct gpio_keys_button *button = ddata->data[i].button; |
| 607 | if (button->wakeup && device_may_wakeup(&pdev->dev)) { | 723 | if (button->wakeup && device_may_wakeup(dev)) { |
| 608 | int irq = gpio_to_irq(button->gpio); | 724 | int irq = gpio_to_irq(button->gpio); |
| 609 | disable_irq_wake(irq); | 725 | disable_irq_wake(irq); |
| 610 | } | 726 | } |
| @@ -615,22 +731,18 @@ static int gpio_keys_resume(struct device *dev) | |||
| 615 | 731 | ||
| 616 | return 0; | 732 | return 0; |
| 617 | } | 733 | } |
| 618 | |||
| 619 | static const struct dev_pm_ops gpio_keys_pm_ops = { | ||
| 620 | .suspend = gpio_keys_suspend, | ||
| 621 | .resume = gpio_keys_resume, | ||
| 622 | }; | ||
| 623 | #endif | 734 | #endif |
| 624 | 735 | ||
| 736 | static SIMPLE_DEV_PM_OPS(gpio_keys_pm_ops, gpio_keys_suspend, gpio_keys_resume); | ||
| 737 | |||
| 625 | static struct platform_driver gpio_keys_device_driver = { | 738 | static struct platform_driver gpio_keys_device_driver = { |
| 626 | .probe = gpio_keys_probe, | 739 | .probe = gpio_keys_probe, |
| 627 | .remove = __devexit_p(gpio_keys_remove), | 740 | .remove = __devexit_p(gpio_keys_remove), |
| 628 | .driver = { | 741 | .driver = { |
| 629 | .name = "gpio-keys", | 742 | .name = "gpio-keys", |
| 630 | .owner = THIS_MODULE, | 743 | .owner = THIS_MODULE, |
| 631 | #ifdef CONFIG_PM | ||
| 632 | .pm = &gpio_keys_pm_ops, | 744 | .pm = &gpio_keys_pm_ops, |
| 633 | #endif | 745 | .of_match_table = gpio_keys_of_match, |
| 634 | } | 746 | } |
| 635 | }; | 747 | }; |
| 636 | 748 | ||
| @@ -644,10 +756,10 @@ static void __exit gpio_keys_exit(void) | |||
| 644 | platform_driver_unregister(&gpio_keys_device_driver); | 756 | platform_driver_unregister(&gpio_keys_device_driver); |
| 645 | } | 757 | } |
| 646 | 758 | ||
| 647 | module_init(gpio_keys_init); | 759 | late_initcall(gpio_keys_init); |
| 648 | module_exit(gpio_keys_exit); | 760 | module_exit(gpio_keys_exit); |
| 649 | 761 | ||
| 650 | MODULE_LICENSE("GPL"); | 762 | MODULE_LICENSE("GPL"); |
| 651 | MODULE_AUTHOR("Phil Blundell <pb@handhelds.org>"); | 763 | MODULE_AUTHOR("Phil Blundell <pb@handhelds.org>"); |
| 652 | MODULE_DESCRIPTION("Keyboard driver for CPU GPIOs"); | 764 | MODULE_DESCRIPTION("Keyboard driver for GPIOs"); |
| 653 | MODULE_ALIAS("platform:gpio-keys"); | 765 | MODULE_ALIAS("platform:gpio-keys"); |
diff --git a/drivers/input/keyboard/lm8323.c b/drivers/input/keyboard/lm8323.c index 71f744a8e686..ab0acaf7fe8f 100644 --- a/drivers/input/keyboard/lm8323.c +++ b/drivers/input/keyboard/lm8323.c | |||
| @@ -146,7 +146,6 @@ struct lm8323_chip { | |||
| 146 | /* device lock */ | 146 | /* device lock */ |
| 147 | struct mutex lock; | 147 | struct mutex lock; |
| 148 | struct i2c_client *client; | 148 | struct i2c_client *client; |
| 149 | struct work_struct work; | ||
| 150 | struct input_dev *idev; | 149 | struct input_dev *idev; |
| 151 | bool kp_enabled; | 150 | bool kp_enabled; |
| 152 | bool pm_suspend; | 151 | bool pm_suspend; |
| @@ -162,7 +161,6 @@ struct lm8323_chip { | |||
| 162 | 161 | ||
| 163 | #define client_to_lm8323(c) container_of(c, struct lm8323_chip, client) | 162 | #define client_to_lm8323(c) container_of(c, struct lm8323_chip, client) |
| 164 | #define dev_to_lm8323(d) container_of(d, struct lm8323_chip, client->dev) | 163 | #define dev_to_lm8323(d) container_of(d, struct lm8323_chip, client->dev) |
| 165 | #define work_to_lm8323(w) container_of(w, struct lm8323_chip, work) | ||
| 166 | #define cdev_to_pwm(c) container_of(c, struct lm8323_pwm, cdev) | 164 | #define cdev_to_pwm(c) container_of(c, struct lm8323_pwm, cdev) |
| 167 | #define work_to_pwm(w) container_of(w, struct lm8323_pwm, work) | 165 | #define work_to_pwm(w) container_of(w, struct lm8323_pwm, work) |
| 168 | 166 | ||
| @@ -375,9 +373,9 @@ static void pwm_done(struct lm8323_pwm *pwm) | |||
| 375 | * Bottom half: handle the interrupt by posting key events, or dealing with | 373 | * Bottom half: handle the interrupt by posting key events, or dealing with |
| 376 | * errors appropriately. | 374 | * errors appropriately. |
| 377 | */ | 375 | */ |
| 378 | static void lm8323_work(struct work_struct *work) | 376 | static irqreturn_t lm8323_irq(int irq, void *_lm) |
| 379 | { | 377 | { |
| 380 | struct lm8323_chip *lm = work_to_lm8323(work); | 378 | struct lm8323_chip *lm = _lm; |
| 381 | u8 ints; | 379 | u8 ints; |
| 382 | int i; | 380 | int i; |
| 383 | 381 | ||
| @@ -409,16 +407,6 @@ static void lm8323_work(struct work_struct *work) | |||
| 409 | } | 407 | } |
| 410 | 408 | ||
| 411 | mutex_unlock(&lm->lock); | 409 | mutex_unlock(&lm->lock); |
| 412 | } | ||
| 413 | |||
| 414 | /* | ||
| 415 | * We cannot use I2C in interrupt context, so we just schedule work. | ||
| 416 | */ | ||
| 417 | static irqreturn_t lm8323_irq(int irq, void *data) | ||
| 418 | { | ||
| 419 | struct lm8323_chip *lm = data; | ||
| 420 | |||
| 421 | schedule_work(&lm->work); | ||
| 422 | 410 | ||
| 423 | return IRQ_HANDLED; | 411 | return IRQ_HANDLED; |
| 424 | } | 412 | } |
| @@ -675,7 +663,6 @@ static int __devinit lm8323_probe(struct i2c_client *client, | |||
| 675 | lm->client = client; | 663 | lm->client = client; |
| 676 | lm->idev = idev; | 664 | lm->idev = idev; |
| 677 | mutex_init(&lm->lock); | 665 | mutex_init(&lm->lock); |
| 678 | INIT_WORK(&lm->work, lm8323_work); | ||
| 679 | 666 | ||
| 680 | lm->size_x = pdata->size_x; | 667 | lm->size_x = pdata->size_x; |
| 681 | lm->size_y = pdata->size_y; | 668 | lm->size_y = pdata->size_y; |
| @@ -746,9 +733,8 @@ static int __devinit lm8323_probe(struct i2c_client *client, | |||
| 746 | goto fail3; | 733 | goto fail3; |
| 747 | } | 734 | } |
| 748 | 735 | ||
| 749 | err = request_irq(client->irq, lm8323_irq, | 736 | err = request_threaded_irq(client->irq, NULL, lm8323_irq, |
| 750 | IRQF_TRIGGER_FALLING | IRQF_DISABLED, | 737 | IRQF_TRIGGER_LOW|IRQF_ONESHOT, "lm8323", lm); |
| 751 | "lm8323", lm); | ||
| 752 | if (err) { | 738 | if (err) { |
| 753 | dev_err(&client->dev, "could not get IRQ %d\n", client->irq); | 739 | dev_err(&client->dev, "could not get IRQ %d\n", client->irq); |
| 754 | goto fail4; | 740 | goto fail4; |
| @@ -783,7 +769,6 @@ static int __devexit lm8323_remove(struct i2c_client *client) | |||
| 783 | 769 | ||
| 784 | disable_irq_wake(client->irq); | 770 | disable_irq_wake(client->irq); |
| 785 | free_irq(client->irq, lm); | 771 | free_irq(client->irq, lm); |
| 786 | cancel_work_sync(&lm->work); | ||
| 787 | 772 | ||
| 788 | input_unregister_device(lm->idev); | 773 | input_unregister_device(lm->idev); |
| 789 | 774 | ||
diff --git a/drivers/input/keyboard/mpr121_touchkey.c b/drivers/input/keyboard/mpr121_touchkey.c index 0a9e81194888..1c1615d9a7f9 100644 --- a/drivers/input/keyboard/mpr121_touchkey.c +++ b/drivers/input/keyboard/mpr121_touchkey.c | |||
| @@ -43,14 +43,15 @@ | |||
| 43 | * enabled capacitance sensing inputs and its run/suspend mode. | 43 | * enabled capacitance sensing inputs and its run/suspend mode. |
| 44 | */ | 44 | */ |
| 45 | #define ELECTRODE_CONF_ADDR 0x5e | 45 | #define ELECTRODE_CONF_ADDR 0x5e |
| 46 | #define ELECTRODE_CONF_QUICK_CHARGE 0x80 | ||
| 46 | #define AUTO_CONFIG_CTRL_ADDR 0x7b | 47 | #define AUTO_CONFIG_CTRL_ADDR 0x7b |
| 47 | #define AUTO_CONFIG_USL_ADDR 0x7d | 48 | #define AUTO_CONFIG_USL_ADDR 0x7d |
| 48 | #define AUTO_CONFIG_LSL_ADDR 0x7e | 49 | #define AUTO_CONFIG_LSL_ADDR 0x7e |
| 49 | #define AUTO_CONFIG_TL_ADDR 0x7f | 50 | #define AUTO_CONFIG_TL_ADDR 0x7f |
| 50 | 51 | ||
| 51 | /* Threshold of touch/release trigger */ | 52 | /* Threshold of touch/release trigger */ |
| 52 | #define TOUCH_THRESHOLD 0x0f | 53 | #define TOUCH_THRESHOLD 0x08 |
| 53 | #define RELEASE_THRESHOLD 0x0a | 54 | #define RELEASE_THRESHOLD 0x05 |
| 54 | /* Masks for touch and release triggers */ | 55 | /* Masks for touch and release triggers */ |
| 55 | #define TOUCH_STATUS_MASK 0xfff | 56 | #define TOUCH_STATUS_MASK 0xfff |
| 56 | /* MPR121 has 12 keys */ | 57 | /* MPR121 has 12 keys */ |
| @@ -127,7 +128,7 @@ static int __devinit mpr121_phys_init(const struct mpr121_platform_data *pdata, | |||
| 127 | struct i2c_client *client) | 128 | struct i2c_client *client) |
| 128 | { | 129 | { |
| 129 | const struct mpr121_init_register *reg; | 130 | const struct mpr121_init_register *reg; |
| 130 | unsigned char usl, lsl, tl; | 131 | unsigned char usl, lsl, tl, eleconf; |
| 131 | int i, t, vdd, ret; | 132 | int i, t, vdd, ret; |
| 132 | 133 | ||
| 133 | /* Set up touch/release threshold for ele0-ele11 */ | 134 | /* Set up touch/release threshold for ele0-ele11 */ |
| @@ -163,8 +164,15 @@ static int __devinit mpr121_phys_init(const struct mpr121_platform_data *pdata, | |||
| 163 | ret = i2c_smbus_write_byte_data(client, AUTO_CONFIG_USL_ADDR, usl); | 164 | ret = i2c_smbus_write_byte_data(client, AUTO_CONFIG_USL_ADDR, usl); |
| 164 | ret |= i2c_smbus_write_byte_data(client, AUTO_CONFIG_LSL_ADDR, lsl); | 165 | ret |= i2c_smbus_write_byte_data(client, AUTO_CONFIG_LSL_ADDR, lsl); |
| 165 | ret |= i2c_smbus_write_byte_data(client, AUTO_CONFIG_TL_ADDR, tl); | 166 | ret |= i2c_smbus_write_byte_data(client, AUTO_CONFIG_TL_ADDR, tl); |
| 167 | |||
| 168 | /* | ||
| 169 | * Quick charge bit will let the capacitive charge to ready | ||
| 170 | * state quickly, or the buttons may not function after system | ||
| 171 | * boot. | ||
| 172 | */ | ||
| 173 | eleconf = mpr121->keycount | ELECTRODE_CONF_QUICK_CHARGE; | ||
| 166 | ret |= i2c_smbus_write_byte_data(client, ELECTRODE_CONF_ADDR, | 174 | ret |= i2c_smbus_write_byte_data(client, ELECTRODE_CONF_ADDR, |
| 167 | mpr121->keycount); | 175 | eleconf); |
| 168 | if (ret != 0) | 176 | if (ret != 0) |
| 169 | goto err_i2c_write; | 177 | goto err_i2c_write; |
| 170 | 178 | ||
diff --git a/drivers/input/keyboard/pmic8xxx-keypad.c b/drivers/input/keyboard/pmic8xxx-keypad.c index 6229c3e8e78b..e7cc51d0fb34 100644 --- a/drivers/input/keyboard/pmic8xxx-keypad.c +++ b/drivers/input/keyboard/pmic8xxx-keypad.c | |||
| @@ -700,9 +700,9 @@ static int __devinit pmic8xxx_kp_probe(struct platform_device *pdev) | |||
| 700 | return 0; | 700 | return 0; |
| 701 | 701 | ||
| 702 | err_pmic_reg_read: | 702 | err_pmic_reg_read: |
| 703 | free_irq(kp->key_stuck_irq, NULL); | 703 | free_irq(kp->key_stuck_irq, kp); |
| 704 | err_req_stuck_irq: | 704 | err_req_stuck_irq: |
| 705 | free_irq(kp->key_sense_irq, NULL); | 705 | free_irq(kp->key_sense_irq, kp); |
| 706 | err_gpio_config: | 706 | err_gpio_config: |
| 707 | err_get_irq: | 707 | err_get_irq: |
| 708 | input_free_device(kp->input); | 708 | input_free_device(kp->input); |
| @@ -717,8 +717,8 @@ static int __devexit pmic8xxx_kp_remove(struct platform_device *pdev) | |||
| 717 | struct pmic8xxx_kp *kp = platform_get_drvdata(pdev); | 717 | struct pmic8xxx_kp *kp = platform_get_drvdata(pdev); |
| 718 | 718 | ||
| 719 | device_init_wakeup(&pdev->dev, 0); | 719 | device_init_wakeup(&pdev->dev, 0); |
| 720 | free_irq(kp->key_stuck_irq, NULL); | 720 | free_irq(kp->key_stuck_irq, kp); |
| 721 | free_irq(kp->key_sense_irq, NULL); | 721 | free_irq(kp->key_sense_irq, kp); |
| 722 | input_unregister_device(kp->input); | 722 | input_unregister_device(kp->input); |
| 723 | kfree(kp); | 723 | kfree(kp); |
| 724 | 724 | ||
diff --git a/drivers/input/keyboard/qt1070.c b/drivers/input/keyboard/qt1070.c index ca7b89196ab7..b21bf5b876bb 100644 --- a/drivers/input/keyboard/qt1070.c +++ b/drivers/input/keyboard/qt1070.c | |||
| @@ -239,8 +239,6 @@ static int __devexit qt1070_remove(struct i2c_client *client) | |||
| 239 | input_unregister_device(data->input); | 239 | input_unregister_device(data->input); |
| 240 | kfree(data); | 240 | kfree(data); |
| 241 | 241 | ||
| 242 | i2c_set_clientdata(client, NULL); | ||
| 243 | |||
| 244 | return 0; | 242 | return 0; |
| 245 | } | 243 | } |
| 246 | 244 | ||
diff --git a/drivers/input/keyboard/sh_keysc.c b/drivers/input/keyboard/sh_keysc.c index 6876700a4469..934aeb583b30 100644 --- a/drivers/input/keyboard/sh_keysc.c +++ b/drivers/input/keyboard/sh_keysc.c | |||
| @@ -291,7 +291,7 @@ static int __devexit sh_keysc_remove(struct platform_device *pdev) | |||
| 291 | return 0; | 291 | return 0; |
| 292 | } | 292 | } |
| 293 | 293 | ||
| 294 | #if CONFIG_PM_SLEEP | 294 | #ifdef CONFIG_PM_SLEEP |
| 295 | static int sh_keysc_suspend(struct device *dev) | 295 | static int sh_keysc_suspend(struct device *dev) |
| 296 | { | 296 | { |
| 297 | struct platform_device *pdev = to_platform_device(dev); | 297 | struct platform_device *pdev = to_platform_device(dev); |
diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c index 2b3b73ec6689..da3828fc2c09 100644 --- a/drivers/input/keyboard/tegra-kbc.c +++ b/drivers/input/keyboard/tegra-kbc.c | |||
| @@ -657,7 +657,7 @@ static int __devinit tegra_kbc_probe(struct platform_device *pdev) | |||
| 657 | 657 | ||
| 658 | input_set_drvdata(input_dev, kbc); | 658 | input_set_drvdata(input_dev, kbc); |
| 659 | 659 | ||
| 660 | input_dev->evbit[0] = BIT_MASK(EV_KEY); | 660 | input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP); |
| 661 | input_set_capability(input_dev, EV_MSC, MSC_SCAN); | 661 | input_set_capability(input_dev, EV_MSC, MSC_SCAN); |
| 662 | 662 | ||
| 663 | input_dev->keycode = kbc->keycode; | 663 | input_dev->keycode = kbc->keycode; |
diff --git a/drivers/input/keyboard/tnetv107x-keypad.c b/drivers/input/keyboard/tnetv107x-keypad.c index c8f097a15d89..1c58681de81f 100644 --- a/drivers/input/keyboard/tnetv107x-keypad.c +++ b/drivers/input/keyboard/tnetv107x-keypad.c | |||
| @@ -337,5 +337,5 @@ module_exit(keypad_exit); | |||
| 337 | 337 | ||
| 338 | MODULE_AUTHOR("Cyril Chemparathy"); | 338 | MODULE_AUTHOR("Cyril Chemparathy"); |
| 339 | MODULE_DESCRIPTION("TNETV107X Keypad Driver"); | 339 | MODULE_DESCRIPTION("TNETV107X Keypad Driver"); |
| 340 | MODULE_ALIAS("platform: tnetv107x-keypad"); | 340 | MODULE_ALIAS("platform:tnetv107x-keypad"); |
| 341 | MODULE_LICENSE("GPL"); | 341 | MODULE_LICENSE("GPL"); |
