aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/mioa701.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-05-20 01:36:52 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-05-20 01:36:52 -0400
commit880102e78547c1db158a17e36cf0cdd98e7ad710 (patch)
tree3fff9cc54c44dafe275cfabefb96c589e08d971d /arch/arm/mach-pxa/mioa701.c
parent3d07f0e83d4323d2cd45cc583f7cf1957aca3cac (diff)
parent39ab05c8e0b519ff0a04a869f065746e6e8c3d95 (diff)
Merge remote branch 'origin/master' into merge
Manual merge of arch/powerpc/kernel/smp.c and add missing scheduler_ipi() call to arch/powerpc/platforms/cell/interrupt.c Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/arm/mach-pxa/mioa701.c')
-rw-r--r--arch/arm/mach-pxa/mioa701.c43
1 files changed, 8 insertions, 35 deletions
diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c
index 23925db8ff74..e3470137c934 100644
--- a/arch/arm/mach-pxa/mioa701.c
+++ b/arch/arm/mach-pxa/mioa701.c
@@ -22,7 +22,7 @@
22#include <linux/kernel.h> 22#include <linux/kernel.h>
23#include <linux/init.h> 23#include <linux/init.h>
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25#include <linux/sysdev.h> 25#include <linux/syscore_ops.h>
26#include <linux/input.h> 26#include <linux/input.h>
27#include <linux/delay.h> 27#include <linux/delay.h>
28#include <linux/gpio_keys.h> 28#include <linux/gpio_keys.h>
@@ -488,7 +488,7 @@ static void install_bootstrap(void)
488} 488}
489 489
490 490
491static int mioa701_sys_suspend(struct sys_device *sysdev, pm_message_t state) 491static int mioa701_sys_suspend(void)
492{ 492{
493 int i = 0, is_bt_on; 493 int i = 0, is_bt_on;
494 u32 *mem_resume_vector = phys_to_virt(RESUME_VECTOR_ADDR); 494 u32 *mem_resume_vector = phys_to_virt(RESUME_VECTOR_ADDR);
@@ -514,7 +514,7 @@ static int mioa701_sys_suspend(struct sys_device *sysdev, pm_message_t state)
514 return 0; 514 return 0;
515} 515}
516 516
517static int mioa701_sys_resume(struct sys_device *sysdev) 517static void mioa701_sys_resume(void)
518{ 518{
519 int i = 0; 519 int i = 0;
520 u32 *mem_resume_vector = phys_to_virt(RESUME_VECTOR_ADDR); 520 u32 *mem_resume_vector = phys_to_virt(RESUME_VECTOR_ADDR);
@@ -527,43 +527,18 @@ static int mioa701_sys_resume(struct sys_device *sysdev)
527 *mem_resume_enabler = save_buffer[i++]; 527 *mem_resume_enabler = save_buffer[i++];
528 *mem_resume_bt = save_buffer[i++]; 528 *mem_resume_bt = save_buffer[i++];
529 *mem_resume_unknown = save_buffer[i++]; 529 *mem_resume_unknown = save_buffer[i++];
530
531 return 0;
532} 530}
533 531
534static struct sysdev_class mioa701_sysclass = { 532static struct syscore_ops mioa701_syscore_ops = {
535 .name = "mioa701", 533 .suspend = mioa701_sys_suspend,
536}; 534 .resume = mioa701_sys_resume,
537
538static struct sys_device sysdev_bootstrap = {
539 .cls = &mioa701_sysclass,
540};
541
542static struct sysdev_driver driver_bootstrap = {
543 .suspend = &mioa701_sys_suspend,
544 .resume = &mioa701_sys_resume,
545}; 535};
546 536
547static int __init bootstrap_init(void) 537static int __init bootstrap_init(void)
548{ 538{
549 int rc;
550 int save_size = mioa701_bootstrap_lg + (sizeof(u32) * 3); 539 int save_size = mioa701_bootstrap_lg + (sizeof(u32) * 3);
551 540
552 rc = sysdev_class_register(&mioa701_sysclass); 541 register_syscore_ops(&mioa701_syscore_ops);
553 if (rc) {
554 printk(KERN_ERR "Failed registering mioa701 sys class\n");
555 return -ENODEV;
556 }
557 rc = sysdev_register(&sysdev_bootstrap);
558 if (rc) {
559 printk(KERN_ERR "Failed registering mioa701 sys device\n");
560 return -ENODEV;
561 }
562 rc = sysdev_driver_register(&mioa701_sysclass, &driver_bootstrap);
563 if (rc) {
564 printk(KERN_ERR "Failed registering PMU sys driver\n");
565 return -ENODEV;
566 }
567 542
568 save_buffer = kmalloc(save_size, GFP_KERNEL); 543 save_buffer = kmalloc(save_size, GFP_KERNEL);
569 if (!save_buffer) 544 if (!save_buffer)
@@ -576,9 +551,7 @@ static int __init bootstrap_init(void)
576static void bootstrap_exit(void) 551static void bootstrap_exit(void)
577{ 552{
578 kfree(save_buffer); 553 kfree(save_buffer);
579 sysdev_driver_unregister(&mioa701_sysclass, &driver_bootstrap); 554 unregister_syscore_ops(&mioa701_syscore_ops);
580 sysdev_unregister(&sysdev_bootstrap);
581 sysdev_class_unregister(&mioa701_sysclass);
582 555
583 printk(KERN_CRIT "Unregistering mioa701 suspend will hang next" 556 printk(KERN_CRIT "Unregistering mioa701 suspend will hang next"
584 "resume !!!\n"); 557 "resume !!!\n");