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-exynos4/pm.c | |
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-exynos4/pm.c')
-rw-r--r-- | arch/arm/mach-exynos4/pm.c | 45 |
1 files changed, 27 insertions, 18 deletions
diff --git a/arch/arm/mach-exynos4/pm.c b/arch/arm/mach-exynos4/pm.c index 10d917d9e3ad..8755ca8dd48d 100644 --- a/arch/arm/mach-exynos4/pm.c +++ b/arch/arm/mach-exynos4/pm.c | |||
@@ -16,6 +16,7 @@ | |||
16 | 16 | ||
17 | #include <linux/init.h> | 17 | #include <linux/init.h> |
18 | #include <linux/suspend.h> | 18 | #include <linux/suspend.h> |
19 | #include <linux/syscore_ops.h> | ||
19 | #include <linux/io.h> | 20 | #include <linux/io.h> |
20 | 21 | ||
21 | #include <asm/cacheflush.h> | 22 | #include <asm/cacheflush.h> |
@@ -372,7 +373,27 @@ void exynos4_scu_enable(void __iomem *scu_base) | |||
372 | flush_cache_all(); | 373 | flush_cache_all(); |
373 | } | 374 | } |
374 | 375 | ||
375 | static int exynos4_pm_resume(struct sys_device *dev) | 376 | static struct sysdev_driver exynos4_pm_driver = { |
377 | .add = exynos4_pm_add, | ||
378 | }; | ||
379 | |||
380 | static __init int exynos4_pm_drvinit(void) | ||
381 | { | ||
382 | unsigned int tmp; | ||
383 | |||
384 | s3c_pm_init(); | ||
385 | |||
386 | /* All wakeup disable */ | ||
387 | |||
388 | tmp = __raw_readl(S5P_WAKEUP_MASK); | ||
389 | tmp |= ((0xFF << 8) | (0x1F << 1)); | ||
390 | __raw_writel(tmp, S5P_WAKEUP_MASK); | ||
391 | |||
392 | return sysdev_driver_register(&exynos4_sysclass, &exynos4_pm_driver); | ||
393 | } | ||
394 | arch_initcall(exynos4_pm_drvinit); | ||
395 | |||
396 | static void exynos4_pm_resume(void) | ||
376 | { | 397 | { |
377 | /* For release retention */ | 398 | /* For release retention */ |
378 | 399 | ||
@@ -394,27 +415,15 @@ static int exynos4_pm_resume(struct sys_device *dev) | |||
394 | /* enable L2X0*/ | 415 | /* enable L2X0*/ |
395 | writel_relaxed(1, S5P_VA_L2CC + L2X0_CTRL); | 416 | writel_relaxed(1, S5P_VA_L2CC + L2X0_CTRL); |
396 | #endif | 417 | #endif |
397 | |||
398 | return 0; | ||
399 | } | 418 | } |
400 | 419 | ||
401 | static struct sysdev_driver exynos4_pm_driver = { | 420 | static struct syscore_ops exynos4_pm_syscore_ops = { |
402 | .add = exynos4_pm_add, | ||
403 | .resume = exynos4_pm_resume, | 421 | .resume = exynos4_pm_resume, |
404 | }; | 422 | }; |
405 | 423 | ||
406 | static __init int exynos4_pm_drvinit(void) | 424 | static __init int exynos4_pm_syscore_init(void) |
407 | { | 425 | { |
408 | unsigned int tmp; | 426 | register_syscore_ops(&exynos4_pm_syscore_ops); |
409 | 427 | return 0; | |
410 | s3c_pm_init(); | ||
411 | |||
412 | /* All wakeup disable */ | ||
413 | |||
414 | tmp = __raw_readl(S5P_WAKEUP_MASK); | ||
415 | tmp |= ((0xFF << 8) | (0x1F << 1)); | ||
416 | __raw_writel(tmp, S5P_WAKEUP_MASK); | ||
417 | |||
418 | return sysdev_driver_register(&exynos4_sysclass, &exynos4_pm_driver); | ||
419 | } | 428 | } |
420 | arch_initcall(exynos4_pm_drvinit); | 429 | arch_initcall(exynos4_pm_syscore_init); |