aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-15 19:08:50 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-15 19:08:50 -0400
commit65a6ec0d72a07f16719e9b7a96e1c4bae044b591 (patch)
tree344e03a5039a44982c1b78d6113633b21b434820 /drivers/input
parent541010e4b8921cd781ff02ae68028501457045b6 (diff)
parent0181b61a988424b5cc44fe09e6968142359c815e (diff)
Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm: (95 commits) [ARM] 4578/1: CM-x270: PCMCIA support [ARM] 4577/1: ITE 8152 PCI bridge support [ARM] 4576/1: CM-X270 machine support [ARM] pxa: Avoid pxa_gpio_mode() in gpio_direction_{in,out}put() [ARM] pxa: move pxa_set_mode() from pxa2xx_mainstone.c to mainstone.c [ARM] pxa: move pxa_set_mode() from pxa2xx_lubbock.c to lubbock.c [ARM] pxa: Make cpu_is_pxaXXX dependent on configuration symbols [ARM] pxa: PXA3xx base support [NET] smc91x: fix PXA DMA support code [SERIAL] Fix console initialisation ordering [ARM] pxa: tidy up arch/arm/mach-pxa/Makefile [ARM] Update arch/arm/Kconfig for drivers/Kconfig changes [ARM] 4600/1: fix kernel build failure with build-id-supporting binutils [ARM] 4599/1: Preserve ATAG list for use with kexec (2.6.23) [ARM] Rename consistent_sync() as dma_cache_maint() [ARM] 4572/1: ep93xx: add cirrus logic edb9307 support [ARM] 4596/1: S3C2412: Correct IRQs for SDI+CF and add decoding support [ARM] 4595/1: ns9xxx: define registers as void __iomem * instead of volatile u32 [ARM] 4594/1: ns9xxx: use the new gpio functions [ARM] 4593/1: ns9xxx: implement generic clockevents ...
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/keyboard/pxa27x_keyboard.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/drivers/input/keyboard/pxa27x_keyboard.c b/drivers/input/keyboard/pxa27x_keyboard.c
index ebe5eacf299..b7061aa3881 100644
--- a/drivers/input/keyboard/pxa27x_keyboard.c
+++ b/drivers/input/keyboard/pxa27x_keyboard.c
@@ -23,6 +23,8 @@
23#include <linux/input.h> 23#include <linux/input.h>
24#include <linux/device.h> 24#include <linux/device.h>
25#include <linux/platform_device.h> 25#include <linux/platform_device.h>
26#include <linux/clk.h>
27#include <linux/err.h>
26 28
27#include <asm/mach-types.h> 29#include <asm/mach-types.h>
28#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
@@ -40,6 +42,8 @@
40 col/2 == 2 ? KPASMKP2 : KPASMKP3) 42 col/2 == 2 ? KPASMKP2 : KPASMKP3)
41#define KPASMKPx_MKC(row, col) (1 << (row + 16 * (col % 2))) 43#define KPASMKPx_MKC(row, col) (1 << (row + 16 * (col % 2)))
42 44
45static struct clk *pxakbd_clk;
46
43static irqreturn_t pxakbd_irq_handler(int irq, void *dev_id) 47static irqreturn_t pxakbd_irq_handler(int irq, void *dev_id)
44{ 48{
45 struct platform_device *pdev = dev_id; 49 struct platform_device *pdev = dev_id;
@@ -104,7 +108,7 @@ static int pxakbd_open(struct input_dev *dev)
104 KPREC = 0x7F; 108 KPREC = 0x7F;
105 109
106 /* Enable unit clock */ 110 /* Enable unit clock */
107 pxa_set_cken(CKEN_KEYPAD, 1); 111 clk_enable(pxakbd_clk);
108 112
109 return 0; 113 return 0;
110} 114}
@@ -112,7 +116,7 @@ static int pxakbd_open(struct input_dev *dev)
112static void pxakbd_close(struct input_dev *dev) 116static void pxakbd_close(struct input_dev *dev)
113{ 117{
114 /* Disable clock unit */ 118 /* Disable clock unit */
115 pxa_set_cken(CKEN_KEYPAD, 0); 119 clk_disable(pxakbd_clk);
116} 120}
117 121
118#ifdef CONFIG_PM 122#ifdef CONFIG_PM
@@ -140,7 +144,8 @@ static int pxakbd_resume(struct platform_device *pdev)
140 KPREC = pdata->reg_kprec; 144 KPREC = pdata->reg_kprec;
141 145
142 /* Enable unit clock */ 146 /* Enable unit clock */
143 pxa_set_cken(CKEN_KEYPAD, 1); 147 clk_disable(pxakbd_clk);
148 clk_enable(pxakbd_clk);
144 } 149 }
145 150
146 mutex_unlock(&input_dev->mutex); 151 mutex_unlock(&input_dev->mutex);
@@ -158,11 +163,18 @@ static int __devinit pxakbd_probe(struct platform_device *pdev)
158 struct input_dev *input_dev; 163 struct input_dev *input_dev;
159 int i, row, col, error; 164 int i, row, col, error;
160 165
166 pxakbd_clk = clk_get(&pdev->dev, "KBDCLK");
167 if (IS_ERR(pxakbd_clk)) {
168 error = PTR_ERR(pxakbd_clk);
169 goto err_clk;
170 }
171
161 /* Create and register the input driver. */ 172 /* Create and register the input driver. */
162 input_dev = input_allocate_device(); 173 input_dev = input_allocate_device();
163 if (!input_dev) { 174 if (!input_dev) {
164 printk(KERN_ERR "Cannot request keypad device\n"); 175 printk(KERN_ERR "Cannot request keypad device\n");
165 return -ENOMEM; 176 error = -ENOMEM;
177 goto err_alloc;
166 } 178 }
167 179
168 input_dev->name = DRIVER_NAME; 180 input_dev->name = DRIVER_NAME;
@@ -185,7 +197,6 @@ static int __devinit pxakbd_probe(struct platform_device *pdev)
185 DRIVER_NAME, pdev); 197 DRIVER_NAME, pdev);
186 if (error) { 198 if (error) {
187 printk(KERN_ERR "Cannot request keypad IRQ\n"); 199 printk(KERN_ERR "Cannot request keypad IRQ\n");
188 pxa_set_cken(CKEN_KEYPAD, 0);
189 goto err_free_dev; 200 goto err_free_dev;
190 } 201 }
191 202
@@ -217,6 +228,9 @@ static int __devinit pxakbd_probe(struct platform_device *pdev)
217 free_irq(IRQ_KEYPAD, pdev); 228 free_irq(IRQ_KEYPAD, pdev);
218 err_free_dev: 229 err_free_dev:
219 input_free_device(input_dev); 230 input_free_device(input_dev);
231 err_alloc:
232 clk_put(pxakbd_clk);
233 err_clk:
220 return error; 234 return error;
221} 235}
222 236
@@ -226,6 +240,7 @@ static int __devexit pxakbd_remove(struct platform_device *pdev)
226 240
227 input_unregister_device(input_dev); 241 input_unregister_device(input_dev);
228 free_irq(IRQ_KEYPAD, pdev); 242 free_irq(IRQ_KEYPAD, pdev);
243 clk_put(pxakbd_clk);
229 platform_set_drvdata(pdev, NULL); 244 platform_set_drvdata(pdev, NULL);
230 245
231 return 0; 246 return 0;