aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/keyboard/sh_keysc.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2009-09-16 00:48:32 -0400
committerPaul Mundt <lethal@linux-sh.org>2009-09-16 00:48:32 -0400
commitea88023b3491a384575ebcd5e8a449e841a28a24 (patch)
treef46e3d8302e44dc55ce31823501e100472d29683 /drivers/input/keyboard/sh_keysc.c
parenta6f15ade97989d414e9bf33874c9d5d1f39808ec (diff)
parent0cb583fd2862f19ea88b02eb307d11c09e51e2f8 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts: arch/sh/kernel/vmlinux.lds.S
Diffstat (limited to 'drivers/input/keyboard/sh_keysc.c')
-rw-r--r--drivers/input/keyboard/sh_keysc.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/drivers/input/keyboard/sh_keysc.c b/drivers/input/keyboard/sh_keysc.c
index 68fd502fcfef..887af79b7bff 100644
--- a/drivers/input/keyboard/sh_keysc.c
+++ b/drivers/input/keyboard/sh_keysc.c
@@ -131,7 +131,7 @@ static int __devinit sh_keysc_probe(struct platform_device *pdev)
131 struct resource *res; 131 struct resource *res;
132 struct input_dev *input; 132 struct input_dev *input;
133 char clk_name[8]; 133 char clk_name[8];
134 int i, k; 134 int i;
135 int irq, error; 135 int irq, error;
136 136
137 if (!pdev->dev.platform_data) { 137 if (!pdev->dev.platform_data) {
@@ -198,17 +198,19 @@ static int __devinit sh_keysc_probe(struct platform_device *pdev)
198 input->id.product = 0x0001; 198 input->id.product = 0x0001;
199 input->id.version = 0x0100; 199 input->id.version = 0x0100;
200 200
201 input->keycode = pdata->keycodes;
202 input->keycodesize = sizeof(pdata->keycodes[0]);
203 input->keycodemax = ARRAY_SIZE(pdata->keycodes);
204
201 error = request_irq(irq, sh_keysc_isr, 0, pdev->name, pdev); 205 error = request_irq(irq, sh_keysc_isr, 0, pdev->name, pdev);
202 if (error) { 206 if (error) {
203 dev_err(&pdev->dev, "failed to request IRQ\n"); 207 dev_err(&pdev->dev, "failed to request IRQ\n");
204 goto err4; 208 goto err4;
205 } 209 }
206 210
207 for (i = 0; i < SH_KEYSC_MAXKEYS; i++) { 211 for (i = 0; i < SH_KEYSC_MAXKEYS; i++)
208 k = pdata->keycodes[i]; 212 __set_bit(pdata->keycodes[i], input->keybit);
209 if (k) 213 __clear_bit(KEY_RESERVED, input->keybit);
210 input_set_capability(input, EV_KEY, k);
211 }
212 214
213 error = input_register_device(input); 215 error = input_register_device(input);
214 if (error) { 216 if (error) {
@@ -224,7 +226,9 @@ static int __devinit sh_keysc_probe(struct platform_device *pdev)
224 iowrite16(KYCR2_IRQ_LEVEL, priv->iomem_base + KYCR2_OFFS); 226 iowrite16(KYCR2_IRQ_LEVEL, priv->iomem_base + KYCR2_OFFS);
225 227
226 device_init_wakeup(&pdev->dev, 1); 228 device_init_wakeup(&pdev->dev, 1);
229
227 return 0; 230 return 0;
231
228 err5: 232 err5:
229 free_irq(irq, pdev); 233 free_irq(irq, pdev);
230 err4: 234 err4:
@@ -255,6 +259,7 @@ static int __devexit sh_keysc_remove(struct platform_device *pdev)
255 259
256 platform_set_drvdata(pdev, NULL); 260 platform_set_drvdata(pdev, NULL);
257 kfree(priv); 261 kfree(priv);
262
258 return 0; 263 return 0;
259} 264}
260 265
@@ -270,11 +275,12 @@ static int sh_keysc_suspend(struct device *dev)
270 if (device_may_wakeup(dev)) { 275 if (device_may_wakeup(dev)) {
271 value |= 0x80; 276 value |= 0x80;
272 enable_irq_wake(irq); 277 enable_irq_wake(irq);
273 } 278 } else {
274 else
275 value &= ~0x80; 279 value &= ~0x80;
280 }
276 281
277 iowrite16(value, priv->iomem_base + KYCR1_OFFS); 282 iowrite16(value, priv->iomem_base + KYCR1_OFFS);
283
278 return 0; 284 return 0;
279} 285}
280 286