pxa27x_keypad.c (4d6ca227c768b50b05cf183974b40abe444e9d0c) | pxa27x_keypad.c (117b2dc58c07924da7f545f93a1f5862f46e14f7) |
---|---|
1/* 2 * linux/drivers/input/keyboard/pxa27x_keypad.c 3 * 4 * Driver for the pxa27x matrix keyboard controller. 5 * 6 * Created: Feb 22, 2007 7 * Author: Rodolfo Giometti <giometti@linux.it> 8 * --- 630 unchanged lines hidden (view full) --- 639 keypad_writel(KPC, kpc | KPC_RE_ZERO_DEB); 640 keypad_writel(KPREC, DEFAULT_KPREC); 641 keypad_writel(KPKDI, pdata->debounce_interval); 642} 643 644static int pxa27x_keypad_open(struct input_dev *dev) 645{ 646 struct pxa27x_keypad *keypad = input_get_drvdata(dev); | 1/* 2 * linux/drivers/input/keyboard/pxa27x_keypad.c 3 * 4 * Driver for the pxa27x matrix keyboard controller. 5 * 6 * Created: Feb 22, 2007 7 * Author: Rodolfo Giometti <giometti@linux.it> 8 * --- 630 unchanged lines hidden (view full) --- 639 keypad_writel(KPC, kpc | KPC_RE_ZERO_DEB); 640 keypad_writel(KPREC, DEFAULT_KPREC); 641 keypad_writel(KPKDI, pdata->debounce_interval); 642} 643 644static int pxa27x_keypad_open(struct input_dev *dev) 645{ 646 struct pxa27x_keypad *keypad = input_get_drvdata(dev); |
647 | 647 int ret; |
648 /* Enable unit clock */ | 648 /* Enable unit clock */ |
649 clk_prepare_enable(keypad->clk); | 649 ret = clk_prepare_enable(keypad->clk); 650 if (ret) 651 return ret; 652 |
650 pxa27x_keypad_config(keypad); 651 652 return 0; 653} 654 655static void pxa27x_keypad_close(struct input_dev *dev) 656{ 657 struct pxa27x_keypad *keypad = input_get_drvdata(dev); --- 20 unchanged lines hidden (view full) --- 678 return 0; 679} 680 681static int pxa27x_keypad_resume(struct device *dev) 682{ 683 struct platform_device *pdev = to_platform_device(dev); 684 struct pxa27x_keypad *keypad = platform_get_drvdata(pdev); 685 struct input_dev *input_dev = keypad->input_dev; | 653 pxa27x_keypad_config(keypad); 654 655 return 0; 656} 657 658static void pxa27x_keypad_close(struct input_dev *dev) 659{ 660 struct pxa27x_keypad *keypad = input_get_drvdata(dev); --- 20 unchanged lines hidden (view full) --- 681 return 0; 682} 683 684static int pxa27x_keypad_resume(struct device *dev) 685{ 686 struct platform_device *pdev = to_platform_device(dev); 687 struct pxa27x_keypad *keypad = platform_get_drvdata(pdev); 688 struct input_dev *input_dev = keypad->input_dev; |
689 int ret = 0; |
|
686 687 /* 688 * If the keypad is used as wake up source, the clock is not turned 689 * off. So do not need configure it again. 690 */ 691 if (device_may_wakeup(&pdev->dev)) { 692 disable_irq_wake(keypad->irq); 693 } else { 694 mutex_lock(&input_dev->mutex); 695 696 if (input_dev->users) { 697 /* Enable unit clock */ | 690 691 /* 692 * If the keypad is used as wake up source, the clock is not turned 693 * off. So do not need configure it again. 694 */ 695 if (device_may_wakeup(&pdev->dev)) { 696 disable_irq_wake(keypad->irq); 697 } else { 698 mutex_lock(&input_dev->mutex); 699 700 if (input_dev->users) { 701 /* Enable unit clock */ |
698 clk_prepare_enable(keypad->clk); 699 pxa27x_keypad_config(keypad); | 702 ret = clk_prepare_enable(keypad->clk); 703 if (!ret) 704 pxa27x_keypad_config(keypad); |
700 } 701 702 mutex_unlock(&input_dev->mutex); 703 } 704 | 705 } 706 707 mutex_unlock(&input_dev->mutex); 708 } 709 |
705 return 0; | 710 return ret; |
706} 707#endif 708 709static SIMPLE_DEV_PM_OPS(pxa27x_keypad_pm_ops, 710 pxa27x_keypad_suspend, pxa27x_keypad_resume); 711 712 713static int pxa27x_keypad_probe(struct platform_device *pdev) --- 128 unchanged lines hidden --- | 711} 712#endif 713 714static SIMPLE_DEV_PM_OPS(pxa27x_keypad_pm_ops, 715 pxa27x_keypad_suspend, pxa27x_keypad_resume); 716 717 718static int pxa27x_keypad_probe(struct platform_device *pdev) --- 128 unchanged lines hidden --- |