diff options
Diffstat (limited to 'drivers/input/keyboard/corgikbd.c')
-rw-r--r-- | drivers/input/keyboard/corgikbd.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/drivers/input/keyboard/corgikbd.c b/drivers/input/keyboard/corgikbd.c index d00d14bb637..64672d49122 100644 --- a/drivers/input/keyboard/corgikbd.c +++ b/drivers/input/keyboard/corgikbd.c | |||
@@ -259,17 +259,17 @@ static void corgikbd_hinge_timer(unsigned long data) | |||
259 | } | 259 | } |
260 | 260 | ||
261 | #ifdef CONFIG_PM | 261 | #ifdef CONFIG_PM |
262 | static int corgikbd_suspend(struct device *dev, pm_message_t state) | 262 | static int corgikbd_suspend(struct platform_device *dev, pm_message_t state) |
263 | { | 263 | { |
264 | struct corgikbd *corgikbd = dev_get_drvdata(dev); | 264 | struct corgikbd *corgikbd = platform_get_drvdata(dev); |
265 | corgikbd->suspended = 1; | 265 | corgikbd->suspended = 1; |
266 | 266 | ||
267 | return 0; | 267 | return 0; |
268 | } | 268 | } |
269 | 269 | ||
270 | static int corgikbd_resume(struct device *dev) | 270 | static int corgikbd_resume(struct platform_device *dev) |
271 | { | 271 | { |
272 | struct corgikbd *corgikbd = dev_get_drvdata(dev); | 272 | struct corgikbd *corgikbd = platform_get_drvdata(dev); |
273 | 273 | ||
274 | /* Upon resume, ignore the suspend key for a short while */ | 274 | /* Upon resume, ignore the suspend key for a short while */ |
275 | corgikbd->suspend_jiffies=jiffies; | 275 | corgikbd->suspend_jiffies=jiffies; |
@@ -282,7 +282,7 @@ static int corgikbd_resume(struct device *dev) | |||
282 | #define corgikbd_resume NULL | 282 | #define corgikbd_resume NULL |
283 | #endif | 283 | #endif |
284 | 284 | ||
285 | static int __init corgikbd_probe(struct device *dev) | 285 | static int __init corgikbd_probe(struct platform_device *pdev) |
286 | { | 286 | { |
287 | struct corgikbd *corgikbd; | 287 | struct corgikbd *corgikbd; |
288 | struct input_dev *input_dev; | 288 | struct input_dev *input_dev; |
@@ -296,7 +296,7 @@ static int __init corgikbd_probe(struct device *dev) | |||
296 | return -ENOMEM; | 296 | return -ENOMEM; |
297 | } | 297 | } |
298 | 298 | ||
299 | dev_set_drvdata(dev, corgikbd); | 299 | platform_set_drvdata(pdev, corgikbd); |
300 | 300 | ||
301 | corgikbd->input = input_dev; | 301 | corgikbd->input = input_dev; |
302 | spin_lock_init(&corgikbd->lock); | 302 | spin_lock_init(&corgikbd->lock); |
@@ -321,7 +321,7 @@ static int __init corgikbd_probe(struct device *dev) | |||
321 | input_dev->id.vendor = 0x0001; | 321 | input_dev->id.vendor = 0x0001; |
322 | input_dev->id.product = 0x0001; | 322 | input_dev->id.product = 0x0001; |
323 | input_dev->id.version = 0x0100; | 323 | input_dev->id.version = 0x0100; |
324 | input_dev->cdev.dev = dev; | 324 | input_dev->cdev.dev = &pdev->dev; |
325 | input_dev->private = corgikbd; | 325 | input_dev->private = corgikbd; |
326 | 326 | ||
327 | input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP) | BIT(EV_PWR) | BIT(EV_SW); | 327 | input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP) | BIT(EV_PWR) | BIT(EV_SW); |
@@ -356,10 +356,10 @@ static int __init corgikbd_probe(struct device *dev) | |||
356 | return 0; | 356 | return 0; |
357 | } | 357 | } |
358 | 358 | ||
359 | static int corgikbd_remove(struct device *dev) | 359 | static int corgikbd_remove(struct platform_device *pdev) |
360 | { | 360 | { |
361 | int i; | 361 | int i; |
362 | struct corgikbd *corgikbd = dev_get_drvdata(dev); | 362 | struct corgikbd *corgikbd = platform_get_drvdata(pdev); |
363 | 363 | ||
364 | for (i = 0; i < CORGI_KEY_SENSE_NUM; i++) | 364 | for (i = 0; i < CORGI_KEY_SENSE_NUM; i++) |
365 | free_irq(CORGI_IRQ_GPIO_KEY_SENSE(i), corgikbd); | 365 | free_irq(CORGI_IRQ_GPIO_KEY_SENSE(i), corgikbd); |
@@ -374,23 +374,24 @@ static int corgikbd_remove(struct device *dev) | |||
374 | return 0; | 374 | return 0; |
375 | } | 375 | } |
376 | 376 | ||
377 | static struct device_driver corgikbd_driver = { | 377 | static struct platform_driver corgikbd_driver = { |
378 | .name = "corgi-keyboard", | ||
379 | .bus = &platform_bus_type, | ||
380 | .probe = corgikbd_probe, | 378 | .probe = corgikbd_probe, |
381 | .remove = corgikbd_remove, | 379 | .remove = corgikbd_remove, |
382 | .suspend = corgikbd_suspend, | 380 | .suspend = corgikbd_suspend, |
383 | .resume = corgikbd_resume, | 381 | .resume = corgikbd_resume, |
382 | .driver = { | ||
383 | .name = "corgi-keyboard", | ||
384 | }, | ||
384 | }; | 385 | }; |
385 | 386 | ||
386 | static int __devinit corgikbd_init(void) | 387 | static int __devinit corgikbd_init(void) |
387 | { | 388 | { |
388 | return driver_register(&corgikbd_driver); | 389 | return platform_driver_register(&corgikbd_driver); |
389 | } | 390 | } |
390 | 391 | ||
391 | static void __exit corgikbd_exit(void) | 392 | static void __exit corgikbd_exit(void) |
392 | { | 393 | { |
393 | driver_unregister(&corgikbd_driver); | 394 | platform_driver_unregister(&corgikbd_driver); |
394 | } | 395 | } |
395 | 396 | ||
396 | module_init(corgikbd_init); | 397 | module_init(corgikbd_init); |