diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2011-04-22 16:03:21 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2011-04-24 13:16:10 -0400 |
commit | bb072c3cf21d1c9a5a2eeb5a00679ee7bf39675b (patch) | |
tree | 8b9b425422e11c5cb5012adf68e9e2a3e957358f /arch/arm/mach-s3c2412 | |
parent | 2eaa03b5bebd1e80014f780d7bf27c3e66daefd6 (diff) |
ARM / Samsung: Use struct syscore_ops for "core" power management
Replace sysdev classes and struct sys_device objects used for "core"
power management by Samsung platforms with struct syscore_ops objects
that are simpler.
This generally reduces the code size and the kernel memory footprint.
It also is necessary for removing sysdevs entirely from the kernel in
the future.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/mach-s3c2412')
-rw-r--r-- | arch/arm/mach-s3c2412/irq.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-s3c2412/mach-jive.c | 19 | ||||
-rw-r--r-- | arch/arm/mach-s3c2412/pm.c | 27 | ||||
-rw-r--r-- | arch/arm/mach-s3c2412/s3c2412.c | 4 |
4 files changed, 25 insertions, 27 deletions
diff --git a/arch/arm/mach-s3c2412/irq.c b/arch/arm/mach-s3c2412/irq.c index f3355d2ec634..1a1aa220972b 100644 --- a/arch/arm/mach-s3c2412/irq.c +++ b/arch/arm/mach-s3c2412/irq.c | |||
@@ -202,8 +202,6 @@ static int s3c2412_irq_add(struct sys_device *sysdev) | |||
202 | 202 | ||
203 | static struct sysdev_driver s3c2412_irq_driver = { | 203 | static struct sysdev_driver s3c2412_irq_driver = { |
204 | .add = s3c2412_irq_add, | 204 | .add = s3c2412_irq_add, |
205 | .suspend = s3c24xx_irq_suspend, | ||
206 | .resume = s3c24xx_irq_resume, | ||
207 | }; | 205 | }; |
208 | 206 | ||
209 | static int s3c2412_irq_init(void) | 207 | static int s3c2412_irq_init(void) |
diff --git a/arch/arm/mach-s3c2412/mach-jive.c b/arch/arm/mach-s3c2412/mach-jive.c index 923e01bdf017..85dcaeb9e62f 100644 --- a/arch/arm/mach-s3c2412/mach-jive.c +++ b/arch/arm/mach-s3c2412/mach-jive.c | |||
@@ -17,7 +17,7 @@ | |||
17 | #include <linux/timer.h> | 17 | #include <linux/timer.h> |
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
19 | #include <linux/gpio.h> | 19 | #include <linux/gpio.h> |
20 | #include <linux/sysdev.h> | 20 | #include <linux/syscore_ops.h> |
21 | #include <linux/serial_core.h> | 21 | #include <linux/serial_core.h> |
22 | #include <linux/platform_device.h> | 22 | #include <linux/platform_device.h> |
23 | #include <linux/i2c.h> | 23 | #include <linux/i2c.h> |
@@ -486,7 +486,7 @@ static struct s3c2410_udc_mach_info jive_udc_cfg __initdata = { | |||
486 | /* Jive power management device */ | 486 | /* Jive power management device */ |
487 | 487 | ||
488 | #ifdef CONFIG_PM | 488 | #ifdef CONFIG_PM |
489 | static int jive_pm_suspend(struct sys_device *sd, pm_message_t state) | 489 | static int jive_pm_suspend(void) |
490 | { | 490 | { |
491 | /* Write the magic value u-boot uses to check for resume into | 491 | /* Write the magic value u-boot uses to check for resume into |
492 | * the INFORM0 register, and ensure INFORM1 is set to the | 492 | * the INFORM0 register, and ensure INFORM1 is set to the |
@@ -498,10 +498,9 @@ static int jive_pm_suspend(struct sys_device *sd, pm_message_t state) | |||
498 | return 0; | 498 | return 0; |
499 | } | 499 | } |
500 | 500 | ||
501 | static int jive_pm_resume(struct sys_device *sd) | 501 | static void jive_pm_resume(void) |
502 | { | 502 | { |
503 | __raw_writel(0x0, S3C2412_INFORM0); | 503 | __raw_writel(0x0, S3C2412_INFORM0); |
504 | return 0; | ||
505 | } | 504 | } |
506 | 505 | ||
507 | #else | 506 | #else |
@@ -509,16 +508,11 @@ static int jive_pm_resume(struct sys_device *sd) | |||
509 | #define jive_pm_resume NULL | 508 | #define jive_pm_resume NULL |
510 | #endif | 509 | #endif |
511 | 510 | ||
512 | static struct sysdev_class jive_pm_sysclass = { | 511 | static struct syscore_ops jive_pm_syscore_ops = { |
513 | .name = "jive-pm", | ||
514 | .suspend = jive_pm_suspend, | 512 | .suspend = jive_pm_suspend, |
515 | .resume = jive_pm_resume, | 513 | .resume = jive_pm_resume, |
516 | }; | 514 | }; |
517 | 515 | ||
518 | static struct sys_device jive_pm_sysdev = { | ||
519 | .cls = &jive_pm_sysclass, | ||
520 | }; | ||
521 | |||
522 | static void __init jive_map_io(void) | 516 | static void __init jive_map_io(void) |
523 | { | 517 | { |
524 | s3c24xx_init_io(jive_iodesc, ARRAY_SIZE(jive_iodesc)); | 518 | s3c24xx_init_io(jive_iodesc, ARRAY_SIZE(jive_iodesc)); |
@@ -536,10 +530,9 @@ static void jive_power_off(void) | |||
536 | 530 | ||
537 | static void __init jive_machine_init(void) | 531 | static void __init jive_machine_init(void) |
538 | { | 532 | { |
539 | /* register system devices for managing low level suspend */ | 533 | /* register system core operations for managing low level suspend */ |
540 | 534 | ||
541 | sysdev_class_register(&jive_pm_sysclass); | 535 | register_syscore_ops(&jive_pm_syscore_ops); |
542 | sysdev_register(&jive_pm_sysdev); | ||
543 | 536 | ||
544 | /* write our sleep configurations for the IO. Pull down all unused | 537 | /* write our sleep configurations for the IO. Pull down all unused |
545 | * IO, ensure that we have turned off all peripherals we do not | 538 | * IO, ensure that we have turned off all peripherals we do not |
diff --git a/arch/arm/mach-s3c2412/pm.c b/arch/arm/mach-s3c2412/pm.c index a7417c479ffe..752b13a7b3db 100644 --- a/arch/arm/mach-s3c2412/pm.c +++ b/arch/arm/mach-s3c2412/pm.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/timer.h> | 17 | #include <linux/timer.h> |
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
19 | #include <linux/sysdev.h> | 19 | #include <linux/sysdev.h> |
20 | #include <linux/syscore_ops.h> | ||
20 | #include <linux/platform_device.h> | 21 | #include <linux/platform_device.h> |
21 | #include <linux/io.h> | 22 | #include <linux/io.h> |
22 | 23 | ||
@@ -86,13 +87,24 @@ static struct sleep_save s3c2412_sleep[] = { | |||
86 | SAVE_ITEM(S3C2413_GPJSLPCON), | 87 | SAVE_ITEM(S3C2413_GPJSLPCON), |
87 | }; | 88 | }; |
88 | 89 | ||
89 | static int s3c2412_pm_suspend(struct sys_device *dev, pm_message_t state) | 90 | static struct sysdev_driver s3c2412_pm_driver = { |
91 | .add = s3c2412_pm_add, | ||
92 | }; | ||
93 | |||
94 | static __init int s3c2412_pm_init(void) | ||
95 | { | ||
96 | return sysdev_driver_register(&s3c2412_sysclass, &s3c2412_pm_driver); | ||
97 | } | ||
98 | |||
99 | arch_initcall(s3c2412_pm_init); | ||
100 | |||
101 | static int s3c2412_pm_suspend(void) | ||
90 | { | 102 | { |
91 | s3c_pm_do_save(s3c2412_sleep, ARRAY_SIZE(s3c2412_sleep)); | 103 | s3c_pm_do_save(s3c2412_sleep, ARRAY_SIZE(s3c2412_sleep)); |
92 | return 0; | 104 | return 0; |
93 | } | 105 | } |
94 | 106 | ||
95 | static int s3c2412_pm_resume(struct sys_device *dev) | 107 | static void s3c2412_pm_resume(void) |
96 | { | 108 | { |
97 | unsigned long tmp; | 109 | unsigned long tmp; |
98 | 110 | ||
@@ -102,18 +114,9 @@ static int s3c2412_pm_resume(struct sys_device *dev) | |||
102 | __raw_writel(tmp, S3C2412_PWRCFG); | 114 | __raw_writel(tmp, S3C2412_PWRCFG); |
103 | 115 | ||
104 | s3c_pm_do_restore(s3c2412_sleep, ARRAY_SIZE(s3c2412_sleep)); | 116 | s3c_pm_do_restore(s3c2412_sleep, ARRAY_SIZE(s3c2412_sleep)); |
105 | return 0; | ||
106 | } | 117 | } |
107 | 118 | ||
108 | static struct sysdev_driver s3c2412_pm_driver = { | 119 | struct syscore_ops s3c2412_pm_syscore_ops = { |
109 | .add = s3c2412_pm_add, | ||
110 | .suspend = s3c2412_pm_suspend, | 120 | .suspend = s3c2412_pm_suspend, |
111 | .resume = s3c2412_pm_resume, | 121 | .resume = s3c2412_pm_resume, |
112 | }; | 122 | }; |
113 | |||
114 | static __init int s3c2412_pm_init(void) | ||
115 | { | ||
116 | return sysdev_driver_register(&s3c2412_sysclass, &s3c2412_pm_driver); | ||
117 | } | ||
118 | |||
119 | arch_initcall(s3c2412_pm_init); | ||
diff --git a/arch/arm/mach-s3c2412/s3c2412.c b/arch/arm/mach-s3c2412/s3c2412.c index 4c6df51ddf33..ef0958d3e5c6 100644 --- a/arch/arm/mach-s3c2412/s3c2412.c +++ b/arch/arm/mach-s3c2412/s3c2412.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/clk.h> | 19 | #include <linux/clk.h> |
20 | #include <linux/delay.h> | 20 | #include <linux/delay.h> |
21 | #include <linux/sysdev.h> | 21 | #include <linux/sysdev.h> |
22 | #include <linux/syscore_ops.h> | ||
22 | #include <linux/serial_core.h> | 23 | #include <linux/serial_core.h> |
23 | #include <linux/platform_device.h> | 24 | #include <linux/platform_device.h> |
24 | #include <linux/io.h> | 25 | #include <linux/io.h> |
@@ -244,5 +245,8 @@ int __init s3c2412_init(void) | |||
244 | { | 245 | { |
245 | printk("S3C2412: Initialising architecture\n"); | 246 | printk("S3C2412: Initialising architecture\n"); |
246 | 247 | ||
248 | register_syscore_ops(&s3c2412_pm_syscore_ops); | ||
249 | register_syscore_ops(&s3c24xx_irq_syscore_ops); | ||
250 | |||
247 | return sysdev_register(&s3c2412_sysdev); | 251 | return sysdev_register(&s3c2412_sysdev); |
248 | } | 252 | } |